Complete language support to all GUI tabs#873
Conversation
Wraps all user-facing string literals in the three Schedules sub-tabs (Schedule Sets, Schedules, Other Schedules) with Qt tr() calls to enable multi-language support, addressing issue openstudiocoalition#680. Files modified: - ScheduleSetInspectorView: 12 section/field labels - SchedulesView: 23 strings across ScheduleTabContent, ScheduleTabDefault, NewProfileView, DefaultScheduleDayView, SpecialScheduleDayView, ScheduleRuleView, ScheduleRulesetNameWidget, MonthView - ScheduleFileInspectorView: 15 field labels and combo box items - ScheduleDialog: 10 strings including runtime-appended values - ScheduleDayView + .hpp: 6 button/label strings; adds Q_DECLARE_TR_FUNCTIONS to 3 QGraphicsItem subclasses for tooltip tr() - ScheduleCompactInspectorView: 2 labels - ScheduleConstantInspectorView: 2 labels - ScheduleOthersController: 1 error message - ScheduleOthersView: 3 sidebar type names via QCoreApplication::translate() - MainRightColumnController: 9 sidebar nav strings via tr().toStdString() Adds Spanish translations for all new strings to OpenStudioApp_es.ts. Day-of-week single-letter buttons S/T marked unfinished pending source-level disambiguation (tr("S", "Sunday") etc.). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…penstudiocoalition#680) Wraps user-facing string literals with tr() across all major tabs and adds a complete Spanish (es) translation file as proof of concept for multi-language support, addressing issue openstudiocoalition#680. Tabs covered: Site/Weather Data, Construction Sets, Materials, Schedules, Thermal Zones, Space Types, Loads, Facility, HVAC Systems, Inspector panel IDD fields, Output Variables (1051 names), Simulation Settings, Measures, Run Simulation, and Results Summary. Key patterns established: - tr() for compile-time strings in Q_OBJECT classes - QCoreApplication::translate(IDD/OutputVariables/TaxonomyCategories) for runtime strings from the OpenStudio SDK and taxonomy.xml - addItem(tr(Display), EnglishData) + currentData() for model-bound combo boxes where SDK values must stay in English - Bilingual display format for IDD fields and output variable names so engineers can cross-reference EnergyPlus documentation without switching the application language translations/OpenStudioApp_es.ts grows from ~200 to 3017 entries. New languages only require a new .ts file with no further C++ changes. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…#680) Adds Translation_GTest.cpp to the OpenStudioApp test target, covering: Translation_ts suite (no build-path dependency, uses .ts source file): - ValidXml: verifies OpenStudioApp_es.ts parses as well-formed XML - HasExpectedContexts: checks all new translation contexts are present (IDD, OutputVariables, TaxonomyCategories, SimSettingsView, RunView, etc.) - TranslationCountIsSubstantial: guards against accidental file truncation - IddContextHasEntries: IDD context has >50 field-name translations - OutputVariablesContextHasEntries: OutputVariables context has >=1000 entries - TaxonomyCategoriesContextHasEntries: taxonomy categories are present Translation_qm suite (requires compiled .qm, skipped gracefully if absent): - QmFileLoads: QTranslator::load() succeeds for OpenStudioApp_es.qm - SpanishSimSettingsStringsTranslated: spot-checks Simulation Settings labels - SpanishRunViewStringsTranslated: spot-checks Run Simulation labels - TaxonomyCategoriesTranslated: spot-checks library sidebar category names - OutputVariablesSampleTranslated: spot-checks output variable name translations - EnglishStringsReturnedWithoutTranslator: verifies English fallback when no QTranslator is installed Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
|
This is awesome @Ski90Moo! I will check this out! |
|
Thank you @macumber. It is rough, but a good start. I would like your feedback on the html issue. |
There was a problem hiding this comment.
Pull request overview
This PR expands internationalization across the OpenStudio Application UI by wrapping user-facing strings with Qt translation APIs and adding a significantly more complete Spanish translation as a proof of concept (Issue #680). It also introduces tests to validate the .ts file structure/content and (optionally) runtime .qm translation loading.
Changes:
- Wrapped many GUI string literals in
tr()/QCoreApplication::translate()across tabs, inspectors, and grid views. - Added bilingual display formatting for SDK-driven names (eg. Output Variables, IDD fields) to show
Translated (English)when non-English. - Added a new translation-focused GTest suite and wired it into the app test target.
Reviewed changes
Copilot reviewed 98 out of 100 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/shared_gui_components/WorkflowView.cpp | Translates “drop measure” placeholder text. |
| src/shared_gui_components/WorkflowController.cpp | Translates section headers for measure categories. |
| src/shared_gui_components/OSGridController.cpp | Translates “Custom” category label and apply-button text. |
| src/shared_gui_components/LocalLibraryView.cpp | Translates tooltips/button labels in the local library footer. |
| src/shared_gui_components/LocalLibraryController.cpp | Translates taxonomy category names at render time. |
| src/openstudio_lib/WindowMaterialSimpleGlazingSystemInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/WindowMaterialShadeInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/WindowMaterialScreenInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/WindowMaterialGlazingRefractionExtinctionMethodInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/WindowMaterialGlazingInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/WindowMaterialGasMixtureInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/WindowMaterialGasInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/WindowMaterialDaylightRedirectionDeviceInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/WindowMaterialBlindInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/WaterUseEquipmentInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/VRFGraphicsItems.cpp | Translates VRF drag/drop placeholder labels. |
| src/openstudio_lib/VariablesTabView.cpp | Adds translated+bilingual output variable display and localized frequency display with English data values. |
| src/openstudio_lib/ThermalZonesTabView.cpp | Translates main tab title. |
| src/openstudio_lib/ThermalZonesGridView.cpp | Translates grid headers/categories via QCoreApplication::translate. |
| src/openstudio_lib/SteamEquipmentInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/StandardsInformationMaterialWidget.cpp | Translates standards/measure-tags labels. |
| src/openstudio_lib/StandardsInformationConstructionWidget.cpp | Translates standards/measure-tags labels. |
| src/openstudio_lib/SpaceTypesTabView.cpp | Translates main tab title. |
| src/openstudio_lib/SpaceTypesGridView.cpp | Translates headers/categories/filter labels; some tooltips still hardcoded. |
| src/openstudio_lib/SpacesTabController.cpp | Translates spaces sub-tab titles. |
| src/openstudio_lib/SpacesSurfacesGridView.cpp | Translates grid headers/categories. |
| src/openstudio_lib/SpacesSubtabGridView.cpp | Translates filter labels; stores English keys in combo box data for SDK values. |
| src/openstudio_lib/SpacesSubsurfacesGridView.cpp | Translates grid headers/categories. |
| src/openstudio_lib/SpacesSpacesGridView.cpp | Translates grid headers/categories. |
| src/openstudio_lib/SpacesShadingGridView.cpp | Translates grid headers/categories. |
| src/openstudio_lib/SpacesLoadsGridView.cpp | Translates grid headers/categories. |
| src/openstudio_lib/SpacesInteriorPartitionsGridView.cpp | Translates grid headers/categories. |
| src/openstudio_lib/SimSettingsTabController.cpp | Translates “Simulation Settings” tab title. |
| src/openstudio_lib/ServiceWaterGridItems.cpp | Translates tooltips and drop-zone placeholder text. |
| src/openstudio_lib/ScriptsTabView.cpp | Translates “Measures” tab title and sync button strings. |
| src/openstudio_lib/SchedulesTabView.cpp | Translates schedules sub-tab title. |
| src/openstudio_lib/SchedulesTabController.cpp | Translates schedules sub-tab titles. |
| src/openstudio_lib/ScheduleSetInspectorView.cpp | Translates schedule set inspector section labels. |
| src/openstudio_lib/ScheduleOthersView.cpp | Translates “Schedule Others” type names returned to the list view. |
| src/openstudio_lib/ScheduleOthersController.cpp | Translates unsupported-action message text. |
| src/openstudio_lib/ScheduleFileInspectorView.cpp | Translates labels and attempts to translate separator choices (but bind() will overwrite). |
| src/openstudio_lib/ScheduleDialog.cpp | Translates dialog labels and “None/unitless” strings. |
| src/openstudio_lib/ScheduleDayView.hpp | Adds Q_DECLARE_TR_FUNCTIONS for QGraphicsItem subclasses to enable tr(). |
| src/openstudio_lib/ScheduleDayView.cpp | Translates schedule day UI strings/tooltips and keyboard prompt text. |
| src/openstudio_lib/ScheduleConstantInspectorView.cpp | Translates labels (one includes leading whitespace in the source string). |
| src/openstudio_lib/ScheduleCompactInspectorView.cpp | Translates labels. |
| src/openstudio_lib/RunTabView.cpp | Translates run tab title, button/checkbox labels, and status text. |
| src/openstudio_lib/ResultsTabView.cpp | Translates Results UI labels and some report names; “Custom Report N” uses concatenation. |
| src/openstudio_lib/ResultsTabController.cpp | Translates “Results Summary” tab title. |
| src/openstudio_lib/RefrigerationGraphicsItems.cpp | Translates refrigeration drop-zone placeholder text. |
| src/openstudio_lib/PeopleInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/OtherEquipmentInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/OSItemSelectorButtons.cpp | Translates toolbar button tooltips. |
| src/openstudio_lib/OSDropZone.hpp | Changes default text arg to empty so ctor can apply translated default. |
| src/openstudio_lib/OSDropZone.cpp | Applies translated default “Drag From Library” when text is empty. |
| src/openstudio_lib/OSDocument.cpp | Translates left-side main tab button labels. |
| src/openstudio_lib/MaterialsView.cpp | Translates materials category names returned to list view. |
| src/openstudio_lib/MaterialRoofVegetationInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/MaterialNoMassInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/MaterialInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/MaterialAirGapInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/LuminaireInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/LoopLibraryDialog.cpp | Translates HVAC library dialog titles/buttons/system names. |
| src/openstudio_lib/LoadsView.cpp | Translates loads category names returned to list view. |
| src/openstudio_lib/LightsInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/library/geometry_editor_start.html | Adds an in-HTML Spanish translation dictionary + DOM rewrite for headings/paragraphs. |
| src/openstudio_lib/InternalMassInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/HVACSystemsTabView.cpp | Translates main tab title. |
| src/openstudio_lib/HVACSystemsController.cpp | Translates system selector entries and HVAC type labels; translates some drop-zone text. |
| src/openstudio_lib/HotWaterEquipmentInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/GridItem.cpp | Translates drop-zone placeholder and “Supply/Demand Equipment” labels. |
| src/openstudio_lib/GeometryTabController.cpp | Translates geometry tab title and sub-tab titles. |
| src/openstudio_lib/GeometryPreviewView.cpp | Injects locale into embedded web content; translates some UI strings. |
| src/openstudio_lib/GeometryEditorView.cpp | Injects locale into embedded editor; translates most UI strings and some dialogs. |
| src/openstudio_lib/GasEquipmentInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/FacilityTabView.cpp | Translates facility tab title. |
| src/openstudio_lib/FacilityTabController.cpp | Translates facility sub-tab titles. |
| src/openstudio_lib/FacilityStoriesGridView.cpp | Translates grid headers/categories and filter label. |
| src/openstudio_lib/FacilityShadingGridView.cpp | Translates grid headers/categories and uses English keys in filter combo data. |
| src/openstudio_lib/FacilityExteriorEquipmentGridView.cpp | Translates grid headers/categories and view titles. |
| src/openstudio_lib/ElectricEquipmentInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/ConstructionsView.cpp | Translates constructions category names returned to list view. |
| src/openstudio_lib/ConstructionsTabController.cpp | Translates constructions sub-tab titles and main tab title. |
| src/openstudio_lib/ConstructionInternalSourceInspectorView.cpp | Translates inspector labels and drop-zone text (and file gained a BOM). |
| src/openstudio_lib/ConstructionInspectorView.cpp | Translates inspector labels and drop-zone text. |
| src/openstudio_lib/ConstructionFfactorGroundFloorInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/ConstructionCfactorUndergroundWallInspectorView.cpp | Translates inspector labels (and file gained a BOM). |
| src/openstudio_lib/ConstructionAirBoundaryInspectorView.cpp | Translates inspector labels and comments (and file gained a BOM). |
| src/openstudio_lib/BuildingInspectorView.cpp | Translates building inspector labels. |
| src/openstudio_app/test/Translation_GTest.cpp | Adds tests to validate .ts content and optionally .qm runtime translation. |
| src/openstudio_app/CMakeLists.txt | Adds Translation_GTest.cpp to the test sources. |
| src/model_editor/InspectorGadget.cpp | Adds bilingual IDD field display names with runtime translation lookup. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
We need to take a careful decision on whether we think OutputVariables should be translated at all: poor translations, and too many of them (1432) to burden a human with.
The IDD bit might fall into the same bucket: it has even more entries: 3842, though a spot check didn't concern me as much in terms of translation
One thing to consider is that, while I didn't do timings, I'm pretty sure the build got a lot lengthier.
Add the six Python scripts referenced in TRANSLATION_WORKFLOW.md and the IddCoverageAllLanguages test but absent from the PR: - fix_and_unvanish.py — un-vanish translated entries; promote unfinished - translate_all_languages.py — batch-translate new strings into all 18 languages - retranslate_stubborn.py — re-translate remaining empty entries - recover_batches.py — re-poll batch IDs after network failure - add_idd_skeleton.py — add missing IDD field names as unfinished stubs - translate_skeleton.py — translate IDD context stubs via Claude batch API Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add OpenStudioApp_{id,ko,pt,tr}.ts to qt6_add_translations TS_FILES so
the .qm files are compiled and deployed on all platforms, not just when
pre-built .qm files happen to be present in the source tree.
- Add post-build copy commands for Qt system translations (qt_ko, qt_tr,
qt_pt_BR, qtbase_*) and WebEngine pak files for the four new languages.
Indonesian follows the same commented-out pattern as Hindi/Vietnamese/Greek
since Qt does not ship qt_id / qtbase_id translations.
- Remove stale moc_*.cpp entry from .gitignore; Qt 6 + CMake always
generates moc files in the build directory, never in the source tree.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
IDD field display (InspectorGadget.cpp): - Replace 'Translation (English)' inline format with HTML: translated name on first line, English original in small gray italics on second line. Non-English speakers can cross-reference EnergyPlus docs without switching languages; tooltip approach was rejected as cursor-precision-dependent. Whitespace restoration (fix_and_unvanish.py + all .ts files): - Add Step 4 to fix_and_unvanish.py: restore leading/trailing spaces in translations to match source strings (stripped by .strip() in translation scripts). Fixes ~6900 Qt Linguist whitespace-mismatch warnings. Newline fixes (all .ts files): - For LoopLibraryDialog strings: remove hard \n breaks from both C++ source and all translations now that the dialog is resizable. - For all other \n-containing strings (grid headers, drop zones, etc.): apply proportional-position insertion to restore missing \n in translations. LoopLibraryDialog resize (LoopLibraryDialog.cpp): - Replace setFixedSize(280,584) with setMinimumSize(280,400) + setSizeGripEnabled. - Add setWordWrap(true) and remove Qt::AlignLeft from addWidget so label stretches to full item width and reflows correctly on resize. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Per jmarrec review: add a callout at the top noting this doc covers the AI-assisted bootstrap pipeline, and linking to the wiki for the preferred human-translation workflow via Qt Linguist. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
translations/CMakeLists.txt line 151 was copying vi.pak (Vietnamese) instead of de.pak. Copy-paste error from the Vietnamese section directly above it. Audited all 18 language blocks — only mismatch. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Another thought I had: would it be possible to gather user provided feedback/translations on these? For example, the user could right or left click the translation, it would copy the specific English and target language strings and take them to a dialog online to submit an alternative translation? This would greatly accelerate the translation process (or complicate it 😅). |
- fix_and_unvanish.py: add Step 5 to escape bare XML chars (<, >, &) in finished translation text, preventing lrelease parse errors - translate_all_languages.py: add --lang and --skip-contexts CLI args; extract_unfinished now marks skipped-context entries so IDs stay stable - add_language_to_menu.py: new script that automates all 5 C++ touch points when wiring a new language into MainMenu.hpp/.cpp Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add a six-step "Adding a new language" section covering the C++ menu wiring script, CMakeLists.txt entries, translate_all_languages.py update, and the standard pipeline. Expand the helper scripts table with add_language_to_menu.py. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Apply fix_and_unvanish.py Step 5 retroactively: escape bare > characters as > in finished translation text for consistency. Bare < characters (the hard XML error) were not present in the existing 18 files, but > is normalized here for correctness and to prevent future lrelease surprises. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces two new scripts for improving machine translations of EnergyPlus output variable names using BigLadder I/O Reference context: - scrape_output_var_definitions.py: crawls all 52 BigLadder I/O Reference group pages (h3/h4/h5 headings) to extract variable definitions and units into output_var_definitions.json (2,733 entries) - retranslate_output_vars.py: re-translates the OutputVariables context in .ts files using definition-aware prompts, canonical category/sub-category splitting, and a three-level Zone hierarchy (Zone: SubCat: Measurement) Translation improvements for ES and FR: - Category:Measurement structure prevents word-order mangling across the category boundary - ~51% of variables receive full definition context from the I/O Reference - Template fallback covers fuel-type variants (Boiler <Fuel Type>, etc.) - Zone variables use three-level prompting for consistency Also adds output_var_definitions.json, output_vars_comparison_v3.csv, and output_var_zone_splits.csv as reference artifacts for quality review. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move all helper scripts, data files, and comparison CSVs from the repo root into translations/. Delete 8 superseded one-shot scripts. Add three new retranslate scripts (gui_strings, idd_fields, output_vars) with a --mode option (unfinished|all) so finished human translations are never overwritten by default. Add Part 3 (IDD fields) to update_comparison_csvs.py. Standardise CSV names (drop version suffix, rename other_contexts → gui_comparison). Update TRANSLATION_WORKFLOW.md throughout. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…e translations Surgically restore 133 ES and 191 FR human-provided translations from origin/develop that had been overwritten by retranslate scripts run without the --mode unfinished guard. All machine-translated slots retain the improved definition-aware translations. Also fixes a pre-existing bug where the FR file had the Spanish text for "Purge unused objects". Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
My thought is we should make an RC build and sent out to all people who have expressed interest in helping translate to review. I would be fine to include Idd/OutputVariables translations in the RC and then ask for feedback on whether or not it is useful, or to just remove them from this round. @jmarrec is right that it does significantly increase the burden on people reviewing and correcting the translations. Ultimately, the responsibility for translating the IDD and OutputVariables strings should fall on the EnergyPlus team since they own those definitions. |
This sounds like a good approach. |
Retranslate ar, ca, de, el, fa, he, hi, id, it, ja, ko, pl, pt, tr, vi, and zh_CN end-to-end with the definition-aware IDD/OutputVariables/GUI pipeline from ac13885, while preserving every existing human translation verbatim. es and fr get the same XML-escaping and trailing-whitespace normalization that fix_and_unvanish.py applies elsewhere. This represents a significant quality improvement (translation drift) over the prior machine translations, which lacked field-definition and category context. Fix a regex crossing bug in extract_unfinished/apply_translations: <source>([\s\S]+?)</source> could backtrack across an already-translated message into the next <source>/<translation> pair. This silently dropped ~110 entries per language (in the 11 languages with pre-existing translations) from the batch entirely, or translated them but never applied the result. Switch to <source>([^<]+)</source> -- .ts source text is XML-escaped and can never contain a literal '<', so the match can no longer cross message boundaries. Also stop apply_translations' tag-stripping step from emptying out translations that are themselves bracketed placeholders (e.g. "<New Profile>" -> "<Nuevo Perfil>"), which had left one entry stuck in ar/id/ko/pt/tr. Add recover_batch.py, a general-purpose --lang/--batch-id tool for applying results from a batch that timed out or failed to download, replacing the one-off recover_*.py scripts written during this effort. Document it in TRANSLATION_WORKFLOW.md with a new "Recovering a stuck or failed batch" section, and point translate_all_languages.py's polling-timeout message at it. All 18 .ts files now show 0 vanished / 0 unfinished entries after fix_and_unvanish.py, and `cmake --build . --config Release` succeeds with the regenerated .qm files. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
# Conflicts: # src/openstudio_lib/ScheduleFileInspectorView.cpp
Merges #873 from @Ski90Moo on internal branch for CI Wraps user-facing string literals with tr() across all major tabs and adds a complete Spanish (es) translation file as proof of concept for multi-language support, addressing issue #680. Tabs covered: Site/Weather Data, Construction Sets, Materials, Schedules, Thermal Zones, Space Types, Loads, Facility, HVAC Systems, Inspector panel IDD fields, Output Variables (1051 names), Simulation Settings, Measures, Run Simulation, and Results Summary. Key patterns established: - tr() for compile-time strings in Q_OBJECT classes - QCoreApplication::translate(IDD/OutputVariables/TaxonomyCategories) for runtime strings from the OpenStudio SDK and taxonomy.xml - addItem(tr(Display), EnglishData) + currentData() for model-bound combo boxes where SDK values must stay in English - Bilingual display format for IDD fields and output variable names so engineers can cross-reference EnergyPlus documentation without switching the application language
|
Merged in #877 |
Wraps user-facing string literals with tr() across all major tabs and adds a complete Spanish (es) translation file as proof of concept for multi-language support, addressing issue #680.
Tabs covered: Site/Weather Data, Construction Sets, Materials, Schedules, Thermal Zones, Space Types, Loads, Facility, HVAC Systems, Inspector panel IDD fields, Output Variables (1051 names), Simulation Settings, Measures, Run Simulation, and Results Summary.
Key patterns established:
translations/OpenStudioApp_es.ts grows from ~200 to 3017 entries.
New languages only require a new .ts file with no further C++ changes.
The exception is the Geometry tab HTML files (geometry_editor_start.html and geometry_preview.html) each contain a hardcoded JavaScript dictionary keyed by locale code. We could:
Option A — Keep the Geometry tab HTML as an exception requiring separate edits.
Option B — Improve the architecture (better): Have the C++ side inject the locale into the HTML page at load time via QWebEnginePage::runJavaScript(), and move the translations out of the HTML into the .ts file.
Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
DView Units Conversion dialog
The "Would you like to display your Energy+ data in IP units?" dialog shown when opening DView for detailed reports is rendered by the
dviewx64.exebinary (wxWidgets) and cannot be translated through Qt's.tssystem.A companion PR has been opened against the upstream wex library to add
--ip/--siCLI flags to DView: NatLabRockies/wex#197Once that PR merges and a new DView binary is deployed, the OpenStudio side will show its own translated Qt dialog and forward the user's answer to DView via CLI flag, bypassing DView's English-only prompt. The relevant code is already in place in
ResultsTabView.cppand commented out pending the new binary.Extra testing required