I have cake 3 fresh installation.
I have a simple po file in this location src/Locale/de_DE/default.po with the following content.
msgid "test"
msgstr "test in german"
On my home page template file I have simple <?php echo __('test'); ?>
I need to set the locale on the fly, so I add this to my AppController's beforeFilter(or initialize) - I18n::locale('de_DE'); however test is not being translated. I can't figure out, what Im missing. I tried renaming all to iso2 - de, but it did not translate either.
Thanks
Open your Terminal, cd to your project folder (the one which contains the bin folder) and type:
bin/cake cache clear_all
That's all. Refresh your page right after. One last thing, be sure to place your .po files in:
Locale/de_DE/your_translations.po
I like to use POEdit to manage my translations. Cheers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With