The internationalization process is not working.
I ran cake i18n export. After that I put the translations into the file “.po” in the folder app/locale/por/LC_MESSAGES/default.po..
I called the method beforeFilter() in the AppController Configure::write('Config.language', 'por');.
But the translation isn’t shown in __()-methods.
Here are some possible suggestions:
• Clear the Cake cache in
PATH_YOUR_APP/tmp/cache. Delete the files inmodelsandpersistent, but not the directories itself. I believe persistent is where the localised strings are saved, but empty both to be sure.• Do you override the
beforeFilterin any of your controllers, other than theAppController? If so callparent::beforeFilter();in the controller’sbeforeFiltermethod, before processing other stuff, like so:• How did you create the translation files? Is there a
.mofile in the.podirectory as well? I believe directly editing.poand.potfiles is not recommended due to character encoding issues (but I could be mistaken). Poedit is a good tool for manipulating.pofiles, though it could be more robust.