Skip to content

Commit

Permalink
feat: move astro-i18next config in a standalone file to load it for C…
Browse files Browse the repository at this point in the history
…LI commands

update config properties for consistency

BREAKING CHANGE: config is now a standalone file + some property names
have changed for better clarity and consistency

- `baseLocale` is now `defaultLanguage`
- `supportedLocales` is now `supportedLanguages``
  • Loading branch information
yassinedoghri committed Aug 21, 2022
1 parent 02ddb76 commit bdf2408
Show file tree
Hide file tree
Showing 14 changed files with 870 additions and 213 deletions.
4 changes: 3 additions & 1 deletion build.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ require("esbuild")
.build({
bundle: true,
entryPoints: [
"src/index.mts",
"src/index.ts",
"src/utils.ts",
"src/components/index.mts",
"src/cli/index.ts",
Expand All @@ -21,6 +21,8 @@ require("esbuild")
"fs-extra",
"iso-639-1",
"iso-3166-1-alpha-2",
"@proload/core",
"@proload/plugin-typescript",
],
minify: false,
format: "esm",
Expand Down
12 changes: 12 additions & 0 deletions example/astro-i18next.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
export default {
defaultLanguage: "en",
supportedLanguages: ["en", "fr"],
i18next: {
debug: true,
initImmediate: false,
backend: {
loadPath: "./src/locales/{{lng}}.json",
},
},
i18nextPlugins: { fsBackend: "i18next-fs-backend" },
};
13 changes: 1 addition & 12 deletions example/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ export default defineConfig({
},
}),
tailwind(),
astroI18next({
baseLocale: "en",
supportedLocales: ["en", "fr"],
i18next: {
debug: true,
initImmediate: false,
backend: {
loadPath: "./src/locales/{{lng}}.json",
},
},
i18nextPlugins: { fsBackend: "i18next-fs-backend" },
}),
astroI18next(),
],
});
2 changes: 2 additions & 0 deletions example/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit bdf2408

Please sign in to comment.