3 min. read
Working with Git Branches
Translating software with branches often leads to nightmares: conflicts on translation files, lost translations, double translations, etc.
Let’s say your production branch is
master and you are working in
With most existing translation syncing tools, if a translation string/key
is removed from master, it will also be removed from the translation server.
a-feature-branch still needs it, it would be lost. And so you will have
to re-add it, and re-translate it.
With Translation.io, it is a little bit different : translation strings/keys of all branches are kept on the translation server. Some of them are shared because needed by all branches, some others are specific to a given branch.
What About Really Unused keys?
When at some point, you know all features have been merged into the current branch, and you want to remove all keys that are not used in the current branch. Then use the purge operation that will do exactly that.
To purge your project’s translations:
php artisan translation:sync_and_purge
# NPM (alias of `npm run extract --overwrite --clean && npm run compile`) npm run sync_and_purge # Yarn (alias of `yarn extract --overwrite --clean && yarn compile`) yarn sync_and_purge
# NPM npm run translation:sync -- --purge # Yarn yarn translation:sync -- --purge
This operation will do a regular sync plus a removal on the server of all keys that are not present anymore in the current branch.