-
-
Notifications
You must be signed in to change notification settings - Fork 483
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: layer vue i18n config merging (#2358)
* feat: layer vue i18n config merging * test: update snapshot * fix: layer vuei18n configurations merge order * test: disable jit compilation for vuei18n layer test * docs: describe VueI18n option merging on layers page
- Loading branch information
1 parent
bdc2991
commit c411518
Showing
15 changed files
with
207 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,18 @@ | ||
export default {} | ||
export default { | ||
messages: { | ||
nl: { | ||
about: 'Over deze site', | ||
snakeCaseText: "@.snakeCase:{'about'}", | ||
pascalCaseText: "@.pascalCase:{'about'}" | ||
}, | ||
fr: { | ||
about: 'À propos de ce site', | ||
snakeCaseText: "@.snakeCase:{'about'}", | ||
pascalCaseText: "@.pascalCase:{'about'}" | ||
} | ||
}, | ||
modifiers: { | ||
// @ts-ignore | ||
snakeCase: (str: string) => str.split(' ').join('-') | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
specs/fixtures/layer_consumer/layer-simple-secondary/i18n.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
export default { | ||
messages: { | ||
en: { | ||
about: 'Should be overridden' | ||
} | ||
}, | ||
modifiers: { | ||
// @ts-ignore | ||
pascalCase: (str: string) => | ||
str | ||
.split(' ') | ||
.map(s => s.slice(0, 1).toUpperCase() + s.slice(1)) | ||
.join('') | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
specs/fixtures/layer_consumer/layer-simple-secondary/nuxt.config.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// https://nuxt.com/docs/guide/directory-structure/nuxt.config | ||
export default defineNuxtConfig({ | ||
modules: ['@nuxtjs/i18n'], | ||
i18n: { | ||
locales: ['fr', 'nl', 'en'], | ||
defaultLocale: 'nl', | ||
detectBrowserLanguage: false, | ||
vueI18n: './i18n.config.ts' | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,24 @@ | ||
export default { | ||
messages: { | ||
fr: { | ||
thanks: 'Merci!' | ||
thanks: 'Merci!', | ||
about: 'Should be overridden' | ||
}, | ||
nl: { | ||
thanks: 'Bedankt!' | ||
}, | ||
en: { | ||
about: 'About this site', | ||
snakeCaseText: "@.snakeCase:{'about'}", | ||
pascalCaseText: "@.pascalCase:{'about'}" | ||
} | ||
}, | ||
modifiers: { | ||
// @ts-ignore | ||
pascalCase: (str: string) => | ||
str | ||
.split(' ') | ||
.map(s => s.slice(0, 1).toUpperCase() + s.slice(1)) | ||
.join('') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
// https://nuxt.com/docs/guide/directory-structure/nuxt.config | ||
export default defineNuxtConfig({ | ||
extends: ['./layer-simple'], | ||
extends: ['./layer-simple', './layer-simple-secondary'], | ||
modules: ['@nuxtjs/i18n'] | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.