- Features
- Installation
- Creating Excel files with new translations
- Update PHP message files from Excel files
- Project
Features ¶
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.
Installation ¶
Install the package with composer.
composer require codemix/yii2-excel-message
Then update your console configuration:
<?php
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 B
.
The files will be in Excel2007
format with xlsx
extension.
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.
Project ¶
Find more details on our project page at Github:
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.