@sofit/view-locale 1.75.1 → 1.77.0
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 +7 -7
- package/dist/runner.js +5 -1
- package/dist/translations/common/joi.js +8 -0
- package/dist/translations/modules/leasing_measurement.d.ts +9 -1
- package/dist/translations/modules/leasing_measurement.js +9 -0
- package/lib/runner.ts +8 -1
- package/lib/translations/common/joi.ts +8 -0
- package/lib/translations/modules/leasing_measurement.ts +12 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
<testsuites name="Sofit view locale tests" tests="8" failures="0" time="
|
|
2
|
-
<testsuite name="Vehicle locale test" errors="0" failures="0" skipped="0" timestamp="2020-
|
|
3
|
-
<testcase classname="Vehicle locale test Should get translations with reach" name="Vehicle locale test Should get translations with reach" time="0.
|
|
1
|
+
<testsuites name="Sofit view locale tests" tests="8" failures="0" time="3.314">
|
|
2
|
+
<testsuite name="Vehicle locale test" errors="0" failures="0" skipped="0" timestamp="2020-02-12T20:21:22" time="2.316" tests="4">
|
|
3
|
+
<testcase classname="Vehicle locale test Should get translations with reach" name="Vehicle locale test Should get translations with reach" time="0.005">
|
|
4
4
|
</testcase>
|
|
5
5
|
<testcase classname="Vehicle locale test Should replace correctly with reach" name="Vehicle locale test Should replace correctly with reach" time="0">
|
|
6
6
|
</testcase>
|
|
@@ -9,14 +9,14 @@
|
|
|
9
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="Joi tests" errors="0" failures="0" skipped="0" timestamp="2020-
|
|
13
|
-
<testcase classname="Joi tests should return default message" name="Joi tests should return default message" time="0.
|
|
12
|
+
<testsuite name="Joi tests" errors="0" failures="0" skipped="0" timestamp="2020-02-12T20:21:22" time="2.375" 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
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="Joi tests should return translated label message" name="Joi tests should return translated label message" time="0
|
|
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="Joi tests should return translated label index" name="Joi tests should return translated label index" time="0">
|
|
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>
|
package/dist/runner.js
CHANGED
|
@@ -56,7 +56,11 @@ class Locale {
|
|
|
56
56
|
this.setJoiLabel(detail);
|
|
57
57
|
return this.reach(TRANSLATIONS.joi[detail.type], detail.context);
|
|
58
58
|
}
|
|
59
|
-
|
|
59
|
+
let errMsg = `There is no translation for joi type '${detail.type}'`;
|
|
60
|
+
if (detail.context && detail.context.key) {
|
|
61
|
+
errMsg += `. key: ${detail.context.key}`;
|
|
62
|
+
}
|
|
63
|
+
return errMsg;
|
|
60
64
|
}
|
|
61
65
|
setJoiLabel(detail) {
|
|
62
66
|
if (detail.context && (!(detail.context.key || '').startsWith('cf_'))) {
|
|
@@ -29,10 +29,18 @@ exports.joi = {
|
|
|
29
29
|
ptBR: '{{label}} precisa ser um número inteiro.',
|
|
30
30
|
es: '{{label}} debe ser un entero.'
|
|
31
31
|
},
|
|
32
|
+
'date.base': {
|
|
33
|
+
ptBR: '{{label}} precisa ser uma data válida.',
|
|
34
|
+
es: '{{label}} debe ser una fecha válida.'
|
|
35
|
+
},
|
|
32
36
|
'date.isoDate': {
|
|
33
37
|
ptBR: '{{label}} precisa ser uma data válida.',
|
|
34
38
|
es: '{{label}} debe ser una fecha válida.'
|
|
35
39
|
},
|
|
40
|
+
'date.less': {
|
|
41
|
+
ptBR: '{{label}} precisa ser anterior a {{limit}}.',
|
|
42
|
+
es: '{{label}} debe ser una fecha anterior a {{limit}}.'
|
|
43
|
+
},
|
|
36
44
|
'array.base': {
|
|
37
45
|
ptBR: '{{label}} precisa ser um array.',
|
|
38
46
|
es: '{{label}} debe ser una matriz.'
|
|
@@ -43,7 +43,11 @@ export declare const fields: {
|
|
|
43
43
|
ptBR: string;
|
|
44
44
|
es: string;
|
|
45
45
|
};
|
|
46
|
-
|
|
46
|
+
vehicle_id: {
|
|
47
|
+
ptBR: string;
|
|
48
|
+
es: string;
|
|
49
|
+
};
|
|
50
|
+
company_id: {
|
|
47
51
|
ptBR: string;
|
|
48
52
|
es: string;
|
|
49
53
|
};
|
|
@@ -51,6 +55,10 @@ export declare const fields: {
|
|
|
51
55
|
ptBR: string;
|
|
52
56
|
es: string;
|
|
53
57
|
};
|
|
58
|
+
name: {
|
|
59
|
+
ptBR: string;
|
|
60
|
+
es: string;
|
|
61
|
+
};
|
|
54
62
|
id: {
|
|
55
63
|
ptBR: string;
|
|
56
64
|
es: string;
|
|
@@ -35,6 +35,15 @@ exports.fields = Object.assign({}, entity_1.ENTITY_COMMON, { vehicle_leasing_id:
|
|
|
35
35
|
}, invoice: {
|
|
36
36
|
ptBR: 'Fatura',
|
|
37
37
|
es: 'Factura'
|
|
38
|
+
}, vehicle_id: {
|
|
39
|
+
ptBR: 'Veículo',
|
|
40
|
+
es: 'Vehículo'
|
|
41
|
+
}, company_id: {
|
|
42
|
+
ptBR: 'Empresa',
|
|
43
|
+
es: 'Empresa'
|
|
44
|
+
}, external_id: {
|
|
45
|
+
ptBR: 'Chave externa',
|
|
46
|
+
es: 'Clave extranjera'
|
|
38
47
|
} });
|
|
39
48
|
exports.messages = {
|
|
40
49
|
must_have_no_paid_measurement_when_removing: {
|
package/lib/runner.ts
CHANGED
|
@@ -87,7 +87,14 @@ export class Locale {
|
|
|
87
87
|
return this.reach(TRANSLATIONS.joi[detail.type], detail.context as IReplaces);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
let errMsg = `There is no translation for joi type '${detail.type}'`;
|
|
91
|
+
|
|
92
|
+
if (detail.context && detail.context.key) {
|
|
93
|
+
|
|
94
|
+
errMsg += `. key: ${detail.context.key}`;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return errMsg;
|
|
91
98
|
}
|
|
92
99
|
|
|
93
100
|
private setJoiLabel(detail: IValidationErrorItem) {
|
|
@@ -29,10 +29,18 @@ export const joi: ITranslation = {
|
|
|
29
29
|
ptBR: '{{label}} precisa ser um número inteiro.',
|
|
30
30
|
es: '{{label}} debe ser un entero.'
|
|
31
31
|
},
|
|
32
|
+
'date.base': {
|
|
33
|
+
ptBR: '{{label}} precisa ser uma data válida.',
|
|
34
|
+
es: '{{label}} debe ser una fecha válida.'
|
|
35
|
+
},
|
|
32
36
|
'date.isoDate': {
|
|
33
37
|
ptBR: '{{label}} precisa ser uma data válida.',
|
|
34
38
|
es: '{{label}} debe ser una fecha válida.'
|
|
35
39
|
},
|
|
40
|
+
'date.less': {
|
|
41
|
+
ptBR: '{{label}} precisa ser anterior a {{limit}}.',
|
|
42
|
+
es: '{{label}} debe ser una fecha anterior a {{limit}}.'
|
|
43
|
+
},
|
|
36
44
|
'array.base': {
|
|
37
45
|
ptBR: '{{label}} precisa ser um array.',
|
|
38
46
|
es: '{{label}} debe ser una matriz.'
|
|
@@ -46,6 +46,18 @@ export const fields = {
|
|
|
46
46
|
invoice: {
|
|
47
47
|
ptBR: 'Fatura',
|
|
48
48
|
es: 'Factura'
|
|
49
|
+
},
|
|
50
|
+
vehicle_id: {
|
|
51
|
+
ptBR: 'Veículo',
|
|
52
|
+
es: 'Vehículo'
|
|
53
|
+
},
|
|
54
|
+
company_id: {
|
|
55
|
+
ptBR: 'Empresa',
|
|
56
|
+
es: 'Empresa'
|
|
57
|
+
},
|
|
58
|
+
external_id: {
|
|
59
|
+
ptBR: 'Chave externa',
|
|
60
|
+
es: 'Clave extranjera'
|
|
49
61
|
}
|
|
50
62
|
};
|
|
51
63
|
|