Skip to content

Commit 925997d

Browse files
authored
fix(cli): injectLocale (#1019)
1 parent c106f0b commit 925997d

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.changeset/giant-elephants-develop.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"lingo.dev": minor
3+
---
4+
5+
injectLocale uses forward slash now

packages/cli/src/cli/loaders/index.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ describe("bucket loaders", () => {
544544

545545
const jsonLoader = createBucketLoader("json", "i18n/[locale].json", {
546546
defaultLocale: "en",
547-
injectLocale: ["settings.locale", "not-a-locale"],
547+
injectLocale: ["settings/locale", "not-a-locale"],
548548
});
549549
jsonLoader.setDefaultLocale("en");
550550
const data = await jsonLoader.pull("en");
@@ -571,7 +571,7 @@ describe("bucket loaders", () => {
571571

572572
const jsonLoader = createBucketLoader("json", "i18n/[locale].json", {
573573
defaultLocale: "en",
574-
injectLocale: ["settings.locale", "not-a-locale"],
574+
injectLocale: ["settings/locale", "not-a-locale"],
575575
});
576576
jsonLoader.setDefaultLocale("en");
577577
await jsonLoader.pull("en");

packages/cli/src/cli/loaders/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ export default function createBucketLoader(
9999
createPrettierLoader({ parser: "json", bucketPathPattern }),
100100
createJsonLoader(),
101101
createEnsureKeyOrderLoader(),
102-
createInjectLocaleLoader(options.injectLocale),
103102
createFlatLoader(),
103+
createInjectLocaleLoader(options.injectLocale),
104104
createLockedKeysLoader(lockedKeys || []),
105105
createSyncLoader(),
106106
createUnlocalizableLoader(options.returnUnlocalizedKeys),

0 commit comments

Comments
 (0)