Update i18n config to support Danish

This commit is contained in:
Kim Gardner
2017-10-10 13:56:47 +01:00
parent 15f07b1360
commit f1e81575cb
2 changed files with 7 additions and 3 deletions
+4 -1
View File
@@ -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();
}
+3 -2
View File
@@ -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.