Transaltion always fallback to default
See original GitHub issueHello and thank you again for the great work you are doing, i was trying to work on translation in themeProvider for some of my components , since there is no example in stories for translation i tried using docs ,
import ThemeProvider from "@kiwicom/orbit-components/lib/ThemeProvider";
import fr_Fr from "@kiwicom/orbit-components/lib/data/dictionary/fr-FR.json";
<ThemeProvider theme={{orbit: customTokens, transitions: true}} dictionary={fr_FR} className="app">
<div><Translate tKey="breadcrumbs_back" /></div>
</ThemeProvider>
it always print english text , i tried also with custom object inside themeProvider as in docs but still always refering to default language file,
Thank you
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Fallback - i18next documentation
i18next by default loads its translations from one file named translation . However, you can configure it to load from multiple files, called...
Read more >Fallback to default language when node not translated to ...
The default language is English. Mostly, the author will be translating the articles to Japanese and sometimes no translation.
Read more >[Translation] Add support for default fallback #35466 - GitHub
First, I'm not an expert on this component, so I will talk here as a user of this component. Description In my application,...
Read more >Avoid I18n Fallback to default locale - ruby on rails
My default locale is set to :at (Austria). Which I require for Route Translation. Rails server won't start without it and to be...
Read more >Unpublished translations should fallback to the original ...
If you have an node 1 that has 2 translations, EN is the default language and published, DE is not published. If you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @kouloughli-hemza 👋 The problem is mixing imports from
@kiwicom/orbit-components
and@kiwicom/orbit-components/lib/*
. webpack supports ES modules, so when you import from@kiwicom/orbit-components
, webpack automatically uses our ES build, but when you import from@kiwicom/orbit-components/lib/ThemeProvider
, thatThemeProvider
is from our CommonJS build.The solution is simply to import
ThemeProvider
like this:and make sure you always import from that source, it’s an all-or-nothing kind of thing.
In your case the problem is that CJS
ThemeProvider
and ESThemeProvider
are two different components. You’re setting the context with CJSThemeProvider
, but your ESTranslate
component is reading context from ESThemeProvider
, and because that context isn’t being set, it defaults to English.Let us know if it’s clear now 😉
Thank You ,