Skip to content

Is there a way to make one locale "extend" another? #808

Answered by aralroca
ethteck asked this question in Q&A
Discussion options

You must be logged in to vote

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

You can do it overwritting loadLocaleFrom configuration prop, something like:

i18n.js

{
  // ...rest of config
  "loadLocaleFrom": 

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by ethteck
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #807 on March 12, 2022 10:55.