I want to have an expert comment on whether we should use unique ids or sentences for the msgids in the po files in cakephp.
Ive read somewhere that using phrases for msgid would help cake in using Cakes l10n shell. What does it exactly means?
Secondly if we use unique msgids then we also need to create a separate po file for the website’s main language i.e english. Is this approach violates the cake’s best practices.
E.g.
Approach 1
msgid “How it works ?”
msgstr “any-translated-string”
Approach 2
msgid “label_how_it_works”
msgstr “any-translated-string”
Any feedback would be highly appreciated.
When using i18n with CakePHP, I use the actual string as the msgid. This not only saves me from having to create an English locale file, but your view will remain easy to read/skim through/change. Think about having all your static text in your views changed to a unique identifier.
Instead of having something readable like
<p><?php __('Welcome to my website, here at...') ?></p>your views will be filled with<p><?php __('website_welcome_home_page') ?></p>