I want to be able to test my cakephp web page using the localization features.
I use the translate function __() and I also use the date and time function: toLocaleString()
I wanted to know how can I test the translation and localization in a simple way.
I know that toLocaleString()
will output the date and time in the local format.
I tried using the following code in my controller's beforeFilter():
$this->Session->write('Config.langauge', 'ger');
Configure::write('Config.language', 'fre');
The above two lines of code didn't work. This did not work either:
setlocale(LC_ALL, 'de', 'ge');
I am using Ubuntu 10.04. I also installed a spanish, french and german language pack.
In the cakephp debug toolkit, it shows that the language has changed, but the date and time string do not change at all. I am not sure what I am doing wrong.
As for testing, the date and time should work once the locale is set, but for the translate functions, how do I test those? I looked into the cakephp documentation, but it says to use the i18n console commang. I tried running the command to extract pot files and I chose my source and output directory, but nothing showed up in the directory when it was done.
Thanks