Skip to content
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

Persist language preference #11446

Closed
wants to merge 2 commits into from
Closed

Persist language preference #11446

wants to merge 2 commits into from

Conversation

naltatis
Copy link
Member

@naltatis naltatis commented Jan 3, 2024

fixes #10459

  • 💽 language selection is persisted to database (before browser storage)
  • 🔄 new behaviour: language syncs to all clients
  • 🪄 automatic mode still exists -> preferred language per browser (accept header)
  • 🫧 removed unused bh lang. added bg 🇧🇪 and tr 🇹🇷

Video: Firefox (en) <> Safari (de)

lang.persistance.mov

@naltatis naltatis added enhancement New feature or request ux User experience/ interface labels Jan 3, 2024
@naltatis naltatis requested a review from andig January 3, 2024 11:22
@@ -95,6 +95,9 @@ type Site struct {
batterySoc float64 // Battery soc
batteryMode api.BatteryMode // Battery mode

// user settings
language string // Language
Copy link
Member

Choose a reason for hiding this comment

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

Bin ich jetzt kein so großer Fan von. Muss das im Backend sein? Und falls ja: dann sollte es sich vmtl. auch auf den CSV Export auswirken?

Copy link
Member

Choose a reason for hiding this comment

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

Wobei das eher locale denn Sprache wäre…

Copy link
Member Author

Choose a reason for hiding this comment

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

Und falls ja: dann sollte es sich vmtl. auch auf den CSV Export auswirken?

Ja, aktuell wird beim CSV Aufruf die Sprache explizit übergeben. Das könnte man durch die eingestellte Sprache ersetzen. Allerdings bräuchte der Endpunkt dann noch ne Logik, um den "automatisch" (default) Fall zu handeln. Momentan bekommt der immer einer valide Sprache übergeben.

Daher habe ich das in diesem Schritt noch nicht angefasst und hab erstmal die existierende Logik für CSV gelassen.

Copy link
Member Author

Choose a reason for hiding this comment

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

Locale vs. Language: Hier gehts wirklich nur um Sprache, so wie wir sie in Weblate abbilden.

}

// SetLanguage sets the language
func (site *Site) SetLanguage(lang string) error {
Copy link
Member

Choose a reason for hiding this comment

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

Sollte es eine Rolle spielen, ob wir die Sprache überhaupt haben?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ja, wir nehmen hier Freitext an. Den sollten wir vorm Speichern validieren.

@andig
Copy link
Member

andig commented Jan 3, 2024

Mir erschließt sich generell der Bedarf nicht. Tradeoff code <> Nutzen. Meine bevorzugte Sprache hat schon das Betriebssystem und damit auch das evcc UI.

@naltatis
Copy link
Member Author

naltatis commented Jan 3, 2024

Siehe verlinkter Issue.

@andig
Copy link
Member

andig commented Jan 3, 2024

Ah, der Tesla Case. Warum ein deutsches Auto auf Holländisch eingestellt ist? Wohl eher ein Fall für den Tesla Support.

@naltatis
Copy link
Member Author

naltatis commented Jan 3, 2024

Tradeoff code <> Nutzen

Ja, wir können beim Tesla Case auch Wontfix sagen. Ursprünglich haben wir gesagt, wir machen das. Eine einfachere Lösung als das aktuelle sehe ich dafür momentan nicht.

@naltatis
Copy link
Member Author

Closing this, since it introduces quite a lot of extra code in introduces new, maybe unwanted constraints. See #10459 (comment)

This also means that we will won't fix #10459. Sorry.

\cc @samsmooth @RTTTC

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ux User experience/ interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Provide language override in config
2 participants