From 18e56163de9d3227db93ce972d3e4f1d5f40c8c2 Mon Sep 17 00:00:00 2001 From: Linus Rath <139418639+rathlinus@users.noreply.github.com> Date: Sat, 29 Aug 2026 18:20:47 +0200 Subject: [PATCH] test: compare locale coverage against the vendored catalog and add missing overlay keys --- locales/rn/en.json | 3 ++- src/i18n/__tests__/keys.test.ts | 7 ++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/locales/rn/en.json b/locales/rn/en.json index bd0d76e0..f6c42538 100644 --- a/locales/rn/en.json +++ b/locales/rn/en.json @@ -115,7 +115,8 @@ "swipe_move": "Move", "swipe_spam": "Spam", "total": "total", - "undo_failed": "Undo failed" + "undo_failed": "Undo failed", + "no_emails_in": "No emails in {folder}" }, "email_viewer": { "color_tag": { diff --git a/src/i18n/__tests__/keys.test.ts b/src/i18n/__tests__/keys.test.ts index 01cb1554..1320fda0 100644 --- a/src/i18n/__tests__/keys.test.ts +++ b/src/i18n/__tests__/keys.test.ts @@ -70,6 +70,11 @@ describe('translation coverage', () => { }); it('every other locale is a subset of English', () => { + // The vendored webmail catalog, without the RN-only overlay (which only + // exists for English and is served to every locale through the fallback). + const baseEn = flatten( + JSON.parse(readFileSync(join(SRC_ROOT, '..', 'locales', 'en', 'common.json'), 'utf8')) as Record, + ); for (const { code } of SUPPORTED_LOCALES) { if (code === 'en') continue; const keys = flatten(getDictionary(code as LocaleCode)); @@ -77,7 +82,7 @@ describe('translation coverage', () => { expect(extra, `${code} has keys English lacks`).toEqual([]); // Catalogs are near-complete translations; a locale with fewer than // 90% of the English keys is a sign of a broken vendored file. - expect(keys.size).toBeGreaterThan(en.size * 0.9); + expect(keys.size).toBeGreaterThan(baseEn.size * 0.9); } }); });