Skip to content

Commit 58182fc

Browse files
committed
Add Russian case
1 parent b3b1e94 commit 58182fc

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

frontend/src/locale/IntlProvider.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
import { createIntl, createIntlCache } from "react-intl";
22
import langEn from "./lang/en.json";
3+
import langRu from "./lang/ru.json";
34
import langList from "./lang/lang-list.json";
45

56
// first item of each array should be the language code,
67
// not the country code
78
// Remember when adding to this list, also update check-locales.js script
8-
const localeOptions = [["en", "en-US"]];
9+
const localeOptions = [["en", "en-US"], ["ru", "ru-RU"]];
910

1011
const loadMessages = (locale?: string): typeof langList & typeof langEn => {
1112
const thisLocale = locale || "en";
1213
switch (thisLocale.slice(0, 2)) {
14+
case "ru":
15+
return Object.assign({}, langList, langRu);
1316
default:
1417
return Object.assign({}, langList, langEn);
1518
}
1619
};
1720

1821
const getFlagCodeForLocale = (locale?: string) => {
1922
switch (locale) {
23+
case "ru":
24+
return "RU";
2025
default:
2126
return "EN";
2227
}

0 commit comments

Comments
 (0)