Goes back to load all translations...

This commit is contained in:
gaba
2017-05-23 12:46:53 -04:00
parent 5757682732
commit a184837ff8
3 changed files with 9 additions and 4 deletions
+7 -2
View File
@@ -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) => {
@@ -71,7 +71,7 @@ class ProfileContainer extends Component {
<hr />
<h3>t('framework.my_comments')</h3>
<h3>{t('framework.my_comments')}</h3>
{me.comments.length
? <CommentHistory comments={me.comments} asset={asset} link={link} />
: <p>{t('user_no_comment')}</p>}
+1 -1
View File
@@ -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: {