feat(admin-*,dashboard): add dashboard i18n extensions (#13763)
* virtual i18n module
* changeset
* fallback ns
fallback to the default "translation" ns if the key isnt found. Allows to use a single "useTranslation("customNs")" hook for both custom and medusa-provided keys
* simplify merges
* optional for backward compat
* fix HMR
* fix generated deepMerge
* test
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
import { InitOptions } from "i18next"
|
||||
|
||||
import translations from "./translations"
|
||||
|
||||
export const defaultI18nOptions: InitOptions = {
|
||||
debug: process.env.NODE_ENV === "development",
|
||||
detection: {
|
||||
@@ -11,9 +9,8 @@ export const defaultI18nOptions: InitOptions = {
|
||||
order: ["cookie", "localStorage", "header"],
|
||||
},
|
||||
fallbackLng: "en",
|
||||
fallbackNS: "translation",
|
||||
interpolation: {
|
||||
escapeValue: false,
|
||||
},
|
||||
resources: translations,
|
||||
supportedLngs: Object.keys(translations),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user