Files
habitica/test/client/unit/specs/libs/i18n.js
T
Matteo Pagliazzi bd46e3e195 Client: i18n (#8972)
* wip: client: i18n

* remove maxAge from cookies to get same expiration ad localStorage

* set cookies expiration to 10 years

* moment: load translations in browser, moment: only load necessary data, remove jquery, remove bluebird

* ability to change language

* fix logout

* add some requiresLogin: false to static pages

* fix tests
2017-08-22 18:26:53 +02:00

25 lines
585 B
JavaScript

import i18n from 'client/libs/i18n';
import commoni18n from 'common/script/i18n';
import Vue from 'vue';
describe('i18n plugin', () => {
before(() => {
Vue.use(i18n, {
i18nData: {
strings: {
reportBug: 'Report a Bug',
},
},
});
});
it('adds $t to Vue.prototype', () => {
expect(Vue.prototype.$t).to.be.a.function;
});
it('$t is a proxy for common/i18n.t', () => {
const result = (new Vue()).$t('reportBug');
expect(result).to.equal(commoni18n.t('reportBug'));
expect(result).to.equal('Report a Bug');
});
});