sourcegit icon indicating copy to clipboard operation
sourcegit copied to clipboard

Translation Utility Script

Open ramonmelo opened this issue 4 months ago • 4 comments

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_BR is the target language code (change as needed)
  • --check is 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.

ramonmelo avatar Sep 27 '25 14:09 ramonmelo

You can find the missing translations in https://github.com/sourcegit-scm/sourcegit/blob/develop/TRANSLATION.md

love-linger avatar Sep 29 '25 03:09 love-linger

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.

ramonmelo avatar Sep 29 '25 12:09 ramonmelo

Can this be reviewed again?

ramonmelo avatar Oct 23 '25 18:10 ramonmelo

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.

love-linger avatar Oct 24 '25 02:10 love-linger