mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
Fix configuration and alphabetize languages
This commit is contained in:
@@ -3,20 +3,21 @@ import has from 'lodash/has';
|
||||
import get from 'lodash/get';
|
||||
import merge from 'lodash/merge';
|
||||
|
||||
import esTA from 'timeago.js/locales/ta'
|
||||
import frTA from 'timeago.js/locales/ta';
|
||||
import pt_BRTA from 'timeago.js/locales/ta';
|
||||
import da_DKTA from 'timeago.js/locales/ta';
|
||||
import daTA from 'timeago.js/locales/da';
|
||||
import esTA from 'timeago.js/locales/es'
|
||||
import frTA from 'timeago.js/locales/fr`';
|
||||
import pt_BRTA from 'timeago.js/locales/pt_BR';
|
||||
|
||||
import en from '../../../locales/en.yml';
|
||||
import da from '../../../locales/da.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, ...da_DK};
|
||||
const translations = {...en, ...da, ...es, ...fr, ...pt_BR};
|
||||
|
||||
let lang;
|
||||
let timeagoInstance;
|
||||
@@ -46,9 +47,9 @@ function init() {
|
||||
}
|
||||
|
||||
ta.register('es', esTA);
|
||||
ta.register('da', da);
|
||||
ta.register('fr', frTA);
|
||||
ta.register('pt_BR', pt_BRTA);
|
||||
ta.register('da_DK', da_DK);
|
||||
timeagoInstance = ta();
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -3,18 +3,18 @@ const get = require('lodash/get');
|
||||
|
||||
const yaml = require('yamljs');
|
||||
|
||||
const da = yaml.load('./locales/da.yml');
|
||||
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', 'da_DK'];
|
||||
const languages = ['en', 'da', 'es', 'fr', 'pt_BR'];
|
||||
|
||||
const translations = Object.assign(en, es, fr, pt_BR, da_DK);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user