symfony-translations-helper
Simple commands to manage translations in Symfony., (*1)
This bundle allows you to write missing translations from a yml file to another requesting the missing translations and storing them in the output file., (*2)
For each non found translation it will request the translation showing the field id and the original text to translate, making it very easy to update your translation files when you have added fields to them, (*3)
** It currently only suports yml translations files, (*4)
Contents
Installation
Just require the bundle with composer:, (*5)
composer.phar require davidrojo/sf-translations-helper, (*6)
And then add it to app/AppKernel.php:, (*7)
public function registerBundles()
{
$bundles = [
...
new DavidRojo\SfTranslationHelper\SfTranslationsBundle(),
...
]
}
}
Usage
Execute the command, (*8)
php bin/console translations:helper [from_language] [to_language] [BundleName|File] [allowEmpty]
Arguments:, (*9)
from Origin language file (example: en)
to Destination language file (example: fr)
file Bundle name or the full path from current folder to the input file
addEmpty Optional (true/false), Add empty values to the destination
file if no translation is added (default: false)
Options:, (*10)
--no-backup If not present a .backup file will be generated if output file exists
Example
$ php bin/console translations:helper en fr AppBundle
Destination file already exists. Override? (y/n): y
Counting missing translations...3 missing, 0 empty
Field id: delete
Original: Eliminar
Please enter the translation: Effacer
Field id: courses.create
Original: Crear curso
Please enter the translation: Créer un cours
Field id: total
Original: Total
Please enter the translation: Total
Saving file.
File saved at /AppBundle//Resources/translations/messages.fr.yml
Contributions
Just open an issue or send a pull request and if it fits it will be integrated., (*11)
Donations
If you liked this bundle and saved you a little of time, you can:, (*12)
;), (*13)