internationalization - cakePhp and multi languages -


i creating website in cakephp 2.2. new framework. need help, step step how create multilanguage page. have created translations in locale/eng/lc_messages.default.po , same fre. what's next? can set language display? can write language displayed user?

thank help!

you have to: create files , folder follows:

/app/locale/eng/lc_messages/default.po (english) /app/locale/fre/lc_messages/default.po (french) 

in default.po files need create pairs:

msgid "hello" msgstr "en translation" 

with this, every hello word replaced en translation.

next have set language i.e.

configure::write('config.language', 'fre'); 

if want set language page, paste in bootstrap file, if want change during exploring webpage paste this:

$this->session->write('config.language', 'fre'); 

in beforefilter function in controller.


Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -