feat(localization): expand language support and enhance UI for user settings
- Added support for additional UI locales including Cebuano and Spanish, improving accessibility for a broader user base. - Updated language selection components in the AppHeader and SettingsWidget to reflect new language options, enhancing user experience. - Enhanced localization of various UI elements across components, ensuring consistent language representation and improved user engagement. - Implemented logic to synchronize user language preferences with backend settings, providing a seamless experience when changing languages.
This commit is contained in:
@@ -21,7 +21,7 @@
|
||||
</dd>
|
||||
</template>
|
||||
</dl>
|
||||
<span v-else>—</span>
|
||||
<span v-else>{{ $t('widgets.falukant.emptyValue') }}</span>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -62,7 +62,7 @@ export default {
|
||||
},
|
||||
falukantDisplayName() {
|
||||
const d = this.falukantData;
|
||||
if (!d) return '—';
|
||||
if (!d) return this.$t('widgets.falukant.emptyValue');
|
||||
const titleKey = d.titleLabelTr;
|
||||
const gender = d.gender;
|
||||
const nameWithoutTitle = d.nameWithoutTitle ?? d.characterName;
|
||||
@@ -71,11 +71,11 @@ export default {
|
||||
const translatedTitle = this.$t(key);
|
||||
if (translatedTitle !== key) return `${translatedTitle} ${nameWithoutTitle}`.trim();
|
||||
}
|
||||
return d.characterName || nameWithoutTitle || '—';
|
||||
return d.characterName || nameWithoutTitle || this.$t('widgets.falukant.emptyValue');
|
||||
},
|
||||
falukantGenderLabel() {
|
||||
const g = this.falukantData?.gender;
|
||||
if (g == null || g === '') return '—';
|
||||
if (g == null || g === '') return this.$t('widgets.falukant.emptyValue');
|
||||
|
||||
// Altersabhängige, (auf Wunsch) altertümlichere Bezeichnungen
|
||||
const years = this._ageYearsFromWidgetValue(this.falukantData?.age);
|
||||
@@ -93,9 +93,9 @@ export default {
|
||||
},
|
||||
falukantAgeLabel() {
|
||||
const ageValue = this.falukantData?.age;
|
||||
if (ageValue == null) return '—';
|
||||
if (ageValue == null) return this.$t('widgets.falukant.emptyValue');
|
||||
const years = this._ageYearsFromWidgetValue(ageValue);
|
||||
if (years == null) return '—';
|
||||
if (years == null) return this.$t('widgets.falukant.emptyValue');
|
||||
return `${years} ${this.$t('falukant.overview.metadata.years')}`;
|
||||
}
|
||||
},
|
||||
@@ -145,8 +145,17 @@ export default {
|
||||
},
|
||||
formatMoney(value) {
|
||||
const n = Number(value);
|
||||
if (Number.isNaN(n)) return '—';
|
||||
return n.toLocaleString('de-DE');
|
||||
if (Number.isNaN(n)) return this.$t('widgets.falukant.emptyValue');
|
||||
return n.toLocaleString(this.getNumberLocale());
|
||||
},
|
||||
getNumberLocale() {
|
||||
const locale = this.$i18n?.locale;
|
||||
return {
|
||||
de: 'de-DE',
|
||||
en: 'en-GB',
|
||||
es: 'es-ES',
|
||||
ceb: 'fil-PH'
|
||||
}[locale] || 'de-DE';
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user