Internationalization Issues on CakePHP 2.0

The internationalization process does not work.

I ran cake i18n export. After that, I put the translations in the ".po" file in the folder app/locale/por/LC_MESSAGES/default.po..

I called the method beforeFilter()in AppController Configure::write('Config.language', 'por');.

But the translation is not shown in- __()methods.

+1
source share
2 answers

Here are a few suggestions:

• Clear the cake cache in PATH_YOUR_APP/tmp/cache. Delete files in modelsand persistent, but not the directories themselves. I believe that the constant is where the localized strings are stored, but empty to be sure.

beforeFilter , AppController? parent::beforeFilter(); beforeFilter, , :

public function beforeFilter() {
  parent:beforeFilter();
  //Do stuff here
}

• ? .mo .po? , .po .pot - ( ). Poedit - .po, .

+2

,

  • , .
  • msgid msgstr ?
  • CakePHP, bootstrap.php. .
0

All Articles