-
Notifications
You must be signed in to change notification settings - Fork 1
Command Line Interface
The Command Line Interface allows to manage translations through the command line. Operations can be used in build scripts to automatically retrieve the latest translations.
Paste this at a terminal prompt:
curl -fsSL https://raw.githubusercontent.com/resamsel/translatr/master/install.sh | bash
To use Translatr CLI we need a .translatr.yml config file. Create one in any directory that you want to enable the CLI. Translatr will then use that file as configuration.
translatr:
endpoint: http://localhost:9000
access_token: <access token>
project_id: <project ID>
pull:
file_type: play_messages
target: conf/messages.?{locale.name}
push:
file_type: play_messages
target: conf/messages.?{locale.name}
Create a new access token (profile -> access tokens) and enter it in .translatr.yml.
Then, create a project in the web GUI and enter the project ID (40 character UUID in the URL, i.e. http://localhost:9000/project/**6f1ee0a7-b5d1-4c7f-8e4d-46c09fece220** -> project ID: 6f1ee0a7-b5d1-4c7f-8e4d-46c09fece220) in .translatr.yml.
By pushing you send the matching messages files to the given endpoint, creating locales if needed.
translatr push
This will overwrite all existing messages, if any. No existing keys/locales will be removed, this is not a sync operation.
By pulling you download all locales into separate files into the configured files (translatr.pull.target key).
translatr pull
This will overwrite any existing files locally. All known locales will be downloaded.