Skip to content

.translatr.yml

René Panzar edited this page Nov 7, 2016 · 2 revisions

The configuration file .translatr.yml is expected in any directory the CLI will be invoked in. It is a YAML file with the following structure.

Structure

translatr:
  endpoint: http://translatr.resamsel.com # URL to the Translatr installation
  project_id: 1234-5678 # ID of the project associated with this directory
  access_token: abcdefgh # the access token with project:read, locale:read, and locale:write (optional) scope
  pull: # configuration for downloading remote translations
    file_type: java_properties
    target: src/main/resources/messages_?{locale.name}.properties
  push: # configuration for uploading local translations
    file_type: java_properties
    target: src/main/resources/messages_?{locale.name}.properties

File Types

The following file types can be used within the pull and push configuration.

Java Properties

Key: java_properties

Play Messages

Key: play_messages

Gettext PO files

Key: gettext

Environment Variables

Starting with v2.1.0, environment variables can be used in the config file with the following syntax within any value: ${ENV_VAR}. They should be used to avoid exposing access tokens in code repositories.

Example

translatr:
  ...
  access_token: ${TRANSLATR_ACCESS_TOKEN}
  ...
Clone this wiki locally