Skip to main content

Required config

{
  "storage": {
    "adapter": "phrase",
    "config": {
      "projectID": "project-uuid",
      "apiTokenEnv": "PHRASE_API_TOKEN",
      "mode": "strings"
    }
  }
}

Optional config fields

  • sourceLanguage
  • targetLanguages
  • timeoutSeconds
  • fileFormat (required when mode is files)

Modes

  • strings: pull and push using Phrase key and translation APIs.
  • files: pull and push using Phrase export/import jobs.

Common issues

  • token not found: export PHRASE_API_TOKEN
  • mode validation error: set mode to strings or files
  • file mode import failure: verify fileFormat matches your project settings

Phrase CLI config

The file workflow commands can also read Phrase’s .phrase.yml format:
phrase:
  access_token: $PHRASE_ACCESS_TOKEN
  project_id: project-uuid
  file_format: json
  host: https://api.phrase.com/v2
  locale_mapping:
    fr-FR: fr
  push:
    sources:
      - file: ./locales/en.json
        params:
          locale_id: en-US
          tags: app,source
          update_translations: true
  pull:
    targets:
      - file: ./locales/<locale_name>.json
        params:
          locale_id: fr-FR
          include_unverified_translations: false
Supported commands:
  • hyperlocalise phrase config validate --config .phrase.yml
  • hyperlocalise phrase upload sources --config .phrase.yml
  • hyperlocalise phrase download translations --config .phrase.yml
If --config is omitted, Hyperlocalise checks PHRASEAPP_CONFIG, then .phrase.yml in the current directory, then $HOME/.phrase.yml.