support custom tips in login page

This commit is contained in:
MaysWind
2024-11-10 20:50:03 +08:00
parent f87fbddef7
commit f6dd4c03c3
7 changed files with 111 additions and 2 deletions
+15
View File
@@ -1435,6 +1435,20 @@ function getCategorizedAccountsWithDisplayBalance(allVisibleAccounts, showAccoun
return ret;
}
function getServerTipContent(tipConfig, i18nGlobal) {
if (!tipConfig) {
return '';
}
const currentLanguage = getCurrentLanguageTag(i18nGlobal);
if (tipConfig[currentLanguage]) {
return tipConfig[currentLanguage];
}
return tipConfig.default || '';
}
function joinMultiText(textArray, translateFn) {
if (!textArray || !textArray.length) {
return '';
@@ -1707,6 +1721,7 @@ export function i18nFunctions(i18nGlobal) {
getAllSupportedImportFileTypes: () => getAllSupportedImportFileTypes(i18nGlobal, i18nGlobal.t),
getEnableDisableOptions: () => getEnableDisableOptions(i18nGlobal.t),
getCategorizedAccountsWithDisplayBalance: (allVisibleAccounts, showAccountBalance, defaultCurrency, settingsStore, userStore, exchangeRatesStore) => getCategorizedAccountsWithDisplayBalance(allVisibleAccounts, showAccountBalance, defaultCurrency, userStore, settingsStore, exchangeRatesStore, i18nGlobal.t),
getServerTipContent: (tipConfig) => getServerTipContent(tipConfig, i18nGlobal),
joinMultiText: (textArray) => joinMultiText(textArray, i18nGlobal.t),
setLanguage: (locale, force) => setLanguage(i18nGlobal, locale, force),
setTimeZone: (timezone) => setTimeZone(timezone),
+4
View File
@@ -33,6 +33,10 @@ export function isDataImportingEnabled() {
return getServerSetting('i') === 1;
}
export function getLoginPageTips() {
return getServerSetting('lpt');
}
export function getMapProvider() {
return getServerSetting('m');
}