View examples of more complex ways to use the Phrase Client.
We have recently updated our CLI, instead of phraseapp, it is now called phrase.
Although we try to keep things as similar and compatible as possible, there might be some changes.
All documentation now refers to the phrase CLI.
You can access the previous version of the article here.
If you have any questions, please contact us at support@phrase.com.
Multiple localization files for one project
It’s usually best to use one file for each locale in your project. If your tools or framework force you to use multiple files, refer to the guide on structuring localization files for details on how to set up your project.
Multiple Phrase projects for one localization project
When working on a large localization project, you may find it more manageable to distribute your translations over multiple Phrase projects. Learn how to configure your CLI to work with multiple localization files for one localization project.
Using format options
Some file formats let you specify format options for greater control over the syntax of your files. You can specify format options in your .phrase.yml configuration file, like this:
phrase:
pull:
targets:
- file: file.xml
params:
format_options:
convert_placeholder: true
push:
sources:
- file: file.csv
params:
format_options:
column_separator: ";"
All available format options for each format are listed in the format guide.
Configuration for Android projects
It’s best to specify each locale explicitly in your .phrase.yml file. This example shows how .phrase.yml should look with English as the default language, a German locale, and a German region locale for Austrian German:
phrase:
access_token: 930dfe3c2736d745c610c46b3d050b5526a45fcs5d01d007e5103a481f9a40cs
project_id: 3dbc6dc4d79eaa48a7af7ebc7ea12ef5
file_format: xml
pull:
targets:
- file: ./app/src/main/res/values/strings.xml
params:
file_format: xml
# Unique locale id for English
locale_id: 17326bf9e3eb422fe1a33bb2faas7af1
- file: ./app/src/main/res/values-de/strings.xml
params:
file_format: xml
# Unique locale id for German
locale_id: 273dxbf9e3eb422fe1a33bb2fad87af1
- file: ./app/src/main/res/values-de-rAU/strings.xml
params:
file_format: xml
# Unique locale id for Austrian
locale_id: 37326bf9e3eb422fe1a33bb2fad87aas
push:
sources:
- file: ./app/src/main/res/values/strings.xml
params:
file_format: xml
locale_id: 17326bf9e3eb422fe1a33bb2faas7af1
- file: ./app/src/main/res/values-de/strings.xml
params:
file_format: xml
locale_id: 273dxbf9e3eb422fe1a33bb2fad87af1
- file: ./app/src/main/res/values-de-rAU/strings.xml
params:
file_format: xml
locale_id: 37326bf9e3eb422fe1a33bb2fad87aas
Note: Android doesn’t use the standard ISO language codes as the file pattern. You should specify the required pattern in .phrase.yml. For more information about this, refer to the Google Developer Documentation.