From fa625e560b223a1047ab94be2e3bcb9fd6a40954 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 19 Aug 2019 14:29:28 -0700 Subject: [PATCH] Adding russian locales. --- ui/src/components/moment-time.tsx | 1 + ui/src/i18next.ts | 2 ++ ui/src/utils.ts | 2 ++ 3 files changed, 5 insertions(+) diff --git a/ui/src/components/moment-time.tsx b/ui/src/components/moment-time.tsx index cadd4922..a8d8dcad 100644 --- a/ui/src/components/moment-time.tsx +++ b/ui/src/components/moment-time.tsx @@ -4,6 +4,7 @@ import 'moment/locale/de'; import 'moment/locale/zh-cn'; import 'moment/locale/fr'; import 'moment/locale/sv'; +import 'moment/locale/ru'; import { getMomentLanguage } from '../utils'; import { i18n } from '../i18next'; diff --git a/ui/src/i18next.ts b/ui/src/i18next.ts index 2bd5d559..2c0c5419 100644 --- a/ui/src/i18next.ts +++ b/ui/src/i18next.ts @@ -5,6 +5,7 @@ import { de } from './translations/de'; import { zh } from './translations/zh'; import { fr } from './translations/fr'; import { sv } from './translations/sv'; +import { ru } from './translations/ru'; // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66 // TODO don't forget to add moment locales for new languages. @@ -14,6 +15,7 @@ const resources = { zh, fr, sv, + ru, } function format(value: any, format: any, lng: any) { diff --git a/ui/src/utils.ts b/ui/src/utils.ts index 27dcdca3..a2e13c02 100644 --- a/ui/src/utils.ts +++ b/ui/src/utils.ts @@ -184,6 +184,8 @@ export function getMomentLanguage(): string { lang = 'fr'; } else if (lang.startsWith('de')) { lang = 'de'; + } else if (lang.startsWith('ru')) { + lang = 'ru'; } else { lang = 'en'; } -- 2.44.1