How to extract and translate CakePHP main lines?

How can I extract the strings defined in the CakePHP core (for example, messages with the auth component) using the i2n cake console?

I tried to launch cake i18n extract both the path to the application folder and the cake folder, but this did not give me the core of the cake in the .pot file.

+4
source share
2 answers

When using the -paths option, main lines can be included. This is an example call:

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

You need to run the desolat command (with -paths and -paths). Then you need to generate the .po from the po file (use the poedit tool or, not suggested, manually) to your Locale. For example, if you want an Italian translation, you should put cake.po in

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

Remember also that for non-basic strings (e.g. month names) you must generate the default.po file in the same folder.

0
source

Source: https://habr.com/ru/post/1311442/


All Articles