Skip to content

Conversation

@ramonmelo
Copy link
Contributor

@ramonmelo ramonmelo commented Sep 27, 2025

Translate Utility Script

A script that assists with translations by reading the target language, comparing it with the base language, and going through missing keys one by one, so the translator can provide the translations interactively without needing to check each key manually.

Usage

Check for a given language (e.g., pt_BR) and optionally check for missing translations:

python translate_helper.py pt_BR [--check]
  • pt_BR is the target language code (change as needed), it should correspond to a file named pt_BR.axaml in the src/Resources/Locales/ directory, so you can replace it with any other language code you want to translate, e.g., de_DE, es_ES, etc.
  • --check is an optional flag used to only check for missing keys without prompting for translations, useful for getting a list of missing 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.

@love-linger
Copy link
Collaborator

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

@love-linger love-linger self-assigned this Sep 29, 2025
@love-linger love-linger added the already-done This feature already exists label Sep 29, 2025
@ramonmelo
Copy link
Contributor Author

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
Copy link
Contributor Author

Can this be reviewed again?

@ramonmelo ramonmelo marked this pull request as draft October 23, 2025 18:43
@ramonmelo ramonmelo marked this pull request as ready for review October 23, 2025 18:43
@love-linger love-linger added tools Non-main project code, such as inspection, packaging, CI and other peripheral tools and removed already-done This feature already exists labels Oct 24, 2025
@love-linger
Copy link
Collaborator

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.

A small python scritp that helps to translate between EN to a target language. It loads the target translation file and compares with the EN base file, showing which keys are missing and asking to translate.
@ramonmelo ramonmelo force-pushed the feature/translation-utility-script branch from 7be9ba9 to 0959e46 Compare January 25, 2026 15:33
@ramonmelo
Copy link
Contributor Author

Hi, I've updated the branch with the requested changes. Can you check it again?

Thanks!

@ramonmelo ramonmelo changed the title Translation Utility Script feat: Translation Utility Script Jan 25, 2026
@ramonmelo ramonmelo changed the title feat: Translation Utility Script utils: Translation Utility Script Jan 25, 2026
@love-linger love-linger merged commit 924cd08 into sourcegit-scm:develop Jan 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tools Non-main project code, such as inspection, packaging, CI and other peripheral tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants