From f1e81575cb649666a70be609cd842826b4f7adb1 Mon Sep 17 00:00:00 2001 From: Kim Gardner Date: Tue, 10 Oct 2017 13:56:47 +0100 Subject: [PATCH] Update i18n config to support Danish --- client/coral-framework/services/i18n.js | 5 ++++- services/i18n.js | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/client/coral-framework/services/i18n.js b/client/coral-framework/services/i18n.js index 87e375853..0dc424566 100644 --- a/client/coral-framework/services/i18n.js +++ b/client/coral-framework/services/i18n.js @@ -6,15 +6,17 @@ import merge from 'lodash/merge'; import esTA from '../../../node_modules/timeago.js/locales/es'; import frTA from '../../../node_modules/timeago.js/locales/fr'; import pt_BRTA from '../../../node_modules/timeago.js/locales/pt_BR'; +import da_DK from '../../../node_modules/timeago.js/locales/da_DK'; import en from '../../../locales/en.yml'; import es from '../../../locales/es.yml'; import fr from '../../../locales/fr.yml'; import pt_BR from '../../../locales/pt_BR.yml'; +import da_DK from '../../../locales/da_DK.yml'; // Translations are happening at https://translate.lingohub.com/the-coral-project/dashboard const defaultLanguage = process.env.TALK_DEFAULT_LANG; -const translations = {...en, ...es, ...fr, ...pt_BR}; +const translations = {...en, ...es, ...fr, ...pt_BR, ...da_DK}; let lang; let timeagoInstance; @@ -46,6 +48,7 @@ function init() { ta.register('es', esTA); ta.register('fr', frTA); ta.register('pt_BR', pt_BRTA); + ta.register('da_DK', da_DK); timeagoInstance = ta(); } diff --git a/services/i18n.js b/services/i18n.js index 372ae5df2..a1e191d94 100644 --- a/services/i18n.js +++ b/services/i18n.js @@ -7,15 +7,16 @@ const es = yaml.load('./locales/es.yml'); const en = yaml.load('./locales/en.yml'); const fr = yaml.load('./locales/fr.yml'); const pt_BR = yaml.load('./locales/pt_BR.yml'); +const da_DK = yaml.load('./locales/da_DK.yml'); const accepts = require('accepts'); // default language let defaultLanguage = 'en'; let language = defaultLanguage; -const languages = ['en', 'es', 'fr', 'pt_BR']; +const languages = ['en', 'es', 'fr', 'pt_BR', 'da_DK']; -const translations = Object.assign(en, es, fr, pt_BR); +const translations = Object.assign(en, es, fr, pt_BR, da_DK); /** * Exposes a service object to allow translations.