Nowadays, version control systems like Git are a widespread tool in the stack of nearly every individual or team developing software. For this reason, the localization platform POEditor has integrated major Git hosting services like GitHub, GitLab, Bitbucket and Azure DevOps, which make it possible to easily sync the strings in your localization projects with the files on your repos.
In this article, we’ll describe a few best practices to keep the localization files on your preferred Git service up to date with the latest translations on POEditor.
Use tags to group strings coming from different files
When setting up an integration with a Git service, you need to link each language in the POEditor project to the corresponding localization files on your repos.
If you have multiple files for each language, it’s recommended to set tags for each link in their Settings, in Import rules.
By tagging the imported strings, you will be able to filter them according to file within the POEditor project and, most importantly, to export the each group of strings back to the corresponding files.
Use pull requests, callbacks and webhooks to build automated workflows
To automate the export of your localized strings to your repo, you can use webhooks with the operation Export terms and translation.
If you set an Export rule for a link in the integration page (for example, to export only translated strings, or to export only strings having a particular tag), it will also be applied when its corresponding export webhook is triggered.
If you want your export to a particular branch to trigger a pull request on another branch you can use pull request presets. Note that PR presets are not triggered automatically, so you’ll need to add them to a script if you don’t want to fire them manually.
Should you wish to allow multiple POEditor users to create PR request presets, you will need to manage your localization projects on an organization.
Finally, note that there’s no option in POEditor to export new translations to your repos in real-time, because each translation is saved automatically in your localization projects. However, there are some workarounds that can help you achieve similar results.
Use separate projects if you’re working with different environments
If you are working with multiple environments (staging, development, production, etc.), you can use separate projects to keep the strings separate for each environment.
To speed up the process of creating new projects, you can use the option Copy setup from another project. The copied setup includes the project settings, the languages and the contributors assigned to these languages.
You will be able to easily reuse the translations from one project in any of your other projects, since the Translation Memory is available across all of the projects hosted on your account or organization.
Although we recommend multiple projects (as it is less prone to errors), you can also manage multiple environments in the same project, and tag the terms on import to keep them grouped according to environment.
Use a separate branch to avoid multiple commits
When you export a language from your localization project to the specified branch, POEditor makes a commit in your repo. If you’re localizing your software into many languages, or if you push translations often to your repos, you might want to consider working with a separate branch, dedicated to localization. This will allow you to keep your commit history clean on your other branches.
After exporting the target languages to the branch dedicated to localization, you can use the ‘squash and merge’ option to create a single commit on the master branch.
By following the best practices outlined in this article, you can keep your localization files up-to-date with the latest translations on POEditor and ensure that all team members have access to them.
Remember to use tags to group strings coming from different files, work with a separate branch to keep your commit history clean, and use pull requests, callbacks, and webhooks to automate workflows.
Additionally, if you are working with different environments, using separate projects can be a helpful strategy to keep your strings organized. With these tips in mind, you can integrate your localization process with Git seamlessly and effectively.