On 3/2/07, Petry <[EMAIL PROTECTED]> wrote:
>
> Hi people,
>
> I'm a brazilian developer an I have a problem with singular and plural
> rules:
>
> The word "Noticia" the plural form is "Noticias" (words ending by
> "ia", the plural form is "ias")
> The word "Album" the plural form is "Albuns" (words ending by "m", the
> plural form is "ns")
>
> Well for these cases, I've create in inflections.php two rules:
>
> $pluralRules = array('/(.*)m$/i' => '\1ns', '/(.*)ia$/i' => '\1ias');
>
> $singularRules = array('/(.*)ns$/i' => '\1m','/(.*)ias$/i' => '\1a');
>
> but when I create the MVC files with bake, for the word "Noticia",
> bake writes "Noticium"
>
> Why can i fix this problem?I think that, apart from the rules that you specify, there are also some default rules. For example, i've noticed that 'data' is turned into 'datum' , which is very similar to what happens to your 'noticia'-->'noticium'. I might be mistaken (becuse i'm a newbie and have very little understanding on the CakePHP internals) but : probably the inflector is using the first rule it finds , and for 'noticia' it happens to apply some default rule instead of the one that you've specified. Have you tried to add to irregularPlurals 'noticia'=>'noticias' ? The words defined this way are supposed to bypass the rules. -- Adrian Maier --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Cake PHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
