Localization: Try to use otherValue plural option as fallback (#1979)

This commit is contained in:
Alexander Zinchuk 2022-08-05 19:23:32 +02:00
parent 49e7c15b2e
commit bc9fd31ed3

View File

@ -210,7 +210,9 @@ function processTemplate(template: string, value: any) {
function processTranslation(langString: ApiLangString | undefined, key: string, value?: any, format?: 'i') {
const preferedPluralOption = typeof value === 'number' ? getPluralOption(value) : 'value';
const template = langString ? (langString[preferedPluralOption] || langString.value) : undefined;
const template = langString ? (
langString[preferedPluralOption] || langString.otherValue || langString.value
) : undefined;
if (!template || !template.trim()) {
const parts = key.split('.');