@sofit/view-locale 1.75.1 → 1.76.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.
@@ -1,6 +1,6 @@
1
- <testsuites name="Sofit view locale tests" tests="8" failures="0" time="2.811">
2
- <testsuite name="Vehicle locale test" errors="0" failures="0" skipped="0" timestamp="2020-01-21T12:21:29" time="1.991" tests="4">
3
- <testcase classname="Vehicle locale test Should get translations with reach" name="Vehicle locale test Should get translations with reach" time="0.003">
1
+ <testsuites name="Sofit view locale tests" tests="8" failures="0" time="3.425">
2
+ <testsuite name="Vehicle locale test" errors="0" failures="0" skipped="0" timestamp="2020-02-05T15:36:54" time="2.399" tests="4">
3
+ <testcase classname="Vehicle locale test Should get translations with reach" name="Vehicle locale test Should get translations with reach" time="0.004">
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,8 +9,8 @@
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-01-21T12:21:29" time="2.006" tests="4">
13
- <testcase classname="Joi tests should return default message" name="Joi tests should return default message" time="0.005">
12
+ <testsuite name="Joi tests" errors="0" failures="0" skipped="0" timestamp="2020-02-05T15:36:54" time="2.412" 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>
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
- return `There is no translation for joi type '${detail.type}'`;
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_'))) {
@@ -43,7 +43,11 @@ export declare const fields: {
43
43
  ptBR: string;
44
44
  es: string;
45
45
  };
46
- name: {
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
- return `There is no translation for joi type '${detail.type}'`;
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) {
@@ -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
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sofit/view-locale",
3
- "version": "1.75.1",
3
+ "version": "1.76.0",
4
4
  "description": "Traduções do Sofit View",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",