@sofit/view-locale 0.3.1 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/coverage/jest/results.xml +11 -11
- package/dist/translations/common/auth.d.ts +6 -0
- package/dist/translations/common/auth.js +8 -0
- package/dist/translations/common/entity.d.ts +10 -0
- package/dist/translations/{modules/gate/gate.js → common/entity.js} +5 -1
- package/dist/translations/common/joi.js +4 -4
- package/dist/translations/index.d.ts +5 -3
- package/dist/translations/index.js +15 -6
- package/dist/translations/modules/{company/company.d.ts → company.d.ts} +8 -8
- package/dist/translations/modules/{company/company.js → company.js} +16 -38
- package/dist/translations/modules/gate.d.ts +10 -0
- package/dist/translations/modules/gate.js +4 -0
- package/dist/translations/modules/warehouse.d.ts +24 -0
- package/dist/translations/modules/warehouse.js +16 -0
- package/lib/tests/basic.spec.ts +4 -4
- package/lib/tests/joi.spec.ts +8 -8
- package/lib/translations/common/auth.ts +6 -0
- package/lib/translations/common/entity.ts +10 -0
- package/lib/translations/common/joi.ts +4 -4
- package/lib/translations/index.ts +12 -3
- package/lib/translations/modules/{company/company.ts → company.ts} +4 -9
- package/lib/translations/modules/gate.ts +5 -0
- package/lib/translations/modules/warehouse.ts +20 -0
- package/package.json +1 -1
- package/dist/translations/common/buttons.d.ts +0 -2
- package/dist/translations/common/buttons.js +0 -8
- package/dist/translations/modules/gate/gate.d.ts +0 -2
- package/lib/translations/common/buttons.ts +0 -8
- package/lib/translations/modules/gate/gate.ts +0 -8
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
<testsuites name="Sofit view locale tests" tests="8" failures="0" time="2.
|
|
2
|
-
<testsuite name="
|
|
3
|
-
<testcase classname="
|
|
1
|
+
<testsuites name="Sofit view locale tests" tests="8" failures="0" time="2.783">
|
|
2
|
+
<testsuite name="Vehicle locale test" errors="0" failures="0" skipped="0" timestamp="2018-08-23T21:20:48" time="1.61" tests="4">
|
|
3
|
+
<testcase classname="Vehicle locale test Should get translations with reach" name="Vehicle locale test Should get translations with reach" time="0.006">
|
|
4
4
|
</testcase>
|
|
5
|
-
<testcase classname="
|
|
5
|
+
<testcase classname="Vehicle locale test Should replace correctly with reach" name="Vehicle locale test Should replace correctly with reach" time="0.001">
|
|
6
6
|
</testcase>
|
|
7
|
-
<testcase classname="
|
|
7
|
+
<testcase classname="Vehicle locale test Should get translations with raw" name="Vehicle locale test Should get translations with raw" time="0.001">
|
|
8
8
|
</testcase>
|
|
9
|
-
<testcase classname="
|
|
9
|
+
<testcase classname="Vehicle locale test Should replace correctly with raw" name="Vehicle locale test Should replace correctly with raw" time="0">
|
|
10
10
|
</testcase>
|
|
11
11
|
</testsuite>
|
|
12
|
-
<testsuite name="
|
|
13
|
-
<testcase classname="
|
|
12
|
+
<testsuite name="Joi tests" errors="0" failures="0" skipped="0" timestamp="2018-08-23T21:20:48" time="1.593" tests="4">
|
|
13
|
+
<testcase classname="Joi tests should return default message" name="Joi tests should return default message" time="0.006">
|
|
14
14
|
</testcase>
|
|
15
|
-
<testcase classname="
|
|
15
|
+
<testcase classname="Joi tests should return non label message" name="Joi tests should return non label message" time="0.001">
|
|
16
16
|
</testcase>
|
|
17
|
-
<testcase classname="
|
|
17
|
+
<testcase classname="Joi tests should return translated label message" name="Joi tests should return translated label message" time="0">
|
|
18
18
|
</testcase>
|
|
19
|
-
<testcase classname="
|
|
19
|
+
<testcase classname="Joi tests should return translated label index" name="Joi tests should return translated label index" time="0.001">
|
|
20
20
|
</testcase>
|
|
21
21
|
</testsuite>
|
|
22
22
|
</testsuites>
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.messages = {
|
|
4
|
+
forbidden: {
|
|
5
|
+
ptBR: 'Você não tem permissão para acessar essa página.',
|
|
6
|
+
es: 'Usted quiso decir Finally Usted no tiene permiso para acceder a esa página. ¿De-Para?'
|
|
7
|
+
}
|
|
8
|
+
};
|
|
@@ -6,16 +6,16 @@ exports.joi = {
|
|
|
6
6
|
es: '{{index}}er valor de {{path}}'
|
|
7
7
|
},
|
|
8
8
|
'string.base': {
|
|
9
|
-
ptBR: '{{label}} precisa ser
|
|
10
|
-
es: '{{label}} debe se
|
|
9
|
+
ptBR: '{{label}} precisa ser do tipo texto.',
|
|
10
|
+
es: '{{label}} debe se del tipo texto.'
|
|
11
11
|
},
|
|
12
12
|
'string.email': {
|
|
13
13
|
ptBR: '{{label}} precisa ser um email válido.',
|
|
14
14
|
es: '{{label}}'
|
|
15
15
|
},
|
|
16
16
|
'number.base': {
|
|
17
|
-
ptBR: '{{label}} precisa ser numérico.',
|
|
18
|
-
es: '{{label}} debe ser numérico.'
|
|
17
|
+
ptBR: '{{label}} precisa ser do tipo numérico.',
|
|
18
|
+
es: '{{label}} debe ser del tipo numérico.'
|
|
19
19
|
},
|
|
20
20
|
'number.min': {
|
|
21
21
|
ptBR: '{{label}} precisa ter no mínimo {{limit}}.',
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as auth from './common/auth';
|
|
2
|
+
import * as company from './modules/company';
|
|
3
|
+
import * as gate from './modules/gate';
|
|
4
|
+
import * as warehouse from './modules/warehouse';
|
|
3
5
|
export { joi } from './common/joi';
|
|
4
6
|
export { databaseErrors } from './common/database-errors';
|
|
5
|
-
export { company }
|
|
7
|
+
export { auth, gate, company, warehouse };
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
3
|
+
if (mod && mod.__esModule) return mod;
|
|
4
|
+
var result = {};
|
|
5
|
+
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
|
6
|
+
result["default"] = mod;
|
|
7
|
+
return result;
|
|
8
|
+
};
|
|
2
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
exports.
|
|
5
|
-
|
|
6
|
-
exports.
|
|
10
|
+
const auth = __importStar(require("./common/auth"));
|
|
11
|
+
exports.auth = auth;
|
|
12
|
+
const company = __importStar(require("./modules/company"));
|
|
13
|
+
exports.company = company;
|
|
14
|
+
const gate = __importStar(require("./modules/gate"));
|
|
15
|
+
exports.gate = gate;
|
|
16
|
+
const warehouse = __importStar(require("./modules/warehouse"));
|
|
17
|
+
exports.warehouse = warehouse;
|
|
7
18
|
var joi_1 = require("./common/joi");
|
|
8
19
|
exports.joi = joi_1.joi;
|
|
9
20
|
var database_errors_1 = require("./common/database-errors");
|
|
10
21
|
exports.databaseErrors = database_errors_1.databaseErrors;
|
|
11
|
-
var company_1 = require("./modules/company/company");
|
|
12
|
-
exports.company = company_1.company;
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
export declare const
|
|
2
|
-
name: {
|
|
3
|
-
ptBR: string;
|
|
4
|
-
es: string;
|
|
5
|
-
};
|
|
1
|
+
export declare const fields: {
|
|
6
2
|
cnpj: {
|
|
7
3
|
ptBR: string;
|
|
8
4
|
es: string;
|
|
@@ -51,15 +47,19 @@ export declare const company: {
|
|
|
51
47
|
ptBR: string;
|
|
52
48
|
es: string;
|
|
53
49
|
};
|
|
54
|
-
|
|
50
|
+
alert_emails: {
|
|
55
51
|
ptBR: string;
|
|
56
52
|
es: string;
|
|
57
53
|
};
|
|
58
|
-
|
|
54
|
+
alert_users: {
|
|
59
55
|
ptBR: string;
|
|
60
56
|
es: string;
|
|
61
57
|
};
|
|
62
|
-
|
|
58
|
+
name: {
|
|
59
|
+
ptBR: string;
|
|
60
|
+
es: string;
|
|
61
|
+
};
|
|
62
|
+
external_id: {
|
|
63
63
|
ptBR: string;
|
|
64
64
|
es: string;
|
|
65
65
|
};
|
|
@@ -1,68 +1,46 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
ptBR: 'Nome',
|
|
6
|
-
es: 'Nombre'
|
|
7
|
-
},
|
|
8
|
-
cnpj: {
|
|
3
|
+
const entity_1 = require("../common/entity");
|
|
4
|
+
exports.fields = Object.assign({}, entity_1.ENTITY_COMMON, { cnpj: {
|
|
9
5
|
ptBR: 'CNPJ/CPF',
|
|
10
6
|
es: 'CNPJ/CPF'
|
|
11
|
-
},
|
|
12
|
-
address: {
|
|
7
|
+
}, address: {
|
|
13
8
|
ptBR: 'Endereço',
|
|
14
9
|
es: 'Dirección'
|
|
15
|
-
},
|
|
16
|
-
address_num: {
|
|
10
|
+
}, address_num: {
|
|
17
11
|
ptBR: 'Nº',
|
|
18
12
|
es: 'Nº'
|
|
19
|
-
},
|
|
20
|
-
address_neighborhood: {
|
|
13
|
+
}, address_neighborhood: {
|
|
21
14
|
ptBR: 'Bairro',
|
|
22
15
|
es: 'Bario'
|
|
23
|
-
},
|
|
24
|
-
address_state_id: {
|
|
16
|
+
}, address_state_id: {
|
|
25
17
|
ptBR: 'UF',
|
|
26
18
|
es: 'Provincia'
|
|
27
|
-
},
|
|
28
|
-
address_city_id: {
|
|
19
|
+
}, address_city_id: {
|
|
29
20
|
ptBR: 'Cidade',
|
|
30
21
|
es: 'Ciudad'
|
|
31
|
-
},
|
|
32
|
-
address_complementary: {
|
|
22
|
+
}, address_complementary: {
|
|
33
23
|
ptBR: 'Complemento',
|
|
34
24
|
es: 'Complemento'
|
|
35
|
-
},
|
|
36
|
-
postal_code: {
|
|
25
|
+
}, postal_code: {
|
|
37
26
|
ptBR: 'CEP',
|
|
38
27
|
es: 'Codico postal'
|
|
39
|
-
},
|
|
40
|
-
responsible: {
|
|
28
|
+
}, responsible: {
|
|
41
29
|
ptBR: 'Responsável',
|
|
42
30
|
es: 'Responsable'
|
|
43
|
-
},
|
|
44
|
-
cnae: {
|
|
31
|
+
}, cnae: {
|
|
45
32
|
ptBR: 'CNAE',
|
|
46
33
|
es: 'CNAE'
|
|
47
|
-
},
|
|
48
|
-
cnae_description: {
|
|
34
|
+
}, cnae_description: {
|
|
49
35
|
ptBR: 'Descrição do CNAE',
|
|
50
36
|
es: 'Descrición del CNAE'
|
|
51
|
-
},
|
|
52
|
-
secondary_cnae: {
|
|
37
|
+
}, secondary_cnae: {
|
|
53
38
|
ptBR: 'CNAE Secundário',
|
|
54
39
|
es: 'CNAE Segundario'
|
|
55
|
-
},
|
|
56
|
-
external_id: {
|
|
57
|
-
ptBR: 'Chave externa',
|
|
58
|
-
es: 'Clave externa'
|
|
59
|
-
},
|
|
60
|
-
alert_emails: {
|
|
40
|
+
}, alert_emails: {
|
|
61
41
|
ptBR: 'Emails para recebimento de alerta',
|
|
62
42
|
es: 'Emails para recebimiento de alerta'
|
|
63
|
-
},
|
|
64
|
-
alert_users: {
|
|
43
|
+
}, alert_users: {
|
|
65
44
|
ptBR: 'Usuários para recebimento de alertas',
|
|
66
45
|
es: 'Usuarios para recebimento de alertas'
|
|
67
|
-
}
|
|
68
|
-
};
|
|
46
|
+
} });
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare const fields: {
|
|
2
|
+
subsidiary_id: {
|
|
3
|
+
ptBR: string;
|
|
4
|
+
es: string;
|
|
5
|
+
};
|
|
6
|
+
active: {
|
|
7
|
+
ptBR: string;
|
|
8
|
+
es: string;
|
|
9
|
+
};
|
|
10
|
+
name: {
|
|
11
|
+
ptBR: string;
|
|
12
|
+
es: string;
|
|
13
|
+
};
|
|
14
|
+
external_id: {
|
|
15
|
+
ptBR: string;
|
|
16
|
+
es: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
export declare const messages: {
|
|
20
|
+
cant_be_disabled: {
|
|
21
|
+
ptBR: string;
|
|
22
|
+
es: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const entity_1 = require("../common/entity");
|
|
4
|
+
exports.fields = Object.assign({}, entity_1.ENTITY_COMMON, { subsidiary_id: {
|
|
5
|
+
ptBR: 'Filial',
|
|
6
|
+
es: 'Filial'
|
|
7
|
+
}, active: {
|
|
8
|
+
ptBR: 'Ativo',
|
|
9
|
+
es: 'Activo'
|
|
10
|
+
} });
|
|
11
|
+
exports.messages = {
|
|
12
|
+
cant_be_disabled: {
|
|
13
|
+
ptBR: 'O depósito ainda contém itens e não pode ser desativado!',
|
|
14
|
+
es: 'El depósito todavía contiene elementos y no se puede deshabilitar!'
|
|
15
|
+
}
|
|
16
|
+
};
|
package/lib/tests/basic.spec.ts
CHANGED
|
@@ -7,10 +7,10 @@ describe('Vehicle locale test', () => {
|
|
|
7
7
|
|
|
8
8
|
it('Should get translations with reach', () => {
|
|
9
9
|
|
|
10
|
-
expect(localeptBR.reach(i18n.gate.name))
|
|
11
|
-
.toEqual(i18n.gate.name.ptBR);
|
|
12
|
-
expect(localeES.reach(i18n.gate.name))
|
|
13
|
-
.toEqual(i18n.gate.name.es);
|
|
10
|
+
expect(localeptBR.reach(i18n.gate.fields.name))
|
|
11
|
+
.toEqual(i18n.gate.fields.name.ptBR);
|
|
12
|
+
expect(localeES.reach(i18n.gate.fields.name))
|
|
13
|
+
.toEqual(i18n.gate.fields.name.es);
|
|
14
14
|
});
|
|
15
15
|
|
|
16
16
|
it('Should replace correctly with reach', () => {
|
package/lib/tests/joi.spec.ts
CHANGED
|
@@ -25,14 +25,14 @@ describe('Joi tests', () => {
|
|
|
25
25
|
key: 'cf_1',
|
|
26
26
|
label: 'mararaia'
|
|
27
27
|
}
|
|
28
|
-
} as any)).toEqual('mararaia precisa ser
|
|
28
|
+
} as any)).toEqual('mararaia precisa ser do tipo texto.');
|
|
29
29
|
expect(localeptES.joi({
|
|
30
30
|
type: 'string.base',
|
|
31
31
|
context: {
|
|
32
32
|
key: 'cf_1',
|
|
33
33
|
label: 'mararaia'
|
|
34
34
|
}
|
|
35
|
-
} as any)).toEqual('mararaia debe se
|
|
35
|
+
} as any)).toEqual('mararaia debe se del tipo texto.');
|
|
36
36
|
});
|
|
37
37
|
|
|
38
38
|
it('should return translated label message', () => {
|
|
@@ -41,16 +41,16 @@ describe('Joi tests', () => {
|
|
|
41
41
|
type: 'string.base',
|
|
42
42
|
context: {
|
|
43
43
|
key: 'otra',
|
|
44
|
-
label: 'gate.name'
|
|
44
|
+
label: 'gate.fields.name'
|
|
45
45
|
}
|
|
46
|
-
} as any)).toEqual('Nome precisa ser
|
|
46
|
+
} as any)).toEqual('Nome precisa ser do tipo texto.');
|
|
47
47
|
expect(localeptES.joi({
|
|
48
48
|
type: 'string.base',
|
|
49
49
|
context: {
|
|
50
50
|
key: 'otra',
|
|
51
|
-
label: 'gate.name'
|
|
51
|
+
label: 'gate.fields.name'
|
|
52
52
|
}
|
|
53
|
-
} as any)).toEqual('Nombre debe se
|
|
53
|
+
} as any)).toEqual('Nombre debe se del tipo texto.');
|
|
54
54
|
});
|
|
55
55
|
|
|
56
56
|
it('should return translated label index', () => {
|
|
@@ -62,7 +62,7 @@ describe('Joi tests', () => {
|
|
|
62
62
|
key: 0,
|
|
63
63
|
label: 0
|
|
64
64
|
}
|
|
65
|
-
} as any)).toEqual('1º valor de path precisa ser
|
|
65
|
+
} as any)).toEqual('1º valor de path precisa ser do tipo texto.');
|
|
66
66
|
expect(localeptES.joi({
|
|
67
67
|
type: 'string.base',
|
|
68
68
|
path: ['path'],
|
|
@@ -70,6 +70,6 @@ describe('Joi tests', () => {
|
|
|
70
70
|
key: 0,
|
|
71
71
|
label: 0
|
|
72
72
|
}
|
|
73
|
-
} as any)).toEqual('1er valor de path debe se
|
|
73
|
+
} as any)).toEqual('1er valor de path debe se del tipo texto.');
|
|
74
74
|
});
|
|
75
75
|
});
|
|
@@ -6,16 +6,16 @@ export const joi: ITranslation = {
|
|
|
6
6
|
es: '{{index}}er valor de {{path}}'
|
|
7
7
|
},
|
|
8
8
|
'string.base': {
|
|
9
|
-
ptBR: '{{label}} precisa ser
|
|
10
|
-
es: '{{label}} debe se
|
|
9
|
+
ptBR: '{{label}} precisa ser do tipo texto.',
|
|
10
|
+
es: '{{label}} debe se del tipo texto.'
|
|
11
11
|
},
|
|
12
12
|
'string.email': {
|
|
13
13
|
ptBR: '{{label}} precisa ser um email válido.',
|
|
14
14
|
es: '{{label}}'
|
|
15
15
|
},
|
|
16
16
|
'number.base': {
|
|
17
|
-
ptBR: '{{label}} precisa ser numérico.',
|
|
18
|
-
es: '{{label}} debe ser numérico.'
|
|
17
|
+
ptBR: '{{label}} precisa ser do tipo numérico.',
|
|
18
|
+
es: '{{label}} debe ser del tipo numérico.'
|
|
19
19
|
},
|
|
20
20
|
'number.min': {
|
|
21
21
|
ptBR: '{{label}} precisa ter no mínimo {{limit}}.',
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import * as auth from './common/auth';
|
|
2
|
+
import * as company from './modules/company';
|
|
3
|
+
import * as gate from './modules/gate';
|
|
4
|
+
import * as warehouse from './modules/warehouse';
|
|
5
|
+
|
|
3
6
|
export { joi } from './common/joi';
|
|
4
7
|
export { databaseErrors } from './common/database-errors';
|
|
5
|
-
|
|
8
|
+
|
|
9
|
+
export {
|
|
10
|
+
auth,
|
|
11
|
+
gate,
|
|
12
|
+
company,
|
|
13
|
+
warehouse
|
|
14
|
+
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
},
|
|
1
|
+
import { ENTITY_COMMON } from '../common/entity';
|
|
2
|
+
|
|
3
|
+
export const fields = {
|
|
4
|
+
...ENTITY_COMMON,
|
|
6
5
|
cnpj: {
|
|
7
6
|
ptBR: 'CNPJ/CPF',
|
|
8
7
|
es: 'CNPJ/CPF'
|
|
@@ -51,10 +50,6 @@ export const company = {
|
|
|
51
50
|
ptBR: 'CNAE Secundário',
|
|
52
51
|
es: 'CNAE Segundario'
|
|
53
52
|
},
|
|
54
|
-
external_id: {
|
|
55
|
-
ptBR: 'Chave externa',
|
|
56
|
-
es: 'Clave externa'
|
|
57
|
-
},
|
|
58
53
|
alert_emails: {
|
|
59
54
|
ptBR: 'Emails para recebimento de alerta',
|
|
60
55
|
es: 'Emails para recebimiento de alerta'
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ENTITY_COMMON } from '../common/entity';
|
|
2
|
+
|
|
3
|
+
export const fields = {
|
|
4
|
+
...ENTITY_COMMON,
|
|
5
|
+
subsidiary_id: {
|
|
6
|
+
ptBR: 'Filial',
|
|
7
|
+
es: 'Filial'
|
|
8
|
+
},
|
|
9
|
+
active: {
|
|
10
|
+
ptBR: 'Ativo',
|
|
11
|
+
es: 'Activo'
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const messages = {
|
|
16
|
+
cant_be_disabled: {
|
|
17
|
+
ptBR: 'O depósito ainda contém itens e não pode ser desativado!',
|
|
18
|
+
es: 'El depósito todavía contiene elementos y no se puede deshabilitar!'
|
|
19
|
+
}
|
|
20
|
+
};
|
package/package.json
CHANGED