Download the PHP package hricer/sync-translations without Composer
On this page you can find all versions of the php package hricer/sync-translations. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download hricer/sync-translations
More information about hricer/sync-translations
Files in hricer/sync-translations
Package sync-translations
Short Description Synchronize all translation files.
License MIT
Informations about the package sync-translations
Sync Translation Files
The command for synchronize all translation files according to one locale file. This will ensure that all translation files contain the same keys.
This allows the developer to manage only one language. Before deploy the application into production, the developer executes synchronization for other languages.
Usage
Imagine you made changes to the main locale file, e.g. messages.en.yaml
:
Now you need synchronize all messages.*.yaml
files by messages.en.yaml
(add new or remove old lines). Type into the terminal:
Options | Default | Description |
---|---|---|
--domain |
* (all) |
The translation domain name to synchronize. |
--directory |
translations |
Directory with translation files. |
--format |
yaml |
Only YAML supported. |
--deepl |
null |
Optional DeepL API key for auto translation. |
The command will update all messages.*.yaml
(exclude en).
For exmaple message.cs.yaml
:
You can use --deepl
parameter for auto translate all new lines.
Install
Step 1: Download the package
$ composer require hricer/sync-translations --dev
Step 2: Regist the Bundle
Without Symfony Bundle system
Create a console application with translation:sync as its only command:
All versions of sync-translations with dependencies
symfony/console Version ^6.1
symfony/yaml Version ^6.1
deeplcom/deepl-php Version ^1.5.0