refactor(v2): simplify code by removing wip i18n & translation (#1431)

* refactor(v2): remove i18n & versioning + cleaner code

* totally remove i18n and versioning from plugin
This commit is contained in:
Endi 2019-05-02 17:24:47 +07:00 committed by GitHub
parent 0813920349
commit 373d17ee72
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
123 changed files with 170 additions and 4162 deletions

View file

@ -113,7 +113,7 @@ describe('load utils', () => {
test('idx', () => {
const a = {};
const b = {hello: 'world'};
const env = {
const obj = {
translation: {
enabled: true,
enabledLanguages: [
@ -139,13 +139,13 @@ describe('load utils', () => {
expect(idx(a, [('b', 'c')])).toBeUndefined();
expect(idx(b, ['hello'])).toEqual('world');
expect(idx(b, 'hello')).toEqual('world');
expect(idx(env, 'typo')).toBeUndefined();
expect(idx(env, 'versioning')).toEqual({
expect(idx(obj, 'typo')).toBeUndefined();
expect(idx(obj, 'versioning')).toEqual({
enabled: false,
versions: [],
});
expect(idx(env, ['translation', 'enabled'])).toEqual(true);
expect(idx(env, ['translation', variable]).map(lang => lang.tag)).toEqual([
expect(idx(obj, ['translation', 'enabled'])).toEqual(true);
expect(idx(obj, ['translation', variable]).map(lang => lang.tag)).toEqual([
'en',
'ja',
]);