Skip to main content

Init

Initialize your project by executing the following command:

translized init

A series of questions lets you define your preferred locale file format, download, upload files and more.

Setup Questions/Options

1. API Key

Provide your API key. You can find it in your API access settings (App -> Account -> API Access).

2. Project ID

Provide your project id. You can find it in your project settings (App -> Project -> Settings).

3. File format

Choose your preferred file format from the list. The file format that you are using inside your project.

4. Download file path

This is the path where you want translation files to be downloaded to. By default, it is the current directory.

tip

For example, if you want to choose src/locale as a path where you want your files to be downloaded you should enter the:

src/locale/<locale_code>.json

Where <locale_code> is the variable for the language locale that you are working with.

5. Upload file path

This is the path from where you want to upload your translation file to Translized app. By default, it will use download path specified in previous step (step 4).

6. (Optional) Upload file language code

If you used <locale_code> this will be automatically extracted.

Only if you specify the exact file path (without <locale_code>) you will be asked for a language code for the upload file. By default, it is English (en).

Note

A complete list of supported languages and their values can be found in Supported Languages section.

7. Additional Download Options

Optionally you can add additional options to your download command:

  • Replace empty translations with primary language translations
  • Replace empty translations with pseudolocalized translations of primary language
    • Choosing this option, will prompt question if you want to increase pseudolocalization translation length

Configuration file

It will create .translized.yml file where setup preferences will be stored.

Later you can change it directly or by running the command again.

File example:

---
:translized:
:access_token: 610402a6-5dc3-46aa-bc3b-19a8b29288es
:project_id: zAhfwMRi7f
:download:
- :path: './<locale_code>.json'
:file_format: json
options:
replace_empty:
:primary_translations: true
:upload:
- :path: './<locale_code>.json'