cakephp, i18n .po files, How to use them correctly

Posted by ion on Stack Overflow See other posts from Stack Overflow or by ion
Published on 2010-03-24T11:41:37Z Indexed on 2010/03/25 1:43 UTC
Read the original article Hit count: 426

Filed under:
|
|

I have finally managed to set up a multilingual cakephp site. Although not finished it is the first time where I can change the DEFAULT_LANGUAGE in the bootstrap and I can see the language to change.

My problem right now is that I cannot understand very well how to use the po files correctly. According to the tutorials I've used I need to create a folder /app/locale and inside that folder create a folder for each language in the following format: /locale/eng/LC_MESSAGES.

I have done that and I have also managed to extract a default.pot file using cake i18n extract. And it appears that all occurrences of the __() function have been found succesfully.

In my application I'm using 2 languages: eng and gre. I can see why you would need a seperate folder for each language. However in my case nothing happens when I edit the po files inside each folder....well almost nothing. If I edit the /app/locale/gre/LC_MESSAGES/default.po I have no language changes. If I edit the /app/locale/eng/LC_MESSAGES/default.po then the language changes to the new value (on the translation field) and it does not switch to the other language.

What am I doing wrong. I hope I made myself as clear as possible.

© Stack Overflow or respective owner

Related posts about cakephp

Related posts about i18n