开发者

How to extract and translate CakePHP core strings?

How can I ext开发者_StackOverflowract strings defined in the CakePHP core (like the auth component messages) with the cake i18n console?

I tried to run cake i18n extract with both the path to the app folder and the cake folder but this did not give me the cake core strings in the .pot file.


Core strings can be included when using the -paths option. This is an example call:

cake i18n extract -paths /path/to/app,/path/to/cake/libs/controller


You have to run the desolat command ( with --paths and -paths). Then you have to generate the .po from the po file (use the tool poedit or, not suggested, edit by hand) to your Locale. For example, if you wanna an italian translation, you have to put cake.po in

 /app/Locale/ita/LC_MESSAGES/cake.po

Remember also that for non core strings (like month names), you have to generate a default.po file into the same folder.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜