Repository navigation
studio: interface in English or French (FR/EN switch) - #5
Merged
Merged
Conversation
The texts of canoP studio are written in French in the code and wrapped in tr() (tools/canop_i18n.py);
their English translations are in tools/canop_i18n_en.py (322 texts). The language is a setting of
the studio, switched in the top bar: the texts of the state are recomputed (refresh_language() of the
modules) and the interface is rebuilt once the update of the page is handled. New installations
start in English; settings saved without a language keep French.
- Values used by the logic stay as they are (run states, stored in signac documents and read by the
MCP tools, are translated only when shown); files written by the studio (version lines of the
inis) do not depend on the language.
- tools/trame/check_i18n.py checks that every tr() text has a translation with the same
placeholders and {{ }} expressions: ctest (label unit) and pre-commit.
- The run view template and the analysis.py template of new campaigns are translated; existing runs
and campaigns keep their copies.
- VS Code extension: follows the language of VS Code (package.nls*.json, a dictionary in
extension.js).
- Docs and the studio README use the English labels; physics/<model>/ in a help text now shows.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
canoP studio in English or French
canoP studio can now be used in English or in French, with a FR/EN switch in the top bar. The choice is saved in the studio settings. New installations start in English, and studios that were set up before keep French until the user switches.
How it works
tr()(tools/canop_i18n.py). Their English translations are intools/canop_i18n_en.py: 322 texts, grouped by file.refresh_language());# [canoP studio]lines of the run inis, do not depend on the language.tools/trame/check_i18n.pychecks that everytr()text has a translation with the same placeholders and{{ }}expressions. It runs in ctest (labelunit, so in the CI) and as a pre-commit hook.analysis.py) are translated. Existing runs and campaigns keep their own copies, in French.package.nls*.json).Tested
hors-campagne(an identifier) is left;check_i18n.py: 322 texts, 0 errors.Not tested
The running studio has to be restarted after the merge.
🤖 Generated with Claude Code