mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-12-03 17:51:20 +00:00
Adding russian locales.
This commit is contained in:
parent
266597a6a9
commit
9c6c490b20
3 changed files with 5 additions and 0 deletions
|
@ -4,6 +4,7 @@ import 'moment/locale/de';
|
||||||
import 'moment/locale/zh-cn';
|
import 'moment/locale/zh-cn';
|
||||||
import 'moment/locale/fr';
|
import 'moment/locale/fr';
|
||||||
import 'moment/locale/sv';
|
import 'moment/locale/sv';
|
||||||
|
import 'moment/locale/ru';
|
||||||
import { getMomentLanguage } from '../utils';
|
import { getMomentLanguage } from '../utils';
|
||||||
import { i18n } from '../i18next';
|
import { i18n } from '../i18next';
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ import { de } from './translations/de';
|
||||||
import { zh } from './translations/zh';
|
import { zh } from './translations/zh';
|
||||||
import { fr } from './translations/fr';
|
import { fr } from './translations/fr';
|
||||||
import { sv } from './translations/sv';
|
import { sv } from './translations/sv';
|
||||||
|
import { ru } from './translations/ru';
|
||||||
|
|
||||||
// https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66
|
// 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.
|
// TODO don't forget to add moment locales for new languages.
|
||||||
|
@ -14,6 +15,7 @@ const resources = {
|
||||||
zh,
|
zh,
|
||||||
fr,
|
fr,
|
||||||
sv,
|
sv,
|
||||||
|
ru,
|
||||||
}
|
}
|
||||||
|
|
||||||
function format(value: any, format: any, lng: any) {
|
function format(value: any, format: any, lng: any) {
|
||||||
|
|
|
@ -184,6 +184,8 @@ export function getMomentLanguage(): string {
|
||||||
lang = 'fr';
|
lang = 'fr';
|
||||||
} else if (lang.startsWith('de')) {
|
} else if (lang.startsWith('de')) {
|
||||||
lang = 'de';
|
lang = 'de';
|
||||||
|
} else if (lang.startsWith('ru')) {
|
||||||
|
lang = 'ru';
|
||||||
} else {
|
} else {
|
||||||
lang = 'en';
|
lang = 'en';
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue