show localized language name in language selection popup

This commit is contained in:
MaysWind
2025-03-09 02:02:29 +08:00
parent ab6e89594e
commit 847d5121aa
2 changed files with 29 additions and 15 deletions
+14 -9
View File
@@ -60,22 +60,27 @@
<f7-list strong inset dividers class="margin-vertical"> <f7-list strong inset dividers class="margin-vertical">
<f7-list-item <f7-list-item
class="list-item-with-header-and-title list-item-no-item-after" class="list-item-with-header-and-title list-item-no-item-after"
:key="currentLocale + '_lang'" link="#"
:header="languageTitle" :header="languageTitle"
:title="currentLanguageName" :title="currentLanguageName"
smart-select :smart-select-params="{ openIn: 'popup', popupPush: true, closeOnSelect: true, scrollToSelectedItem: true, searchbar: true, searchbarPlaceholder: tt('Language'), searchbarDisableText: tt('Cancel'), appendSearchbarNotFound: tt('No results'), pageTitle: languageTitle, popupCloseLinkText: tt('Done') }" @click="showLanguagePopup = true"
> >
<select v-model="currentLocale"> <list-item-selection-popup value-type="item"
<option :value="lang.languageTag" key-field="languageTag" value-field="languageTag"
:key="lang.languageTag" title-field="nativeDisplayName" after-field="displayName"
v-for="lang in allLanguages">{{ lang.nativeDisplayName }}</option> :title="languageTitle"
</select> :enable-filter="true"
:filter-placeholder="tt('Language')"
:filter-no-items-text="tt('No results')"
:items="allLanguages"
v-model:show="showLanguagePopup"
v-model="currentLocale">
</list-item-selection-popup>
</f7-list-item> </f7-list-item>
<f7-list-item <f7-list-item
class="list-item-with-header-and-title list-item-no-item-after" class="list-item-with-header-and-title list-item-no-item-after"
link="#" link="#"
:key="currentLocale + '_currency'"
:header="tt('Default Currency')" :header="tt('Default Currency')"
@click="showDefaultCurrencyPopup = true" @click="showDefaultCurrencyPopup = true"
> >
@@ -100,7 +105,6 @@
<f7-list-item <f7-list-item
class="list-item-with-header-and-title list-item-no-item-after" class="list-item-with-header-and-title list-item-no-item-after"
:key="currentLocale + '_firstDayOfWeek'"
:header="tt('First Day of Week')" :header="tt('First Day of Week')"
:title="currentDayOfWeekName" :title="currentDayOfWeekName"
smart-select :smart-select-params="{ openIn: 'popup', popupPush: true, closeOnSelect: true, scrollToSelectedItem: true, searchbar: true, searchbarPlaceholder: tt('Date'), searchbarDisableText: tt('Cancel'), appendSearchbarNotFound: tt('No results'), pageTitle: tt('First Day of Week'), popupCloseLinkText: tt('Done') }" smart-select :smart-select-params="{ openIn: 'popup', popupPush: true, closeOnSelect: true, scrollToSelectedItem: true, searchbar: true, searchbarPlaceholder: tt('Date'), searchbarDisableText: tt('Cancel'), appendSearchbarNotFound: tt('No results'), pageTitle: tt('First Day of Week'), popupCloseLinkText: tt('Done') }"
@@ -223,6 +227,7 @@ const {
const rootStore = useRootStore(); const rootStore = useRootStore();
const usePresetCategories = ref<boolean>(false); const usePresetCategories = ref<boolean>(false);
const showLanguagePopup = ref<boolean>(false);
const showDefaultCurrencyPopup = ref<boolean>(false); const showDefaultCurrencyPopup = ref<boolean>(false);
const showPresetCategories = ref<boolean>(false); const showPresetCategories = ref<boolean>(false);
const showPresetCategoriesMoreActionSheet = ref<boolean>(false); const showPresetCategoriesMoreActionSheet = ref<boolean>(false);
+15 -6
View File
@@ -129,14 +129,22 @@
<f7-list form strong inset dividers class="margin-vertical" v-if="!loading"> <f7-list form strong inset dividers class="margin-vertical" v-if="!loading">
<f7-list-item <f7-list-item
class="list-item-with-header-and-title list-item-no-item-after" class="list-item-with-header-and-title list-item-no-item-after"
link="#"
:header="languageTitle" :header="languageTitle"
:title="currentLanguageName" :title="currentLanguageName"
smart-select :smart-select-params="{ openIn: 'popup', popupPush: true, closeOnSelect: true, scrollToSelectedItem: true, searchbar: true, searchbarPlaceholder: languageTitle, searchbarDisableText: tt('Cancel'), appendSearchbarNotFound: tt('No results'), pageTitle: languageTitle, popupCloseLinkText: tt('Done') }"> @click="showLanguagePopup = true"
<select v-model="newProfile.language"> >
<option :value="language.languageTag" <list-item-selection-popup value-type="item"
:key="language.languageTag" key-field="languageTag" value-field="languageTag"
v-for="language in allLanguages">{{ language.nativeDisplayName }}</option> title-field="nativeDisplayName" after-field="displayName"
</select> :title="languageTitle"
:enable-filter="true"
:filter-placeholder="tt('Language')"
:filter-no-items-text="tt('No results')"
:items="allLanguages"
v-model:show="showLanguagePopup"
v-model="newProfile.language">
</list-item-selection-popup>
</f7-list-item> </f7-list-item>
<f7-list-item <f7-list-item
@@ -410,6 +418,7 @@ const currentPassword = ref<string>('');
const loadingError = ref<unknown | null>(null); const loadingError = ref<unknown | null>(null);
const showInputPasswordSheet = ref<boolean>(false); const showInputPasswordSheet = ref<boolean>(false);
const showAccountSheet = ref<boolean>(false); const showAccountSheet = ref<boolean>(false);
const showLanguagePopup = ref<boolean>(false);
const showDefaultCurrencyPopup = ref<boolean>(false); const showDefaultCurrencyPopup = ref<boolean>(false);
const showMoreActionSheet = ref<boolean>(false); const showMoreActionSheet = ref<boolean>(false);