translation_helper
Utility script aimed at easing translators' work
How to use
./translation_helper.py file1 file2
The script will read file1
's structure and try to find a match in
file2
. If there is not such match, it will prompt the user to give
a translation.
For instance, if file1
's structure is:
"components": {
"greetings": {
"morning": "Good morning !",
"afternon": "Good afternoon !"
}
}
And file2
's structure is
"components": {
"greetings": {
"morning": "Bonjour !",
}
}
By running ./translation_helper.py file1 file2
, the user will see:
[components.greetings] afternoon
Good afternoon !
By typing Bonne après-midi !
, file2
's structure will be altered and
written to disk to become
"components": {
"greetings": {
"morning": "Bonjour !",
"afternoon": "Bonne après-midi !"
}
}
Use cases
This script is useful for translators:
- they no longer have to have the reference file and the translated file open side by side
- they no longer need to manually edit the JSON
- the script makes it very easy to spot missing translations lost in a huge file
- the script eases the building of new translation files from scratch by replicating the existing file's structure
This script is also useful for developpers who wish to easily propagate changes made to a master translation file (which in turn reflects the changes made to the underlaying implementation) to other language files.