Skip to content

Conversation

@da-Kai
Copy link
Contributor

@da-Kai da-Kai commented Nov 14, 2025

  • Fallback to browser language when AuthenticateResponse provides no language.
  • Centralize logic for retrieving the current language
  • Change default Language from de to en
  • Replace Fenecon specific no local history notice with a generic OpenEMS version.
  • Set language explicitly to de in Karma tests.

Address language issue in #3411

@da-Kai da-Kai requested review from Copilot and lukasrgr November 14, 2025 20:36
@da-Kai da-Kai changed the title Edge UI: User browser Language as Default Edge UI: Use browser Language as Default Nov 14, 2025
Copilot finished reviewing on behalf of da-Kai November 14, 2025 20:38

This comment was marked as resolved.

@codecov
Copy link

codecov bot commented Nov 14, 2025

Codecov Report

❌ Patch coverage is 37.03704% with 17 lines in your changes missing coverage. Please review.

❌ Your patch check has failed because the patch coverage (37.04%) is below the target coverage (75.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@              Coverage Diff              @@
##             develop    #3415      +/-   ##
=============================================
+ Coverage      59.61%   59.62%   +0.01%     
  Complexity       112      112              
=============================================
  Files           2894     2895       +1     
  Lines         124658   124664       +6     
  Branches        9343     9332      -11     
=============================================
+ Hits           74304    74320      +16     
+ Misses         47534    47524      -10     
  Partials        2820     2820              
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

…-browser-language

# Conflicts:
#	ui/src/assets/i18n/de.json
#	ui/src/assets/i18n/en.json
Copy link
Contributor

@lukasrgr lukasrgr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thx for this incremental improvement

edgeShortName: "OpenEMS",
edgeLongName: "Open Energy Management System",
defaultLanguage: "de",
defaultLanguage: "en",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

das solltest du wahrscheinlich nicht ändern

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

en macht aber mehr sinn als de

],
"fileReplacements": [
{
"replace": "src/environments/dummy.ts",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency we should name this file karma.ts dont you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dummy.ts ist ja die Datei, die ich ersetzen will.

const userLangKey = Language.getByKey(authenticateResponse.user.language?.toLowerCase());
const demoLangKey = Language.getByKey(localStorage.DEMO_LANGUAGE);

const language = demoLangKey ?? userLangKey ?? Language.SYSTEM ?? Language.DEFAULT;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

willst du das dann nicht auch auslagern? const userLangKey,
const demoLangKey

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was genau meinst du mit auslagern? Wohin auslagern?

@da-Kai da-Kai requested a review from lukasrgr December 1, 2025 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants