Skip to content

Add multi-language support#6

Open
Coelopsychis wants to merge 11 commits into
maltefritz:mainfrom
Coelopsychis:feat/multi-lang
Open

Add multi-language support#6
Coelopsychis wants to merge 11 commits into
maltefritz:mainfrom
Coelopsychis:feat/multi-lang

Conversation

@Coelopsychis

Copy link
Copy Markdown
Contributor
  • Add initial multi-language support with German and English locale files.
  • Introduce centralised translation helper using txt(...) with fallback to the default language.
  • Replace hard-coded UI strings across the Streamlit pages with translation keys.
  • Add language-aware labels, headings, buttons, status messages, warnings, errors, and charts.
  • Add language-aware topology images.
  • Internationalise generated HTML report.
  • Move tooltips into locale files using the tooltips.* key namespace.
  • Keep technical data keys stable while translating only UI strings.
  • Add locale mappings for energy system unit parameterisation.
  • Preserve existing German behavior as the default language.
  • Add caching to prevent the app from being slowed down by translations.

All hard-coded UI strings have been replaced by keys in the format namespace.optional_subgroup.keyword. Some commonly used phrases have been collected using a common.* namespace to reduce redundancy.
The language can now be selected in helpers.py by setting DEFAULT_LANGUAGE to either de or en, or by setting st.session_state['language'] in the future. Because the localisation data is cached, Streamlit has to be restarted after modifying the locale JSON files.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant