From a53e12f19cebeb6412debc9dace0b4a45aa17624 Mon Sep 17 00:00:00 2001 From: Sergio Date: Mon, 16 Nov 2020 18:26:22 +0100 Subject: [PATCH] fix: fallbackLocales overriden if parent found --- packages/conf/src/index.test.ts | 2 +- packages/conf/src/index.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/conf/src/index.test.ts b/packages/conf/src/index.test.ts index cbd13c22f..2ec6e15b0 100644 --- a/packages/conf/src/index.test.ts +++ b/packages/conf/src/index.test.ts @@ -173,7 +173,7 @@ describe("@lingui/conf", function () { ), }) expect(config.fallbackLocales).toEqual({ - "en-US": "en", + "en-US": ["en"], default: "en", "es-MX": "es" }) diff --git a/packages/conf/src/index.ts b/packages/conf/src/index.ts index 0692c3ded..9c09082b5 100644 --- a/packages/conf/src/index.ts +++ b/packages/conf/src/index.ts @@ -278,7 +278,7 @@ export function fallbackLanguageMigration( config.locales.forEach((locale) => { const fl = getCldrParentLocale(locale.toLowerCase()) - if (fl) { + if (fl && !config.fallbackLocales[locale]) { config.fallbackLocales = { ...config.fallbackLocales, [locale]: fl