- Creating Excel files with new translations
- Update PHP message files from Excel files
With this extension you can export messages from PHP message files to Excel, send them to your translators and read them back into your message files.
Note: To read and write to and from Excel file, we use the excellent PHPExcel package.
Install the package with composer.
composer require codemix/yii2-excel-message
Then update your console configuration:
return [ 'controllerMap' => [ 'excel-message' => [ 'class' => 'codemix\excelmessage\ExcelMessageController' ] ] // ... ];
Creating Excel files with new translations ¶
To create Excel files with new translations, you need to supply the Yii2 message configuration and the output directory where the files should be written to:
./yii excel-message messages/config.php /output/dir
This will create one file per language (filename == language) with one sheet per
category. The source messages are listed in column
A. Translators should add their
translations to column
The files will be in
Excel2007 format with
Update PHP message files from Excel files ¶
After you receive the Excel files back from your translators you can update your PHP message files. Again you need to supply the Yii2 message configuration and the directory path where your Excel files are:
./yii excel-message/import messages/config.php /input/dir
This will add the new translations to your PHP message files. Yes it's really that simple.
Find more details on our project page at Github: