How to translate cakephp 3

2

I generated the default.pot , I created the pt_BR folder at:

link

/src/Locale/pt_BR/default.po

and put it in config / app.php

'defaultLocale' => env('APP_DEFAULT_LOCALE', 'pt_BR'),

translation made with poEdit , but does not translate actions

    
asked by anonymous 15.07.2016 / 00:56

1 answer

1

So the translation takes place in a few steps and it is not automatic need of your intervention, I will try to take a step-by-step:

01 - in the root of your application run the command below to extract a file with all the texts that can be translated in the application:

bin / cake i18n

02 - If you have executed everything right by entering enter at each step, the command will generate the catalog files (.POT) in the src / Locale folder, open those files with the POEDIT program and translate line by line. >

03 - When you have finished translating all lines, save the file named src / Locale / pt_BR / default.po

Comments:

If in the process you choose not to merge all domains the extraction command will create two catalogs cake.pot (system messages) and default.pot (messages from your MVCs) translate the two. To conclude, do not forget to set Locale pt_BR in config / app.php, enjoy and also change the time zone from "UTC" to "America / Sao_Paulo" in config / bootstrap.php and that's it, translated application.

    
12.09.2017 / 02:32