Skip to content

Commit

Permalink
Setup wizard: Fix already set i18n settings not respected (openhab#2559)
Browse files Browse the repository at this point in the history
Fixes openhab/openhab-core#4105.

The setup wizard did not respect the i18n config file's content, which
resulted in overwriting the existing i18n settings.

Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 authored May 2, 2024
1 parent 6f5a59f commit 9d89146
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions bundles/org.openhab.ui/web/src/pages/wizards/setup-wizard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -505,8 +505,7 @@ export default {
this.availableLanguages = data[0].parameters.find(p => p.name === 'language').options
this.availableRegions = data[0].parameters.find(p => p.name === 'region').options
this.availableTimezones = data[0].parameters.find(p => p.name === 'timezone').options
if (data[1].region) this.region = data[1].region
if (data[1].location) this.location = data[1].location
if (Intl && Intl.DateTimeFormat().resolvedOptions()) {
const intlOptions = Intl.DateTimeFormat().resolvedOptions()
if (intlOptions.locale) {
Expand All @@ -516,8 +515,14 @@ export default {
if (intlOptions.timeZone) {
if (this.availableTimezones.find((tz) => tz.value === intlOptions.timeZone)) this.timezone = intlOptions.timeZone
}
this.i18nReady = true
}
if (data[1].language) this.language = data[1].language
if (data[1].location) this.location = data[1].location
if (data[1].region) this.region = data[1].region
if (data[1].timezone) this.timezone = data[1].timezone
this.i18nReady = true
})
this.$oh.api.get('/rest/addons/suggestions').then((suggestedAddons) => {
const suggestions = suggestedAddons.flatMap(s => s.id)
Expand Down

0 comments on commit 9d89146

Please sign in to comment.