@monkvision/common 4.0.16 → 4.0.18

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,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';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@monkvision/common",
3
- "version": "4.0.16",
3
+ "version": "4.0.18",
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.16",
32
- "@monkvision/monitoring": "4.0.16",
33
- "@monkvision/sights": "4.0.16",
34
- "@monkvision/types": "4.0.16",
31
+ "@monkvision/analytics": "4.0.18",
32
+ "@monkvision/monitoring": "4.0.18",
33
+ "@monkvision/sights": "4.0.18",
34
+ "@monkvision/types": "4.0.18",
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.16",
51
- "@monkvision/eslint-config-typescript": "4.0.16",
52
- "@monkvision/eslint-config-typescript-react": "4.0.16",
53
- "@monkvision/jest-config": "4.0.16",
54
- "@monkvision/prettier-config": "4.0.16",
55
- "@monkvision/test-utils": "4.0.16",
56
- "@monkvision/typescript-config": "4.0.16",
50
+ "@monkvision/eslint-config-base": "4.0.18",
51
+ "@monkvision/eslint-config-typescript": "4.0.18",
52
+ "@monkvision/eslint-config-typescript-react": "4.0.18",
53
+ "@monkvision/jest-config": "4.0.18",
54
+ "@monkvision/prettier-config": "4.0.18",
55
+ "@monkvision/test-utils": "4.0.18",
56
+ "@monkvision/typescript-config": "4.0.18",
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": "762612f30c2f46a1e6c43ba2de6384edcbc6c4f4"
99
+ "gitHead": "268e49e44e8e276b7bf5d65af7fc9b6aec8db726"
100
100
  }