File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
netflix-create-react-vite-app Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change 99 . use ( HttpApi )
1010 . init ( {
1111 supportedLngs : [ 'en' , 'nl' ] ,
12- lng : 'en' ,
1312 fallbackLng : 'en' ,
1413 interpolation : {
1514 escapeValue : false , // not needed for react as it escapes by default
1615 } ,
1716 detection : {
1817 order : [
18+ 'navigator' ,
1919 'querystring' ,
2020 'cookie' ,
2121 'localStorage' ,
2222 'sessionStorage' ,
23- 'navigator' ,
2423 'htmlTag' ,
2524 'path' ,
2625 'subdomain' ,
2726 ] ,
28- caches : [ 'cookie' ] ,
27+ caches : [ 'localStorage' , 'cookie' ] ,
28+ lookupLocalStorage : 'i18nextLng' ,
29+ lookupCookie : 'i18nextLng' ,
30+ convertDetectedLanguage : ( lng ) => {
31+ // Map language variants to supported languages
32+ if ( lng && lng . startsWith ( 'nl' ) ) return 'nl' ;
33+ if ( lng && lng . startsWith ( 'en' ) ) return 'en' ;
34+ return lng ;
35+ } ,
2936 } ,
3037 backend : {
3138 loadPath : '/locales/{{lng}}/translation.json' ,
You can’t perform that action at this time.
0 commit comments