Use new translation service

This commit is contained in:
Chi Vinh Le
2017-05-29 22:45:56 +07:00
parent c314054143
commit 04ef1c5be5
+2 -4
View File
@@ -7,9 +7,7 @@ import isEmpty from 'lodash/isEmpty';
import {getMutationOptions, resolveFragments} from 'coral-framework/services/graphqlRegistry';
import {store} from 'coral-framework/services/store';
import {getDefinitionName, getResponseErrors} from '../utils';
import I18n from 'coral-framework/modules/i18n/i18n';
import translations from 'coral-framework/translations.json';
const lang = new I18n(translations);
import t from 'coral-framework/services/i18n';
class ResponseErrors extends Error {
constructor(errors) {
@@ -24,7 +22,7 @@ class ResponseError {
}
translate(...args) {
return lang.t(`error.${this.translation_key}`, ...args);
return t(`error.${this.translation_key}`, ...args);
}
}