TransMaintain helps to keep you translations consistent. It gives handy tools for their management and control on CI.
Compatible with all Symfony versions since: 3.4.
Basically, if you use Flex there is enough to execute the command:
composer require --dev aeliot-tm/translation-maintain
See additional information about installation there and description of configuration.
Test your YAML translation files:
php bin/console aeliot_trans_maintain:lint:yaml base
Full information about files transformation see there.
- Update certain YAML file:
php bin/console aeliot_trans_maintain:yaml:transform <PATH_TO_FILE_TO_BE_UPDATED>
- Update all YAML files in the project:
php bin/console aeliot_trans_maintain:yaml:transform --all
- Update some YAML files of the project which belongs to domain(s) and/or locale(s):
php bin/console aeliot_trans_maintain:yaml:transform --domain=messages --domain=validators --locale=en --locale=de
- Update all YAML files in the specific directory (e.g. not standard or not in the project):
You can filter them additionally with
find PATH_TO_DIRECTORY -type f \( -iname \*.yml -o -iname \*.yaml \) | sort | xargs -I {} -t php bin/console aeliot_trans_maintain:yaml:transform $1{}
grep "some text in the file path"
when you add this before, after or instead ofsort
instruction. And don't forget to separate instructions by the pipe.
Additional information about updating of YAML files see there.
Example:
php bin/console aeliot_trans_maintain:yaml:export_missed_translations messages en de
Full information about files transformation see there.
Full information about machine translation see there.
NOTE: There used standard \Symfony\Component\Yaml\Yaml
class for dumping, so it inserts single-word values without escaping.
Article on the Habr (ru): https://habr.com/ru/articles/555954/
You can help to implement more features :) See plans there.