-
Notifications
You must be signed in to change notification settings - Fork 14
Replace raw strings with translation calls #286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Add or edit some changed messages
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR replaces hardcoded raw strings throughout the tabcmd codebase with translation calls to support internationalization. The changes prepare the codebase to use translated strings from properties files instead of embedded English text.
Key changes:
- Replace raw strings in Python source files with translation function calls using
_()syntax - Update properties files to include new translation keys for previously hardcoded strings
- Remove unused string constants and replace them with localized references
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tabcmd/locales/en/tabcmd_messages_en.properties | Adds new translation keys and updates existing ones with deprecation notes and platform-specific information |
| tabcmd/locales/en/shared_wg_en.properties | Removes unused permission-related translation entries and retains only necessary role and format strings |
| tabcmd/execution/parent_parser.py | Replaces hardcoded strings array with translation calls for parser configuration |
| tabcmd/execution/global_options.py | Updates argument help text to use translation keys instead of raw strings |
| tabcmd/commands/user/create_users_command.py | Fixes incorrect translation key usage in error handling |
| tabcmd/commands/site/list_command.py | Replaces local string dictionary with translation calls |
| tabcmd/commands/site/delete_site_command.py | Removes hardcoded strings array and uses translation keys |
| tabcmd/commands/datasources_and_workbooks/publish_command.py | Updates command description to use correct translation key |
| tabcmd/commands/datasources_and_workbooks/get_url_command.py | Updates function call to use renamed translation-based function |
| tabcmd/commands/datasources_and_workbooks/export_command.py | Adds import for updated function name |
| tabcmd/commands/datasources_and_workbooks/delete_command.py | Replaces hardcoded strings with translation keys |
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
bcantoni
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jacalata overall this looks good. I added a script (thank you Cursor) to check message ids between source and properties files. It found 23 that are missing so let's add these in this PR. (Just run python bin/i18n/check-strings.py to see the list.)
- cleaned up string ids that either added "tabcmd" as a prefix or took it off as a prefix incorrectly - add back some deleted strings - incorporate check_strings into the localization build and pushed some output into a log file - added docs in Contributing.md and i18n/README
* All strings are fetched from *.properties files * clean out unused strings * clarify comment * more global_options settings Co-authored-by: Copilot <[email protected]> * Update tabcmd/locales/en/tabcmd_messages_en.properties Co-authored-by: Copilot <[email protected]> * Update tabcmd/commands/datasources_and_workbooks/delete_command.py Co-authored-by: Copilot <[email protected]> * Update tabcmd/execution/global_options.py Co-authored-by: Copilot <[email protected]> * Update tabcmd_messages_en.properties Add or edit some changed messages * Update global_options.py * Update tabcmd/execution/parent_parser.py Co-authored-by: Copilot <[email protected]> * Update tabcmd/execution/parent_parser.py Co-authored-by: Copilot <[email protected]> * Update tabcmd/locales/en/tabcmd_messages_en.properties Co-authored-by: Copilot <[email protected]> * format w black * Add script for double-checking messages found in source code vs properties files * Add a "launching" message which was referenced everywhere * document loc process, fix misreferenced string ids - cleaned up string ids that either added "tabcmd" as a prefix or took it off as a prefix incorrectly - add back some deleted strings - incorporate check_strings into the localization build and pushed some output into a log file - added docs in Contributing.md and i18n/README * format --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Brian Cantoni <[email protected]>
The new string references do not have translations, but those are being done. When they are returned we will simply have to copy them into the existing files.