Enabling multilingual support and creating po locale files are very easy with cakephp-script.
We can use cakephp console framework for this.
There are few simple steps to create po files first:
1: Navigate to you app folder: cd /path/to/cakephp/app
2: Run command: Console/cake
3: Install cakephp-script: apt-get install cakephp-scripts
4: Run command: cake i18n
5: Once you will enter path of locale files, all locale files will be created accordingly
6: For making default language write following lines in core.php
Configure::write('Config.language', 'lang');
7: You also need to take care of the UTF8 formating of these po files so use poedit editor to edit these files:
sudo apt-get install poedit
For more details you can read following articles:
http://book.cakephp.org/2.0/en/core-libraries/internationalization-and-localization.html
http://book.cakephp.org/2.0/en/console-and-shells.html
https://github.com/cakephp/cakephp/blob/2.4.7/lib/Cake/I18n/L10n.php#L83-L85
0 Comment(s)