简体   繁体   中英

CakePHP i18n not working

I followed the instruction and created .po file with PoEdit with Language: Vietnamese, Country: VIETNAM in: my_app ./Locale/vie/LC_MESSAGES/default.po

I double check it with a plain editor to see the msgid and here is an example:

#Path

msgid "Login"

msgstr "Đăng nhập"

In the bootstrap.php: Configure::write('Config.language', 'vie'); I tried Configure::write('Config.language', 'vi'); also.

In the view file I echo __("Login"); but it still displays "Login"...

I have tried so many ways to make it work even restart Apache or my computer but no success. Any helps will be appreciated!

My ENV:

  • XAMPP v1.7.3 with gettext lib enabled

  • MAC OSX Lion 10.7.2

  • CakePHP 2.1.1 Stable

Do you have uses ( 'L10n' ); in there?

A code sample would help. I know there's several files involved, but that's just the way things are.. samples from each file. Have you read through the manual ?

This post also speaks to file organization.

If you are sure that *.po files are OK, deleting the files inside the folders can help. (Not folders, only files)

/app/tmp/cache/persistent/myapp_cake_core_*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM