From 99796c99cab47da4932e326c403d487bed2c92f7 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Wed, 9 Dec 2020 10:15:53 -0500 Subject: [PATCH] Adding danish, not yet translated. --- lemmy-translations | 2 +- src/shared/i18next.ts | 2 ++ src/shared/utils.ts | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lemmy-translations b/lemmy-translations index 0a30493c..39e236b6 160000 --- a/lemmy-translations +++ b/lemmy-translations @@ -1 +1 @@ -Subproject commit 0a30493c625167c9e973bfcce6d558a15c119db6 +Subproject commit 39e236b6456db40640e811001b36028f4062e8b7 diff --git a/src/shared/i18next.ts b/src/shared/i18next.ts index ea79d9c5..bcbee8d5 100644 --- a/src/shared/i18next.ts +++ b/src/shared/i18next.ts @@ -28,6 +28,7 @@ import { sq } from './translations/sq'; import { km } from './translations/km'; import { ga } from './translations/ga'; import { sr_Latn } from './translations/sr_Latn'; +import { da } from './translations/da'; // https://github.com/nimbusec-oss/inferno-i18next/blob/master/tests/T.test.js#L66 const resources = { @@ -59,6 +60,7 @@ const resources = { km, ga, sr_Latn, + da, }; function format(value: any, format: any): any { diff --git a/src/shared/utils.ts b/src/shared/utils.ts index 19f8b24c..d7948a0f 100644 --- a/src/shared/utils.ts +++ b/src/shared/utils.ts @@ -26,6 +26,7 @@ import 'moment/locale/km'; import 'moment/locale/ga'; import 'moment/locale/sr'; import 'moment/locale/ko'; +import 'moment/locale/da'; import { UserOperation, @@ -89,6 +90,7 @@ export const languages = [ { code: 'eu', name: 'Euskara' }, { code: 'eo', name: 'Esperanto' }, { code: 'es', name: 'EspaƱol' }, + { code: 'da', name: 'Dansk' }, { code: 'de', name: 'Deutsch' }, { code: 'ga', name: 'Gaeilge' }, { code: 'gl', name: 'Galego' }, @@ -427,6 +429,8 @@ export function getMomentLanguage(): string { lang = 'sr'; } else if (lang.startsWith('ko')) { lang = 'ko'; + } else if (lang.startsWith('da')) { + lang = 'da'; } else { lang = 'en'; }