-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: simplified API + instanciate i18next both in server and client …
…side - update config naming - abstract i18next config + make it overridable for server and client configs - fix route translations to discard page extensions - update README to account for new route features and easier setup - add i18next-fs-backend, i18next-http-backend and i18next-browser-languagedetector packages to abstract locales detection and loading - automatically require react-i18next when @astrojs/react integration is installed BREAKING CHANGE: - defaultLanguage is now defaultLocale - supportedLanguages is now locales - i18next config is now split into two configs: `i18nextServer` and `i18nextClient` fixes #57, closes #46, #37
- Loading branch information
1 parent
44a5422
commit ed44510
Showing
48 changed files
with
3,648 additions
and
1,841 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
import type { AstroI18nextConfig } from "astro-i18next"; | ||
|
||
const config: AstroI18nextConfig = { | ||
defaultLanguage: "en", | ||
supportedLanguages: ["en", "fr"], | ||
i18next: { | ||
debug: true, | ||
initImmediate: false, | ||
backend: { | ||
loadPath: "./src/locales/{{lng}}.json", | ||
}, | ||
}, | ||
i18nextPlugins: { fsBackend: "i18next-fs-backend" }, | ||
defaultLocale: "en", | ||
locales: ["en", "fr"], | ||
namespaces: ["common", "translation"], | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.