@monkvision/common 4.0.15 → 4.0.17
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/README/INTERNATIONALIZATION.md +1 -1
- package/lib/hooks/useObjectTranslation.d.ts +2 -1
- package/lib/hooks/useObjectTranslation.js +2 -2
- package/lib/i18n/translations/damageTypes.d.ts +5 -0
- package/lib/i18n/translations/damageTypes.js +70 -0
- package/lib/i18n/translations/index.d.ts +1 -0
- package/lib/i18n/translations/index.js +1 -0
- package/package.json +13 -13
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { TranslationObject } from '@monkvision/types';
|
|
2
|
+
import { UseTranslationOptions } from 'react-i18next';
|
|
2
3
|
/**
|
|
3
4
|
* The result of the useObjectTranslation. It contains a function which takes a LabelTranslation object and return the
|
|
4
5
|
* translated label sync with the actual selected language.
|
|
@@ -12,4 +13,4 @@ export interface UseObjectTranslationResult {
|
|
|
12
13
|
/**
|
|
13
14
|
* Custom hook used to get a translation function tObj that translates TranslationObjects.
|
|
14
15
|
*/
|
|
15
|
-
export declare function useObjectTranslation(): UseObjectTranslationResult;
|
|
16
|
+
export declare function useObjectTranslation(ns?: string, options?: UseTranslationOptions<any>): UseObjectTranslationResult;
|
|
@@ -7,8 +7,8 @@ var i18n_1 = require("../i18n");
|
|
|
7
7
|
/**
|
|
8
8
|
* Custom hook used to get a translation function tObj that translates TranslationObjects.
|
|
9
9
|
*/
|
|
10
|
-
function useObjectTranslation() {
|
|
11
|
-
var i18n = (0, react_i18next_1.useTranslation)().i18n;
|
|
10
|
+
function useObjectTranslation(ns, options) {
|
|
11
|
+
var i18n = (0, react_i18next_1.useTranslation)(ns, options).i18n;
|
|
12
12
|
var tObj = (0, react_1.useCallback)(function (obj) {
|
|
13
13
|
var _a;
|
|
14
14
|
return (_a = obj[(0, i18n_1.getLanguage)(i18n.language)]) !== null && _a !== void 0 ? _a : 'translation-not-found';
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.damageTypeLabels = void 0;
|
|
5
|
+
var types_1 = require("@monkvision/types");
|
|
6
|
+
/**
|
|
7
|
+
* The translated labels for each damage type available in the SDK.
|
|
8
|
+
*/
|
|
9
|
+
exports.damageTypeLabels = (_a = {},
|
|
10
|
+
_a[types_1.DamageType.SCRATCH] = {
|
|
11
|
+
en: 'Scratch',
|
|
12
|
+
fr: 'Rayure',
|
|
13
|
+
de: 'Kratzer',
|
|
14
|
+
nl: 'Kras',
|
|
15
|
+
},
|
|
16
|
+
_a[types_1.DamageType.DENT] = {
|
|
17
|
+
en: 'Dent',
|
|
18
|
+
fr: 'Bosse',
|
|
19
|
+
de: 'Beule',
|
|
20
|
+
nl: 'Deuk',
|
|
21
|
+
},
|
|
22
|
+
_a[types_1.DamageType.BROKEN_GLASS] = {
|
|
23
|
+
en: 'Broken Glass',
|
|
24
|
+
fr: 'Bris de glace',
|
|
25
|
+
de: 'Zerbrochenes Glas',
|
|
26
|
+
nl: 'Gebroken glas',
|
|
27
|
+
},
|
|
28
|
+
_a[types_1.DamageType.BROKEN_LIGHT] = {
|
|
29
|
+
en: 'Broken Light',
|
|
30
|
+
fr: 'Feu cassé',
|
|
31
|
+
de: 'Kaputtem Licht',
|
|
32
|
+
nl: 'Gebroken licht',
|
|
33
|
+
},
|
|
34
|
+
_a[types_1.DamageType.HUBCAP_SCRATCH] = {
|
|
35
|
+
en: 'Hubcap Scratch',
|
|
36
|
+
fr: 'Enjoliveur rayé',
|
|
37
|
+
de: 'Zerkratzte Radkappe',
|
|
38
|
+
nl: 'Gebroken wieldop',
|
|
39
|
+
},
|
|
40
|
+
_a[types_1.DamageType.MISSING_HUBCAP] = {
|
|
41
|
+
en: 'Missing Hubcap',
|
|
42
|
+
fr: 'Enjoliveur manquant',
|
|
43
|
+
de: 'Fehlende Radkappe',
|
|
44
|
+
nl: 'Ontbrekende wieldop',
|
|
45
|
+
},
|
|
46
|
+
_a[types_1.DamageType.SMASH] = {
|
|
47
|
+
en: 'Smash',
|
|
48
|
+
fr: 'Collision',
|
|
49
|
+
de: 'Zusammenstoß',
|
|
50
|
+
nl: 'Botsing',
|
|
51
|
+
},
|
|
52
|
+
_a[types_1.DamageType.BODY_CRACK] = {
|
|
53
|
+
en: 'Body Crack',
|
|
54
|
+
fr: 'Fissure dans la carrosserie',
|
|
55
|
+
de: 'Karosserieriss',
|
|
56
|
+
nl: 'Carrosseriescheur',
|
|
57
|
+
},
|
|
58
|
+
_a[types_1.DamageType.MISSING_PIECE] = {
|
|
59
|
+
en: 'Missing Piece',
|
|
60
|
+
fr: 'Pièce manquante',
|
|
61
|
+
de: 'Fehlendes Teil',
|
|
62
|
+
nl: 'Ontbrekend onderdeel',
|
|
63
|
+
},
|
|
64
|
+
_a[types_1.DamageType.RUSTINESS] = {
|
|
65
|
+
en: 'Rustiness',
|
|
66
|
+
fr: 'Rouille',
|
|
67
|
+
de: 'Rostigkeit',
|
|
68
|
+
nl: 'Roest',
|
|
69
|
+
},
|
|
70
|
+
_a);
|
|
@@ -14,5 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./damageTypes"), exports);
|
|
17
18
|
__exportStar(require("./vehicleParts"), exports);
|
|
18
19
|
__exportStar(require("./image"), exports);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@monkvision/common",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.17",
|
|
4
4
|
"license": "BSD-3-Clause-Clear",
|
|
5
5
|
"packageManager": "yarn@3.2.4",
|
|
6
6
|
"description": "MonkJs common logic package",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
"lint:fix": "yarn run prettier:fix && yarn run eslint:fix"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@monkvision/analytics": "4.0.
|
|
32
|
-
"@monkvision/monitoring": "4.0.
|
|
33
|
-
"@monkvision/sights": "4.0.
|
|
34
|
-
"@monkvision/types": "4.0.
|
|
31
|
+
"@monkvision/analytics": "4.0.17",
|
|
32
|
+
"@monkvision/monitoring": "4.0.17",
|
|
33
|
+
"@monkvision/sights": "4.0.17",
|
|
34
|
+
"@monkvision/types": "4.0.17",
|
|
35
35
|
"i18next": "^23.4.5",
|
|
36
36
|
"jsonwebtoken": "^9.0.2",
|
|
37
37
|
"jwt-decode": "^4.0.0",
|
|
@@ -47,13 +47,13 @@
|
|
|
47
47
|
"react-router-dom": "^6.22.3"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@monkvision/eslint-config-base": "4.0.
|
|
51
|
-
"@monkvision/eslint-config-typescript": "4.0.
|
|
52
|
-
"@monkvision/eslint-config-typescript-react": "4.0.
|
|
53
|
-
"@monkvision/jest-config": "4.0.
|
|
54
|
-
"@monkvision/prettier-config": "4.0.
|
|
55
|
-
"@monkvision/test-utils": "4.0.
|
|
56
|
-
"@monkvision/typescript-config": "4.0.
|
|
50
|
+
"@monkvision/eslint-config-base": "4.0.17",
|
|
51
|
+
"@monkvision/eslint-config-typescript": "4.0.17",
|
|
52
|
+
"@monkvision/eslint-config-typescript-react": "4.0.17",
|
|
53
|
+
"@monkvision/jest-config": "4.0.17",
|
|
54
|
+
"@monkvision/prettier-config": "4.0.17",
|
|
55
|
+
"@monkvision/test-utils": "4.0.17",
|
|
56
|
+
"@monkvision/typescript-config": "4.0.17",
|
|
57
57
|
"@testing-library/react": "^12.1.5",
|
|
58
58
|
"@testing-library/react-hooks": "^8.0.1",
|
|
59
59
|
"@types/jest": "^29.2.2",
|
|
@@ -96,5 +96,5 @@
|
|
|
96
96
|
"url": "https://github.com/monkvision/monkjs/issues"
|
|
97
97
|
},
|
|
98
98
|
"homepage": "https://github.com/monkvision/monkjs",
|
|
99
|
-
"gitHead": "
|
|
99
|
+
"gitHead": "9b7e9f78e59b25f853d0504da5f8821d76b2fad2"
|
|
100
100
|
}
|