@sofit/view-locale 1.91.0 → 1.93.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,15 +1,15 @@
1
- <testsuites name="Sofit view locale tests" tests="8" failures="0" time="2.852">
2
- <testsuite name="Vehicle locale test" errors="0" failures="0" skipped="0" timestamp="2020-04-22T20:54:25" time="2.097" tests="4">
1
+ <testsuites name="Sofit view locale tests" tests="8" failures="0" time="2.538">
2
+ <testsuite name="Vehicle locale test" errors="0" failures="0" skipped="0" timestamp="2020-05-15T19:49:31" time="1.838" tests="4">
3
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>
7
- <testcase classname="Vehicle locale test Should get translations with raw" name="Vehicle locale test Should get translations with raw" time="0">
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
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-04-22T20:54:25" time="2.153" tests="4">
12
+ <testsuite name="Joi tests" errors="0" failures="0" skipped="0" timestamp="2020-05-15T19:49:31" time="1.843" tests="4">
13
13
  <testcase classname="Joi tests should return default message" name="Joi tests should return default message" time="0.003">
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">
package/dist/runner.js CHANGED
@@ -23,12 +23,11 @@ class Locale {
23
23
  reach(accessKey, replaces) {
24
24
  let text = accessKey[this.language];
25
25
  if (Boolean(text)) {
26
- if (replaces !== undefined) {
27
- for (const key in replaces) {
28
- if (replaces.hasOwnProperty(key)) {
29
- const value = replaces[key];
30
- text = text.replace(`{{${key}}}`, value);
31
- }
26
+ if (replaces) {
27
+ for (const key of Object.keys(replaces)) {
28
+ const value = replaces[key];
29
+ const regex = new RegExp(String.raw `{{${key}}}`, 'g');
30
+ text = text.replace(regex, value);
32
31
  }
33
32
  }
34
33
  return text;
@@ -35,4 +35,12 @@ export declare const databaseErrors: {
35
35
  ptBR: string;
36
36
  es: string;
37
37
  };
38
+ connection_failed: {
39
+ ptBR: string;
40
+ es: string;
41
+ };
42
+ invalid_input_type: {
43
+ ptBR: string;
44
+ es: string;
45
+ };
38
46
  };
@@ -36,5 +36,13 @@ exports.databaseErrors = {
36
36
  duplicate_registers_relation: {
37
37
  ptBR: 'Há mais de um registro para o campo {{column}}.',
38
38
  es: 'Hay más de un registro para el campo {{column}}.'
39
+ },
40
+ connection_failed: {
41
+ ptBR: 'Falha de conexão com o banco de dados',
42
+ es: 'La conexión a la base de datos falló'
43
+ },
44
+ invalid_input_type: {
45
+ ptBR: 'O valor {{value}} está no formato incorreto',
46
+ es: 'El valor {{value}} está en el formato incorrecto'
39
47
  }
40
48
  };
@@ -8,6 +8,12 @@ export declare const boolean: {
8
8
  es: string;
9
9
  };
10
10
  };
11
+ export declare const conjunction: {
12
+ and: {
13
+ ptBR: string;
14
+ es: string;
15
+ };
16
+ };
11
17
  export declare const messages: {
12
18
  date_range: {
13
19
  ptBR: string;
@@ -10,6 +10,12 @@ exports.boolean = {
10
10
  es: 'No'
11
11
  }
12
12
  };
13
+ exports.conjunction = {
14
+ and: {
15
+ ptBR: 'e',
16
+ es: 'y'
17
+ }
18
+ };
13
19
  exports.messages = {
14
20
  date_range: {
15
21
  ptBR: 'De {{start_date}} até {{end_date}}',
@@ -0,0 +1,10 @@
1
+ export declare const internalServerErrors: {
2
+ non_reconized_error: {
3
+ ptBR: string;
4
+ es: string;
5
+ };
6
+ non_reconized_error_for_admin: {
7
+ ptBR: string;
8
+ es: string;
9
+ };
10
+ };
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.internalServerErrors = {
4
+ non_reconized_error: {
5
+ ptBR: 'Ocorreu um erro não identificado. Por favor, entre em contato com nosso suporte via e-mail: <a href=\"mailto:{{email}}\">{{email}}</a>.',
6
+ es: 'Ha ocurrido un error no identificado. Póngase en contacto con nuestro soporte por correo electrónico: <a href=\"mailto:{{email}}\">{{email}}</a>.'
7
+ },
8
+ non_reconized_error_for_admin: {
9
+ ptBR: 'Ocorreu o seguinte erro: {{error}}<br>Favor contatar o desenvolvimento.',
10
+ es: 'Se produjo el siguiente error: {{error}}<br>Póngase en contacto con el desarrollador.'
11
+ }
12
+ };
@@ -90,4 +90,5 @@ import * as warehouse from './modules/warehouse';
90
90
  import * as warehouse_item from './modules/warehouse_item';
91
91
  export { joi } from './common/joi';
92
92
  export { databaseErrors } from './common/database-errors';
93
+ export { internalServerErrors } from './common/internal-server-errors';
93
94
  export { auth, benchmarking, general, inout, pipefy, carsharing_type, cash_basis, change_history, checklist, checklist_group, checklist_group_item, checklist_group_option, checklist_model, checklist_reply, company, cost_center, cost_sharing, cost_sharing_entity, customer, driver_control, driver_license_point, employee, employee_change_history, employee_hiring_regime, employee_role, expense, fine, fine_qualification_integration_key, fine_qualification, fine_resource, foreseen_maintenance_plan_service_item, foreseen_service_order_item, gas_pump_control, gate, gate_appointment, gate_appointment_diary, item, leasing_contract, leasing_measurement, maintenance_plan, maintenance_plan_service, measurement_unit, night_transport, parameter, pendency, qualification_severity, release_notification, request_occurrence, route, service_order, solicitation, solicitation_comment, solicitation_history, solicitation_watcher, stock_transfer, stock_transfer_item, stock_entry_item, sub_system, subsidiary, supplier, system, tire_brand, tire_dimension, tire_drawing, transaction, trip, vehicle, vehicle_axes, vehicle_booking, vehicle_brand, vehicle_bulk, vehicle_bulk_keys, vehicle_change_history, vehicle_deactivation_cause, vehicle_due, vehicle_event, vehicle_event_type, vehicle_fuel, vehicle_layout, vehicle_leasing, vehicle_maintenance_plan, vehicle_maintenance_plan_item, vehicle_maintenance_plan_service, vehicle_model, vehicle_model_version, vehicle_tag, warehouse, warehouse_item, city, state };
@@ -191,3 +191,5 @@ var joi_1 = require("./common/joi");
191
191
  exports.joi = joi_1.joi;
192
192
  var database_errors_1 = require("./common/database-errors");
193
193
  exports.databaseErrors = database_errors_1.databaseErrors;
194
+ var internal_server_errors_1 = require("./common/internal-server-errors");
195
+ exports.internalServerErrors = internal_server_errors_1.internalServerErrors;
@@ -16,3 +16,17 @@ export declare const fields: {
16
16
  es: string;
17
17
  };
18
18
  };
19
+ export declare const messages: {
20
+ must_not_be_actual_gate: {
21
+ ptBR: string;
22
+ es: string;
23
+ };
24
+ must_not_be_actual_gate_plural: {
25
+ ptBR: string;
26
+ es: string;
27
+ };
28
+ vehicle_with_link: {
29
+ ptBR: string;
30
+ es: string;
31
+ };
32
+ };
@@ -6,3 +6,17 @@ exports.name = {
6
6
  es: 'Portería'
7
7
  };
8
8
  exports.fields = Object.assign({}, entity_1.ENTITY_COMMON);
9
+ exports.messages = {
10
+ must_not_be_actual_gate: {
11
+ ptBR: 'Não é possível remover essa portaria do carsharing, pois ela é a portaria atual do veículo: {{vehicles}}.',
12
+ es: 'No es posible eliminar esta ordenanza del coche compartido, ya que es la ordenanza actual del vehículo: {{vehicles}}.'
13
+ },
14
+ must_not_be_actual_gate_plural: {
15
+ ptBR: 'Não é possível remover essa portaria do carsharing, pois ela é a portaria atual dos veículos: {{vehicles}}.',
16
+ es: 'No puede eliminar esta ordenanza de carsharing, ya que es la ordenanza actual para vehículos: {{vehicles}}.'
17
+ },
18
+ vehicle_with_link: {
19
+ ptBR: '<a href="#/client/vehicles/{{id}}" target="_blank">{{name}}</a>',
20
+ es: '<a href="#/client/vehicles/{{id}}" target="_blank">{{name}}</a>'
21
+ }
22
+ };
package/lib/runner.ts CHANGED
@@ -32,16 +32,14 @@ export class Locale {
32
32
 
33
33
  if (Boolean(text)) {
34
34
 
35
- if (replaces !== undefined) {
35
+ if (replaces) {
36
36
 
37
- for (const key in replaces) {
37
+ for (const key of Object.keys(replaces)) {
38
38
 
39
- if (replaces.hasOwnProperty(key)) {
39
+ const value = replaces[key];
40
+ const regex = new RegExp(String.raw`{{${key}}}`, 'g');
40
41
 
41
- const value = replaces[key];
42
-
43
- text = text.replace(`{{${key}}}`, value);
44
- }
42
+ text = text.replace(regex, value);
45
43
  }
46
44
  }
47
45
 
@@ -34,5 +34,13 @@ export const databaseErrors = {
34
34
  duplicate_registers_relation: {
35
35
  ptBR: 'Há mais de um registro para o campo {{column}}.',
36
36
  es: 'Hay más de un registro para el campo {{column}}.'
37
+ },
38
+ connection_failed: {
39
+ ptBR: 'Falha de conexão com o banco de dados',
40
+ es: 'La conexión a la base de datos falló'
41
+ },
42
+ invalid_input_type: {
43
+ ptBR: 'O valor {{value}} está no formato incorreto',
44
+ es: 'El valor {{value}} está en el formato incorrecto'
37
45
  }
38
46
  };
@@ -9,6 +9,13 @@ export const boolean = {
9
9
  }
10
10
  };
11
11
 
12
+ export const conjunction = {
13
+ and: {
14
+ ptBR: 'e',
15
+ es: 'y'
16
+ }
17
+ };
18
+
12
19
  export const messages = {
13
20
  date_range: {
14
21
  ptBR: 'De {{start_date}} até {{end_date}}',
@@ -0,0 +1,10 @@
1
+ export const internalServerErrors = {
2
+ non_reconized_error: {
3
+ ptBR: 'Ocorreu um erro não identificado. Por favor, entre em contato com nosso suporte via e-mail: <a href=\"mailto:{{email}}\">{{email}}</a>.',
4
+ es: 'Ha ocurrido un error no identificado. Póngase en contacto con nuestro soporte por correo electrónico: <a href=\"mailto:{{email}}\">{{email}}</a>.'
5
+ },
6
+ non_reconized_error_for_admin: {
7
+ ptBR: 'Ocorreu o seguinte erro: {{error}}<br>Favor contatar o desenvolvimento.',
8
+ es: 'Se produjo el siguiente error: {{error}}<br>Póngase en contacto con el desarrollador.'
9
+ }
10
+ };
@@ -91,6 +91,7 @@ import * as warehouse_item from './modules/warehouse_item';
91
91
 
92
92
  export { joi } from './common/joi';
93
93
  export { databaseErrors } from './common/database-errors';
94
+ export { internalServerErrors } from './common/internal-server-errors';
94
95
 
95
96
  export {
96
97
  auth,
@@ -7,4 +7,19 @@ export const name = {
7
7
 
8
8
  export const fields = {
9
9
  ...ENTITY_COMMON
10
+ };
11
+
12
+ export const messages = {
13
+ must_not_be_actual_gate: {
14
+ ptBR: 'Não é possível remover essa portaria do carsharing, pois ela é a portaria atual do veículo: {{vehicles}}.',
15
+ es: 'No es posible eliminar esta ordenanza del coche compartido, ya que es la ordenanza actual del vehículo: {{vehicles}}.'
16
+ },
17
+ must_not_be_actual_gate_plural: {
18
+ ptBR: 'Não é possível remover essa portaria do carsharing, pois ela é a portaria atual dos veículos: {{vehicles}}.',
19
+ es: 'No puede eliminar esta ordenanza de carsharing, ya que es la ordenanza actual para vehículos: {{vehicles}}.'
20
+ },
21
+ vehicle_with_link: {
22
+ ptBR: '<a href="#/client/vehicles/{{id}}" target="_blank">{{name}}</a>',
23
+ es: '<a href="#/client/vehicles/{{id}}" target="_blank">{{name}}</a>'
24
+ }
10
25
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sofit/view-locale",
3
- "version": "1.91.0",
3
+ "version": "1.93.0",
4
4
  "description": "Traduções do Sofit View",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",