You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A commandline tool for synchronizing your project's translation with POEditor.
The script uses Click library to wrap POEditor API client into a commandline tool that can be used manually or inside shell scripts.
Installation
pip install poeditor-sync
Usage
Configuration
Create a config file poeditor.yml to link your project with a POEditor project and define paths to translation files. Multiple projects are supported.
api_token: ABC123...projects:
- id: 12345format: po# set it to terms to order results by 'terms' alphabetically.order: terms# generic path to translation fileterms_path: locale/{language_code}/LC_MESSAGES/django.po# alternatively, specify per-language pathterms:
en: locale/en/LC_MESSAGES/django.popl: locale/pl/LC_MESSAGES/django.po
- id: 54321format: poterms_path: locale/{language_code}/LC_MESSAGES/djangojs.poterms:
en: locale/en/LC_MESSAGES/djangojs.popl: locale/pl/LC_MESSAGES/djangojs.po
If you're planning to commit the config file into your repository or share it with someone, it is recommend that the API token in your config file be a read-only token.
You can use a separate token for uploads and pass it using --token option or POEDITOR_TOKEN environment variable.
Commands:
# View usage instructions
poeditor --help
# generate config file
poeditor init {project-id}
# List projects and their translation languages
poeditor project-details
# download translations
poeditor pull
# Upload local translations to poeditor
poeditur push
# Upload only one language and user a different API token:
poeditur --language pl --token=123ABCD push
# Upload only terms (after adding new strings to the project)
poeditor push-terms --sync-terms --overwrite
Options
Option
environment variable
default value
description
--token
POEDITOR_TOKEN
api_token from config file
Authentication token for POEditor. Overrides value from config file.