- if you have your translations in several files like users.po/mo,
posts.po/mo etc, just use proper 'text domain' as 1st argument of
__d() function
- if you have them in one file default.po/mo, allways use
__d('default', ...

Split translated texts to several files is not best solution for every
project - I would propose to execute 'cake extract', select option
'save to one file', then create binary default.mo file with PoEdit,
and see size of this binary file. I'm pretty sure that it's a way
better to load one few_kB file, instead of seek and load 2-3 files (I
doubt that your view will use translations from one text domain only).

Also - from my perspective, usage of __() function is quite expensive
- it uses debug_backtrace() inside (so cake knows where it was called
from and can determine proper text domain). I would suggest to use
__d() instead - if you know text domain used for this text idiom, off
course.

Also - in production, allways use binary files .mo instead of
plaintext .po - they are smaller, faster, and for example - if text
domain is 'users', it looks for translation files in order (until one
of them is found):

users.mo
default.mo
users.po
default.po
core.mo
core.po

>From above - if you're calling __('Username') from app/views/users/
login.ctp and you're using plaintext users.po file, EVERY call __()
uses debug_backtrace() inside, and in first occurence of __() in this
view seeks for users.mo, default.mo and THEN it finds && loads
users.po (any later attempt to translate something from text domain
'users' - if translation is found in already parsed translations for
proper text domain - will not cause searching of translation files,
off course, cake reuses them).


--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to