Localization: Try to use otherValue plural option as fallback (#1979)
This commit is contained in:
parent
49e7c15b2e
commit
bc9fd31ed3
@ -210,7 +210,9 @@ function processTemplate(template: string, value: any) {
|
|||||||
|
|
||||||
function processTranslation(langString: ApiLangString | undefined, key: string, value?: any, format?: 'i') {
|
function processTranslation(langString: ApiLangString | undefined, key: string, value?: any, format?: 'i') {
|
||||||
const preferedPluralOption = typeof value === 'number' ? getPluralOption(value) : 'value';
|
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()) {
|
if (!template || !template.trim()) {
|
||||||
const parts = key.split('.');
|
const parts = key.split('.');
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user