@freelog/tools-lib 0.1.153 → 0.1.154
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/dist/i18n/I18nNext.d.ts +3 -0
- package/dist/tools-lib.cjs.development.js +5 -0
- package/dist/tools-lib.cjs.development.js.map +1 -1
- package/dist/tools-lib.cjs.production.min.js +1 -1
- package/dist/tools-lib.cjs.production.min.js.map +1 -1
- package/dist/tools-lib.esm.js +5 -0
- package/dist/tools-lib.esm.js.map +1 -1
- package/package.json +2 -1
- package/src/i18n/I18nNext.ts +162 -155
- package/src/service-API/collections.ts +80 -80
- package/src/service-API/resources.ts +644 -644
- package/src/utils/hooks.ts +17 -17
- package/src/utils/index.ts +22 -22
- package/src/utils/linkTo.ts +439 -439
- package/src/utils/regexp.ts +60 -60
package/dist/i18n/I18nNext.d.ts
CHANGED
|
@@ -12,6 +12,9 @@ declare class I18nNext {
|
|
|
12
12
|
t(this: I18nNext, key: string, options?: {
|
|
13
13
|
[key: string]: any;
|
|
14
14
|
}): string;
|
|
15
|
+
tJSXElement(this: I18nNext, key: string, options?: {
|
|
16
|
+
[key: string]: any;
|
|
17
|
+
}): string | JSX.Element | JSX.Element[];
|
|
15
18
|
changeLanguage(this: I18nNext, lng: LanguageKeyType): void;
|
|
16
19
|
getAllLanguage(this: I18nNext): typeof allLanguage;
|
|
17
20
|
getCurrentLanguage(this: I18nNext): LanguageKeyType;
|
|
@@ -11,6 +11,7 @@ var CryptoJS = require('crypto-js');
|
|
|
11
11
|
var React = require('react');
|
|
12
12
|
var i18next = _interopDefault(require('i18next'));
|
|
13
13
|
var Cookies = _interopDefault(require('js-cookie'));
|
|
14
|
+
var htmlReactParser = _interopDefault(require('html-react-parser'));
|
|
14
15
|
|
|
15
16
|
// import {ContractEntity} from '@freelog/resource-policy-lang/dist/tools/ContractTool';
|
|
16
17
|
// const {compile} = require('@freelog/resource-policy-lang');
|
|
@@ -3411,6 +3412,10 @@ var I18nNext = /*#__PURE__*/function () {
|
|
|
3411
3412
|
return i18next.t(key.trim(), options);
|
|
3412
3413
|
};
|
|
3413
3414
|
|
|
3415
|
+
_proto.tJSXElement = function tJSXElement(key, options) {
|
|
3416
|
+
return htmlReactParser(i18next.t(key.trim(), options));
|
|
3417
|
+
};
|
|
3418
|
+
|
|
3414
3419
|
_proto.changeLanguage = function changeLanguage(lng) {
|
|
3415
3420
|
// return i18next.changeLanguage(lng);
|
|
3416
3421
|
// window.localStorage.setItem(localStorage_i18nextLng_key, lng)
|