The package that helps you keep your translations consistent
MIT License
Package which helps to keep you translations consistent. Compatible with 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.
php bin/console aeliot_trans_maintain:yaml:transform <PATH_TO_FILE_TO_BE_UPDATED>
php bin/console aeliot_trans_maintain:yaml:transform --all
php bin/console aeliot_trans_maintain:yaml:transform --domain=messages --domain=validators --locale=en --locale=de
find PATH_TO_DIRECTORY -type f \( -iname \*.yml -o -iname \*.yaml \) | sort | xargs -I {} -t php bin/console aeliot_trans_maintain:yaml:transform $1{}
You can filter them additionally with grep "some text in the file path"
when you add this before, after or instead of sort
instruction.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.