mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-18 16:54:25 +08:00
fix error message wrong in toast
This commit is contained in:
@@ -183,6 +183,24 @@ export function getLocalizedError(error) {
|
||||
};
|
||||
}
|
||||
|
||||
export function getLocalizedErrorParameters(parameters, i18nFunc) {
|
||||
let localizedParameters = {};
|
||||
|
||||
if (parameters) {
|
||||
for (let i = 0; i < parameters.length; i++) {
|
||||
const parameter = parameters[i];
|
||||
|
||||
if (parameter.localized) {
|
||||
localizedParameters[parameter.key] = i18nFunc(`parameter.${parameter.value}`);
|
||||
} else {
|
||||
localizedParameters[parameter.key] = parameter.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return localizedParameters;
|
||||
}
|
||||
|
||||
function getLocaleFromLanguageAlias(alias) {
|
||||
for (let locale in allLanguages) {
|
||||
if (!Object.prototype.hasOwnProperty.call(allLanguages, locale)) {
|
||||
|
||||
Reference in New Issue
Block a user