add English hint for language option when current language is not English

This commit is contained in:
MaysWind
2025-01-25 23:22:45 +08:00
parent acaad355ed
commit 99a2f40a4e
3 changed files with 18 additions and 4 deletions
@@ -20,6 +20,7 @@ import { getCategorizedAccounts } from '@/lib/account.ts';
export function useUserProfilePageBase() {
const {
tt,
getDefaultCurrency,
getDefaultFirstDayOfWeek,
getAllLanguageOptions,
@@ -72,6 +73,16 @@ export function useUserProfilePageBase() {
const allIncomeAmountColorTypes = computed<TypeAndDisplayName[]>(() => getAllIncomeAmountColors());
const allTransactionEditScopeTypes = computed<TypeAndDisplayName[]>(() => getAllTransactionEditScopeTypes());
const languageTitle = computed<string>(() => {
const languageInCurrentLanguage = tt('Language');
if (languageInCurrentLanguage !== 'Language') {
return `${languageInCurrentLanguage} / Language`;
}
return languageInCurrentLanguage;
});
const supportDigitGroupingSymbol = computed<boolean>(() => {
for (const digitGroupingType of allDigitGroupingTypes.value) {
if (digitGroupingType.type === newProfile.value.digitGrouping) {
@@ -195,6 +206,7 @@ export function useUserProfilePageBase() {
allExpenseAmountColorTypes,
allIncomeAmountColorTypes,
allTransactionEditScopeTypes,
languageTitle,
supportDigitGroupingSymbol,
inputIsNotChangedProblemMessage,
inputInvalidProblemMessage,
@@ -120,8 +120,8 @@
item-value="languageTag"
persistent-placeholder
:disabled="loading || saving"
:label="tt('Language')"
:placeholder="tt('Language')"
:label="languageTitle"
:placeholder="languageTitle"
:items="allLanguages"
v-model="newProfile.language"
/>
@@ -381,6 +381,7 @@ const {
allExpenseAmountColorTypes,
allIncomeAmountColorTypes,
allTransactionEditScopeTypes,
languageTitle,
supportDigitGroupingSymbol,
inputIsNotChangedProblemMessage,
inputInvalidProblemMessage,
+3 -2
View File
@@ -128,9 +128,9 @@
<f7-list form strong inset dividers class="margin-vertical" v-if="!loading">
<f7-list-item
class="list-item-with-header-and-title list-item-no-item-after"
:header="tt('Language')"
:header="languageTitle"
: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: tt('Language'), popupCloseLinkText: tt('Done') }">
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') }">
<select v-model="newProfile.language">
<option :value="language.languageTag"
:key="language.languageTag"
@@ -379,6 +379,7 @@ const {
allExpenseAmountColorTypes,
allIncomeAmountColorTypes,
allTransactionEditScopeTypes,
languageTitle,
supportDigitGroupingSymbol,
inputIsNotChangedProblemMessage,
inputInvalidProblemMessage,