mirror of
https://github.com/wassname/talk.git
synced 2026-08-12 12:30:39 +08:00
Goes back to load all translations...
This commit is contained in:
@@ -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>}
|
||||
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user