Localization: Fix "0" variables (#5177)

This commit is contained in:
zubiden 2024-11-09 15:40:41 +04:00 committed by Alexander Zinchuk
parent 516061a553
commit 8040cee2d2

View File

@ -367,7 +367,7 @@ function processTranslation(
const variableEntries = variables ? Object.entries(variables) : [];
const finalString = variableEntries.reduce((result, [key, value]) => {
if (!value) return result;
if (value === undefined) return result;
const valueAsString = Number.isInteger(value) ? formatters!.number.format(value as number) : String(value);
return result.replace(`{${key}}`, valueAsString);