-
If we want to change "localization" to "localisation" for en_gb but define all the "base" strings in the en_us locale, can we have a brief en_gb file with only the overridden values and have en_us be a fallback locale for when the user is using en_gb ? I realize there's a feature to do this in js, but I'm asking if it can be done in a way where we don't have to specify a fallback string every time we render the word "localization" and just do something where we search for the string in the specific locale and then fall back to the base one if it doesn't exist |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You can do it overwritting i18n.js {
// ...rest of config
"loadLocaleFrom": async (lang, ns) => {
const defaultValues = lang === 'en_gb'
? await import(`./locales/en_us/${ns}.json`).then((m) => m.default)
: {}
return {
...defaultValues,
...(await import(`./locales/${lang}/${ns}.json`).then((m) => m.default))
}
},
} |
Beta Was this translation helpful? Give feedback.
-
Thanks. Did not know about the discussions feature on the site - my bad for making is an issue. And I appreciate the timely and helpful response :) |
Beta Was this translation helpful? Give feedback.
You can do it overwritting
loadLocaleFrom
configuration prop, something like:i18n.js