From a184837ff806131338bba4d8fa9af03ed75399e1 Mon Sep 17 00:00:00 2001 From: gaba Date: Tue, 23 May 2017 12:46:53 -0400 Subject: [PATCH] Goes back to load all translations... --- client/coral-framework/services/i18n.js | 9 +++++++-- client/coral-settings/containers/ProfileContainer.js | 2 +- plugins/coral-plugin-like/client/index.js | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/client/coral-framework/services/i18n.js b/client/coral-framework/services/i18n.js index cf26195dc..e479a9e10 100644 --- a/client/coral-framework/services/i18n.js +++ b/client/coral-framework/services/i18n.js @@ -8,11 +8,16 @@ const esTA = require('../../../node_modules/timeago.js/locales/es'); const defaultLanguage = 'en'; +const locales = Object.assign( + require('json-loader!yaml-loader!../locales/en.yml'), + require('json-loader!yaml-loader!../locales/es.yml') +); + let translations = {}; let timeagoInstance; -const fetchTranslations = (locale) => { - translations = require(`json-loader!yaml-loader!../locales/${locale}.yml`)[locale]; +const fetchTranslations = (lang) => { + translations = locales[lang]; }; const setLocale = (locale) => { diff --git a/client/coral-settings/containers/ProfileContainer.js b/client/coral-settings/containers/ProfileContainer.js index 40e893087..d88594acd 100644 --- a/client/coral-settings/containers/ProfileContainer.js +++ b/client/coral-settings/containers/ProfileContainer.js @@ -71,7 +71,7 @@ class ProfileContainer extends Component {
-

t('framework.my_comments')

+

{t('framework.my_comments')}

{me.comments.length ? :

{t('user_no_comment')}

} diff --git a/plugins/coral-plugin-like/client/index.js b/plugins/coral-plugin-like/client/index.js index f68599db3..a67d3eb84 100644 --- a/plugins/coral-plugin-like/client/index.js +++ b/plugins/coral-plugin-like/client/index.js @@ -3,7 +3,7 @@ import LikeButton from './containers/LikeButton'; import translations from './translations.json'; import {loadTranslations} from '/coral-framework/services/i18n'; -Promise.all([loadTranslations(translations)]); +loadTranslations(translations); export default { slots: {