I'm setting the localization on a website, but I've some trouble.
I've found a tutorial, which does exactly what I need: http://nuts-and-bolts-of-cakephp.com/2008/11/28/cakephp-url-based-language-switching-for-i18n-and-l10n-internationalization-and-localization/ (having directly the language after the hostname).
So I've done everything which is written on this website:
- I've generated a pot file, with this pot file, I create three po files(eng, ger and fre) with PoEdit, I translated two tests fields.
- I've put those files into app/locale/eng|fre|ger
- I've added the route Router::connect('/:language/:controller/:action/*', array(),array('language' => '[a-z]{3}')); in the correct file
- I've set the default language: Configure::write('Config.language', 'fre');
- I've created three links to change the language: link('Français', array('language'=>'fre')); ?>
- I've set the _setLanguage method in my appController(and calling it in the beforeFilter())
- I've created an appHelper to don't have to specify everytime the current language
My links are well generated, I don't have any exception/errors, my locals files are readable, but when I go on the template where I try to use variable( ) I just see "testTranslation" as text, no translated text.
Why this isn't working? Looks like it can't find my files but I don't know why :(
Any help would be really appreciated!
Edit: I did some debugging with cakePhp, and it appears that when the method translate of the i18n.php file is called, I receive a $domain = default_ger var. My translations are all in default.po files, and I suppose that he is searching into default_ger.po? why this? how can i force it to read in the default.po file?
Edit: I found something: I had a problem with my controller, I forgot to declare the parent::beforeFilter() in my children controller, then the method in the controller wasn't called and the language was always the german one. After I fixed this, the french and the english are working fine, but the german is still only displaying key and not values that I've in the translation file. This is really weird, I've deleted all files in the cache, deleted my /app/locale/ger folder and copied my /app/locale/fre to /app/locale/ger(without changing anything in files) and this still doesn't work. What can be different?