File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 11import React , { useState } from 'react' ;
22import useOnclickOutside from 'react-cool-onclickoutside' ;
33import { useTranslation , useCurrency } from './app-state' ;
4+ import { config } from './config' ;
45
56import './LanguageDropdown.scss' ;
67
7- const languages = [
8- { key : 'en' , name : 'english' } ,
9- { key : 'fr' , name : 'french' } ,
10- ] ;
8+ const languages = config . supportedLocales
119
1210export const LanguageDropdown : React . FC = ( ) => {
1311 const [ isOpen , setIsOpen ] = useState ( false ) ;
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import { config } from './config';
1313
1414const languages = config . supportedLocales . map ( el => {
1515 return {
16- [ el . value ] : require ( `./locales/${ el . value } .json` ) ,
16+ [ el . key ] : require ( `./locales/${ el . key } .json` ) ,
1717 }
1818} ) . reduce ( ( result , current ) => {
1919 return Object . assign ( result , current ) ;
Original file line number Diff line number Diff line change @@ -14,10 +14,12 @@ export const config = {
1414 b2b : process . env . REACT_APP_B2B_ENABLE || false ,
1515 supportedLocales : process . env . REACT_APP_SUPPORTED_LOCALES ?. split ( ',' ) . map ( el => JSON . parse ( el ) ) || [
1616 {
17- "value" : "en"
17+ "key" : "en" ,
18+ "name" : "english"
1819 } ,
1920 {
20- "value" : "fr"
21+ "key" : "fr" ,
22+ "name" : "french"
2123 }
2224 ] ,
2325 defaultLanguage : process . env . REACT_APP_DEFAULT_LANGUAGE || "en" ,
You can’t perform that action at this time.
0 commit comments