Tuesday 6 September 2011

Multilingual in Cakephp1.3

Multilingual in cakephp
Just do the following three points

1) In view file user as
echo __('USERNAME'); 

2) IN default.po locale/eng/LC_MESSAGES/default.po
msgid "USERNAME" 
msgstr "User Name"

3) // config/bootstrap.php
define(DEFAULT_LANGUAGE, 'eng');

4)In HTML head add Following
[meta charset="UTF-8"]

Compile .po file
msgfmt message.po.txt -o message.po 

Multilingual Characters save in Database
1. Table Collation should be utf8_general_ci
2. Table's Field Collation should be utf8_general_ci
3. While Save in Db, set character set utf8
4. When Display in Browser, add following tag in Head
<meta charset="UTF-8">