Translation Utility Script
Translate Helper
A script to help with translations by reading the target language, comparing with the base language, and going through missing keys.
Usage
python translate_helper.py pt_BR [--check]
-
pt_BRis the target language code (change as needed) -
--checkis an optional flag to only check for missing keys without prompting for translations
The script will read the base language file (en_US.axaml) and the target language file (e.g., pt_BR.axaml), identify missing keys, and prompt you to provide translations for those keys. If the --check flag is used, it will only list the missing keys without prompting for translations.
You can find the missing translations in https://github.com/sourcegit-scm/sourcegit/blob/develop/TRANSLATION.md
The script is not only for showing the missing tags (the --check is an optional argument), but its main purpose is to assist with translation.
Instead of checking each key manually, you can run the script with the desired language, and it will interactively review the missing keys, prompting you for the translation of each one. Once you're done, it automatically saves the translated text back into the target language file, maintaining alphabetical order.
This approach is much simpler than copying and pasting keys, figuring out where to place them, and determining if they are missing or just out of order.
Can this be reviewed again?
I'm very sorry for my late reply.
I suggest placing translate_helper.py directly in the root directory of the project and writing the relevant usage instructions into the Translation Status section of the main README.md file.