Knowledge Base

Documentation to help you use the POEditor localization platform effectively

How to set up the .poeditor.yml file for CLI

Owner Admin

.poeditor.yml tells the POEditor CLI which POEditor projects your repository uses, where each language file lives, and how to sync it. poeditor pull and poeditor push read it. You commit it with your code, so everyone on the team and your CI pipeline sync the same files the same way. It never holds an API token.

How to create it

You rarely write it by hand. In the root folder of your repository, run:

poeditor config init

The wizard asks for:

  1. the account, if you are logged in to more than one;
  2. the project, from your list of projects;
  3. a short alias for the project, such as web, and its source language (by default, the project's reference language);
  4. the project's files. The wizard looks in the current folder for files whose path contains a language code of the project, in the spellings different platforms use (pt-br, pt-BR, pt_BR, Android's pt-rBR), and offers them as patterns such as locales/{lang}.json. It guesses the format from the file extension, then asks which tags to pull and which tags to put on pushed terms. config init needs an interactive terminal. It doesn't overwrite an existing .poeditor.yml, and if you cancel with Ctrl+C, nothing is written.

How to add a project or a file later

poeditor config add

This runs the same wizard and adds only the new entry. Your comments and everything else in the file stay as they are.

What the file looks like

A small file, for one project with one set of JSON files:

projects:
  - id: 12345
    alias: web
    source_language: en
    files:
      - path: locales/{lang}.json
        format: key_value_json

A fuller one, using most options:

projects:
  - id: 12345
    alias: web                     # optional nickname: --project web
    account: client-a              # optional; if left out, the default account
    source_language: en            # the language push uploads terms from
    files:
      - path: locales/{lang}.json
        format: key_value_json
      - path: ios/{lang}.lproj/InfoPlist.strings
        format: apple_strings
        languages: [en, fr, de]    # optional; default: every project language
        language_map:              # optional; POEditor code → code in the path
          pt-br: pt-BR
        pull:                      # how the file is exported
          tags: [infoplist]
          tags_match: all
          filters: [translated]
          order: terms
          fallback_language: en
        push:                      # how the file is uploaded
          overwrite: false
          fuzzy_trigger: false
          tags:
            all: [infoplist]
            new: [needs-review]

Project settings

Key What it does
id The POEditor project ID. Required. poeditor api projects list shows the IDs of your projects.
alias A short name, so you can write --project web instead of the ID. It can't be all digits.
account The account whose token this project uses. If left out, the default account. See CLI login and API tokens.
source_language The language your code is written in. push uploads this language's file to create terms.
files The project's files. One project often feeds several files.

File settings

Key What it does
path Where the file lives, with {lang} where the language code goes, for example locales/{lang}.json or res/values-{lang}/strings.xml. You can leave {lang} out only if languages lists a single language.
format The POEditor file format: key_value_json, json, po, pot, mo, android_strings, apple_strings, xliff, xliff_1_2, xlf, stringsdict, xcstrings, arb, i18next, yml, properties, resx, resw, ini, csv, xls, xlsx, ts, xmb, xtb or rise_360_xliff. mo files can be pulled but not pushed.
languages Sync only these languages. By default, every language of the project.
language_map Use when your path spells a language differently from POEditor, for example pt-br: pt-BR for iOS or pt-br: pt-rBR for Android.
pull Export options, below.
push Upload options, below.

Paths are relative to the folder that holds .poeditor.yml, and always use /, on Windows too.

pull options

These are the same options as the export settings in POEditor.

Key What it does
tags Export only the terms with these tags.
tags_match How tags match: any (at least one tag, the default), all (every tag), or exclude (none of the tags).
filters Export only terms that are translated, untranslated, fuzzy, not_fuzzy, automatic, not_automatic, ai, not_ai, tm, not_tm, proofread or not_proofread. If you list several, a term must match all of them.
order terms sorts the terms alphabetically.
fallback_language Fill untranslated terms with their text in this language.

push options

These are the same options as the import settings in POEditor.

Key What it does
updating What the source file brings: terms, terms_translations (the default) or translations. Other languages' files are always uploaded as translations.
overwrite Replace existing translations with the ones in the file.
sync_terms Deletes every term in the project that isn't in the source file, with its translations.
read_from_source Read translations from the source text (XLIFF files).
fuzzy_trigger Mark other languages' translations as fuzzy where the source text changed.
tags Tags to put on terms: all (every term in the file), new (terms the upload adds), obsolete (terms in the project but not in the file), overwritten_translations.

Tags under push are never copied from pull. If a file pulls the terms tagged mobile, add tags: {all: [mobile]} under push too, so new terms get the tag.

How to check the file

The CLI reads .poeditor.yml strictly. A misspelled key, an unknown filter name, two projects with the same alias, or two languages written to the same path are reported as errors, so a typo doesn't make a sync silently do nothing.

To see what the file resolves to, without contacting POEditor:

poeditor config show

It lists each project, its account, and each file's path for every language. Problems are listed on stderr.

To check the file against your POEditor account:

poeditor config check

For each project, it checks that you have a token for its account, that the token can open the project, and that every language the file names exists in the project. It can't check tags, because POEditor doesn't keep a list of them. It fails when anything is wrong, so it's a good first step in a CI job.

Things to know

The CLI finds the file the way git finds .git: in the current folder, then in each parent folder. You can run poeditor pull from any subfolder of your repository.

Language files must not be shared between entries. If two entries would write the same file for the same language, config show reports it as an error.

sync_terms is for a single source of truth. Use sync_terms: true only when that one file holds all of the project's terms. If several files feed one project, each push would delete the other files' terms.

Additional help