Download the PHP package kunicmarko/static-translations without Composer
On this page you can find all versions of the php package kunicmarko/static-translations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kunicmarko/static-translations
More information about kunicmarko/static-translations
Files in kunicmarko/static-translations
Package static-translations
Short Description This is a Symfony Bundle that helps you to generate translations for static/hardcoded strings from Excel files, thanks to the PHPExcel library
License MIT
Homepage https://github.com/kunicmarko20/static-translation
Informations about the package static-translations
Symfony Static Translations Bundle
This bundle helps you generate translation for static strings in symfony application.
This bundle uses PHPOffice/PHPExcel bundle
PHPExcel bundle Requirements
- PHP version 5.2.0 or higher
- PHP extension php_zip enabled (required if you need PHPExcel to handle .xlsx .ods or .gnumeric files)
- PHP extension php_xml enabled
- PHP extension php_gd2 enabled (optional, but required for exact column width autocalculation)
Installation
1. Add to composer.json to the require
key
2. Register the bundle in app/AppKernel.php
Command
php app/console generate:static:translations /path/to/excel/file languages
Command accepts 2 parameters, you can run it without parameters and then you get interactive console with help on how to use command
Parameters
1. Excel file
Provide path to your Excel file that has to end with .xlsx
Formating of Excel file ( can also be found here ):
A | B | ||
---|---|---|---|
1 | English | German | |
2 | |||
3 | About Us | Über uns | label.about |
4 | Contact | Kontakt | |
5 | Imprint | Impressum | form.imprint, default.language.source |
We expect words for translation to start from line 3
You can add more languages, we only expect labels to be at last position
Labels are optional
, there can be more than one label for same word, they just have to be divided by comma (,)
If you add labels, label names will be used for source
tags in xml
If you want to use default language word for source and use labels for same word, you can use reserved word default.language.source
and add it in labels part
2. Languages
We expect array of language codes, divided by space e.g. en de fr
, use same order as in your excel file.
First language in array is source language and will be used for all source tags.
All versions of static-translations with dependencies
symfony/framework-bundle Version ~2.8|~3.0
phpoffice/phpexcel Version ~1.8.1