Skip to content

Commit 0618b68

Browse files
yurii-khovzunYurii Khovzun
andauthored
fix MT-5109 (#79)
Co-authored-by: Yurii Khovzun <yurii.khovzun@bitcom.systems>
1 parent 51b7b61 commit 0618b68

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

src/LanguageDropdown.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import React, { useState } from 'react';
22
import useOnclickOutside from 'react-cool-onclickoutside';
33
import { useTranslation, useCurrency } from './app-state';
4+
import { config } from './config';
45

56
import './LanguageDropdown.scss';
67

7-
const languages = [
8-
{ key: 'en', name: 'english' },
9-
{ key: 'fr', name: 'french' },
10-
];
8+
const languages = config.supportedLocales
119

1210
export const LanguageDropdown: React.FC = () => {
1311
const [isOpen, setIsOpen] = useState(false);

src/app-state.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { config } from './config';
1313

1414
const 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);

src/config.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff 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",

0 commit comments

Comments
 (0)