PhraseApp Client Examples

The following examples show some more complex use cases:

Multiple localization files for one project

We strongly recommend to use one file for each locale in your project. If you are forced to use multiple files by your framework or tools, please refer to our Structuring localization files section for details.

Multiple PhraseApp projects for one localization project

If you feel like management of all the translations of a big localization project in one PhraseApp project is too much and want to distribute those translations over multiple PhraseApp project, you can find instructions on how to configure your CLI for this at our guide’s Multiple localization files for one localization project section.

Using format options

Some file formats support advanced options (format options) to further control the syntax of the file. You can specify format options in your .phraseapp.yml configuration file like this:

phraseapp:
  ...
  pull:
    targets:
      - file: file.xml
        params:
          format_options:
            convert_placeholder: true

  push:
    targets:
      - file: file.csv
        params:
          format_options:
            column_separator: ";"

All available format options are listed for each format in the format guide.

Configuration for Android projects

We recommend to specify each locale explicitly in the .phraseapp.yml. The following example shows how the .phraseapp.yml should look like with English as the default language, a German locale and a German region locale for Austrian:

phraseapp:
  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 typical iso language standard as the file pattern, so it’s necessary to adapt the required pattern in the .phraseapp.yml. For further reading have a look at the Google Developer Documentation