poEditor:- Workflow Automation



This content originally appeared on DEV Community and was authored by herat dhruv

Automation of PoEditor can save your lot of time

In my case, developers updated translations only in en.json since they lacked PoEditor access. New local translations had to be manually synced to PoEditor for stakeholders—a time-consuming and error-prone process.

Automation Details

// package.json
"update:translations:poeditor": "node ./locales/scripts/sync_translation.js",

Here is the list of API can be used , before using it you need to generate API token in poEditor using your login

// sync_translation.js
const LIST_TERMS_API = 'https://api.poeditor.com/v2/terms/list'
const ADD_TERMS_API = 'https://api.poeditor.com/v2/terms/add'
const UPDATE_TERMS_API = 'https://api.poeditor.com/v2/terms/update'
const UPDATE_TRANSLATIONS_API = 'https://api.poeditor.com/v2/translations/update'
const ADD_TRANSLATIONS_API = 'https://api.poeditor.com/v2/translations/add'

Here is my workflow for automation

const LANGUAGES = ['en'] // since all the developer updated the translation on local en.json file hence in my case i was targeting en.json as updated source / only source of truth.

// sync_translation.js
LANGUAGES.forEach(async (lang) => {
  await syncTranslations(lang)
})

Workflow Automation

  1. Fetch translations from PoEditor.
  2. Compare with en.json.
  3. Log updates in a local backup file.
  4. Add new terms to PoEditor via API with web reference.
  5. Tag updated terms so stakeholders can easily review and update.

For automation we can use reference or context of poEditor

using a Reference in poEditor

How Tagging will help everyone to filter terms based on certain criteria

Tagging in poEditor to filter terms

Background
In my case, I was surprised by how much time my team spent managing locale files from poEditor. Every update required a manual process before sharing with stakeholders:

  1. Download the locale file from poEditor
  2. Sort translations using a third-party tool
  3. Compare poEditor files with the repository (since devs also updated translations directly)
  4. Merge changes between poEditor’s JSON and the repo’s JSON
  5. Update the repository with the final merged file

This repetitive workflow made a simple task unnecessarily time-consuming.

This manual process took 2–4 days, demanded heavy focus, and often led to procrastination in pushing translations to production. As a result, it created a poor impression with operations and management—prompting me to pursue automation.

Conclusion

  • Within a couple of minutes, we can able upload the latest translation on poEditor. This saves time and efforts both.
  • Stakeholders also aware about what they needs to be updated by using tagged filter.


This content originally appeared on DEV Community and was authored by herat dhruv