Hi, That can be the Cake's way but that is not a good way to make it.
Using msgid's (or keys if you prefer) to lookup the localization database is much better way as then you have full power to differentiate when needed the case when some specific case is only different in one of the languages. The key point here is to use common msgid's for most of the stuff and when there is detected case where special handling is needed then differentiate only for that case. Using descriptive names does give enough information for developer to pick up the correct stuff. And if something is wrong then localization team (if you happen to have one) or the customer tells you what. Also it helps for localization people to connect string to acutual usage place. Just using plain English in source code is bad. I think good example here is with MS Word and referring numbered pictures. In English (Picture is the category name): In [Picture 1] you can see this and that. In Finnish (Kuva is the category name): [Kuvassa 1] näet sitä ja tätä. But by default Word only provides: [Kuva 1] näet sitä ja tätä. Which is rather bad sounding and not proper. Most probable reason is that English speaker who made the code have never though that there might be a need to have only number as a reference in the output and let user write proper terms around it. And then localization team probably didn't pick it up as they only translated a word. Thanks, Vesa Jääskeläinen On 19.4.2010 8:00, Miles J wrote: > The proper way in Cake to do l10n is to use full sentences. Not keys/ > slugs for the msgids. > > By doing so you can use Cakes l10n shell. > > On Apr 18, 9:38 pm, "O.J. Tibi" <[email protected]> wrote: >> Localization strings in PO files should not be treated on a word-for- >> word basis. It is much more convenient to enter phrases (at the least) >> or paragraphs (at the most) that you want to translate. It might also >> be helpful that you do a page-by-page audit of your web app, and from >> there coordinate with your translator on how you would like to >> translate the content. >> >> On Apr 18, 1:59 pm, Vesa Jääskeläinen <[email protected]> wrote: >> >> >> >>> Hi All, >> >>> In some situations some localization entries in .po file can have >>> empty strings defined in some languages and in some other languages >>> there should be some text. >> >>> So in example in locale A's .po file there would be: >> >>> msgid "Entry" >>> msgstr "" >> >>> And then in locale B's .po file: >> >>> msgid "Entry" >>> msgstr "This local has special stuff here" >> >>> Now CakePHP seems to insist with __('Entry', true) giving "Entry" for >>> locale A instead of defined empty string. >> >>> So the questions: >> >>> 1) Can it be considered a bug that will be fixed in future release? >>> Preferably in which :) >> >>> 2) If not, what is the way to get this empty string from localization >>> file in proper CakePHP way? >> >>> I can always hack CakePHP's libs to work in this way but I would like >>> to keep it as close to original as possible. >> >>> Thanks, >>> Vesa Jääskeläinen >> >>> Check out the new CakePHP Questions sitehttp://cakeqs.organdhelp others >>> with their CakePHP related questions. >> >>> You received this message because you are subscribed to the Google Groups >>> "CakePHP" 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 >>> athttp://groups.google.com/group/cake-php?hl=en >> >> Check out the new CakePHP Questions sitehttp://cakeqs.organd help others >> with their CakePHP related questions. >> >> You received this message because you are subscribed to the Google Groups >> "CakePHP" 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 >> athttp://groups.google.com/group/cake-php?hl=en > > Check out the new CakePHP Questions site http://cakeqs.org and help others > with their CakePHP related questions. > > You received this message because you are subscribed to the Google Groups > "CakePHP" 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 > Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" 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
