Skip to content

Commit

Permalink
fix: fallbackLocales overriden if parent found
Browse files Browse the repository at this point in the history
  • Loading branch information
Sergio committed Nov 16, 2020
1 parent 6f598e8 commit a53e12f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/conf/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ describe("@lingui/conf", function () {
),
})
expect(config.fallbackLocales).toEqual({
"en-US": "en",
"en-US": ["en"],
default: "en",
"es-MX": "es"
})
Expand Down
2 changes: 1 addition & 1 deletion packages/conf/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a53e12f

Please sign in to comment.