-
Notifications
You must be signed in to change notification settings - Fork 28
Complete language support to all GUI tabs #873
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
Closed
Closed
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
2180c36
i18n: wrap ~76 user-facing strings with tr() across Schedules tab
Ski90Moo aff35f2
ci: trigger build
Ski90Moo b1c5733
i18n: add comprehensive Spanish translation proof-of-concept (issue #…
Ski90Moo bce5a70
test: add GTest suite for i18n translation (issue #680)
Ski90Moo cdf9504
i18n: add full translations for 18 languages + 4 new languages (issue…
Ski90Moo d239658
i18n: fix remaining macumber/Copilot review issues (issue #680)
Ski90Moo 7eb3da0
chore: untrack Qt-generated moc_*.cpp files
Ski90Moo f03e2ee
chore: ignore Qt-generated moc_*.cpp files
Ski90Moo 4808ad1
test: add IddCoverageForAllFields test (issue #680)
Ski90Moo 59cad72
test: check IDD coverage across all language .ts files (issue #680)
Ski90Moo b2a2d08
docs: update PR 873 review responses
Ski90Moo 7e3be47
ci: add GitHub Actions translation drift check (issue #680)
Ski90Moo 518b74f
docs: update PR 873 responses with translation CI details
Ski90Moo d74d92b
i18n: wrap hardcoded 'Merging Models' dialog titles with tr() (issue …
Ski90Moo 05a157e
refactor: replace QCoreApplication::translate lambda/verbose calls wi…
Ski90Moo 8d3ebce
fix: add missing QStringList include to Translation_GTest.cpp
Ski90Moo dce7d74
chore: remove internal PR review tracking document
Ski90Moo 37c8d6b
i18n: add dialog translations missing from PR #873
Ski90Moo 95999ac
Merge branch 'openstudiocoalition:develop' into feat/i18n
Ski90Moo f498e3d
i18n: add tr() strings for 'Units Conversion' DView dialog (issue #680)
Ski90Moo 69ba3d8
docs: add TRANSLATION_WORKFLOW.md with full lupdate pipeline
Ski90Moo 4865c9e
fix: restore white menu bar background after language switch (Qt 6)
Ski90Moo 0585d1f
style: apply clang-format 18.1.3 to PR-touched files
Ski90Moo 3bce8c5
feat: add missing translation helper scripts
Ski90Moo 4c22eb1
fix: register 4 new languages in CMakeLists and clean up .gitignore
Ski90Moo 31f9508
fix: address jmarrec review — display, whitespace, newlines, loop dialog
Ski90Moo b70dc87
docs: add note to TRANSLATION_WORKFLOW.md clarifying AI-assisted scope
Ski90Moo 3e1c01c
fix: correct de.pak typo in German WebEngine locales block
Ski90Moo d3b7090
feat: improve translation tooling from Danish language test
Ski90Moo f6642ba
docs: document adding a new language in TRANSLATION_WORKFLOW.md
Ski90Moo 5ac6599
fix: normalize XML escaping in all 18 .ts translation files
Ski90Moo ac13885
feat: add definition-aware output variable retranslation pipeline
Ski90Moo 2578068
refactor: consolidate translation tooling in translations/ directory
Ski90Moo 60af71b
fix: restore human translations and update ES/FR with improved machin…
Ski90Moo eea0cab
feat: complete definition-aware retranslation of all 18 languages
Ski90Moo 9804a2f
Merge remote-tracking branch 'origin/develop' into develop
Ski90Moo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| name: Translation Check | ||
|
|
||
| on: | ||
| push: | ||
| branches: [ master, develop ] | ||
| pull_request: | ||
| branches: [ master, develop ] | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Install Qt6 lupdate | ||
| run: | | ||
| sudo apt-get update -q | ||
| sudo apt-get install -y qt6-l10n-tools | ||
|
|
||
| - name: Run lupdate against all .ts files | ||
| run: | | ||
| # -locations none: suppress line-number comments so only genuine | ||
| # string additions/removals cause a git diff change. | ||
| lupdate6 src/ \ | ||
| -ts translations/OpenStudioApp_*.ts \ | ||
| -extensions cpp,hpp \ | ||
| -locations none \ | ||
| 2>&1 | tee lupdate_output.txt | ||
|
|
||
| - name: Detect vanished or new unfinished strings | ||
| run: | | ||
| # If lupdate changed any .ts file, strings were either added to source | ||
| # (new type="unfinished" stubs) or removed from source (type="obsolete"). | ||
| # Either way the commit that introduced the drift should not merge until | ||
| # the .ts files are updated and translations are provided. | ||
| python3 ci/check_translations.py | ||
|
|
||
| - name: Upload artifacts on failure | ||
| if: failure() | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: translation-check-${{ github.sha }} | ||
| path: | | ||
| lupdate_output.txt | ||
| translation_check.patch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| #!/usr/bin/env python3 | ||
| """ | ||
| Called by translation_check.yml after lupdate has run. | ||
|
|
||
| Checks whether lupdate changed any OpenStudioApp_*.ts file by running | ||
| `git diff translations/`. If there are changes it means: | ||
|
|
||
| - type="unfinished" stubs were ADDED → new tr() calls in source with no | ||
| translation yet. Fix: run translate_skeleton.py / translate_all_languages.py. | ||
|
|
||
| - type="obsolete" entries were ADDED → tr() calls removed from source but | ||
| still present as dead entries in the .ts files. Fix: run | ||
| `lupdate -no-obsolete` and commit the cleaned-up .ts files. | ||
|
|
||
| If the diff is empty, all .ts files are in sync with the C++ source. | ||
| Exits with code 1 if drift is detected so CI fails. | ||
| """ | ||
|
|
||
| import re | ||
| import subprocess | ||
| import sys | ||
|
|
||
|
|
||
| def run(cmd: list[str]) -> str: | ||
| return subprocess.check_output(cmd, text=True) | ||
|
|
||
|
|
||
| def main() -> int: | ||
| # Produce a diff of everything lupdate may have touched. | ||
| diff = run(["git", "diff", "translations/"]) | ||
|
|
||
| if not diff: | ||
| print("All .ts files are in sync with the C++ source. ✓") | ||
| return 0 | ||
|
|
||
| # Save patch as artifact for inspection. | ||
| with open("translation_check.patch", "w") as f: | ||
| f.write(diff) | ||
|
|
||
| # Classify what changed so the error message is actionable. | ||
| added_unfinished = len(re.findall(r'^\+.*type="unfinished"', diff, re.MULTILINE)) | ||
| added_obsolete = len(re.findall(r'^\+.*type="obsolete"', diff, re.MULTILINE)) | ||
|
|
||
| # Summarise changed files. | ||
| stat = run(["git", "diff", "--stat", "translations/"]) | ||
| print("lupdate changed the following .ts files:") | ||
| print(stat) | ||
|
|
||
| if added_unfinished: | ||
| print(f" {added_unfinished} new empty unfinished string(s) detected.") | ||
| print(" These are new tr() calls in C++ source that have no translation yet.") | ||
| print(" Fix: run translate_skeleton.py (Spanish) or translate_all_languages.py") | ||
| print(" to batch-translate the new strings, then commit the updated .ts files.") | ||
| print() | ||
|
|
||
| if added_obsolete: | ||
| print(f" {added_obsolete} new obsolete string(s) detected.") | ||
| print(" These are tr() calls that were removed from C++ source.") | ||
| print(" Fix: run `lupdate src/ -no-obsolete -ts translations/OpenStudioApp_*.ts`") | ||
| print(" then commit the cleaned-up .ts files.") | ||
| print() | ||
|
|
||
| if not added_unfinished and not added_obsolete: | ||
| # Location comments or other minor changes — still fail so the dev is aware. | ||
| print(" .ts files changed in an unexpected way (not unfinished/obsolete).") | ||
| print(" Review translation_check.patch for details.") | ||
|
|
||
| print("Translation check FAILED. Commit the updated .ts files to fix CI.") | ||
| return 1 | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| sys.exit(main()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.