Bläddra i källkod

Add Russian case

Alexey Krainev 1 månad sedan
förälder
incheckning
58182fcbdf
1 ändrade filer med 6 tillägg och 1 borttagningar
  1. 6 1
      frontend/src/locale/IntlProvider.tsx

+ 6 - 1
frontend/src/locale/IntlProvider.tsx

@@ -1,15 +1,18 @@
 import { createIntl, createIntlCache } from "react-intl";
 import langEn from "./lang/en.json";
+import langRu from "./lang/ru.json";
 import langList from "./lang/lang-list.json";
 
 // first item of each array should be the language code,
 // not the country code
 // Remember when adding to this list, also update check-locales.js script
-const localeOptions = [["en", "en-US"]];
+const localeOptions = [["en", "en-US"], ["ru", "ru-RU"]];
 
 const loadMessages = (locale?: string): typeof langList & typeof langEn => {
 	const thisLocale = locale || "en";
 	switch (thisLocale.slice(0, 2)) {
+		case "ru":
+			return Object.assign({}, langList, langRu);
 		default:
 			return Object.assign({}, langList, langEn);
 	}
@@ -17,6 +20,8 @@ const loadMessages = (locale?: string): typeof langList & typeof langEn => {
 
 const getFlagCodeForLocale = (locale?: string) => {
 	switch (locale) {
+		case "ru":
+			return "RU";
 		default:
 			return "EN";
 	}