commit 4d569192a6479e9a07ef42ef6b362e2a4d31a75f
parent a6800c8a08f1a1dbff139a853848563a117977cb
Author: Sebastian <sebasjm@taler-systems.com>
Date: Mon, 15 Dec 2025 13:13:03 -0300
fix nan issue
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/packages/pogen/src/po2ts.ts b/packages/pogen/src/po2ts.ts
@@ -102,16 +102,16 @@ export function po2ts(): void {
const header = poAsJson.locale_data.messages[""]
const total = calculateTotalTranslations(poAsJson.locale_data.messages)
const completeness =
- header.lang === "en"
+ (header.lang === "en"
? 100 // 'en' is always complete
- : Math.floor(total.translations * 100 / total.keys);
+ : Math.floor(total.translations * 100 / total.keys));
const strings: StringsType = {
locale_data: poAsJson.locale_data,
domain: poAsJson.domain,
plural_forms: header.plural_forms,
lang: header.lang,
- completeness,
+ completeness: Number.isNaN(completeness) ? 0 : completeness,
}
const value = JSON.stringify(strings, undefined, 2)
const s = `strings['${lang}'] = ${value};\n\n`