@trackunit/i18n-library-translation 1.3.110-alpha-b962b52d307.0 → 1.3.111
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/index.cjs.js +3 -18
- package/index.esm.js +3 -18
- package/package.json +7 -7
- package/src/useNamespaceTranslation.d.ts +1 -1
package/index.cjs.js
CHANGED
|
@@ -81,7 +81,7 @@ const initializeTranslationsForApp = () => {
|
|
|
81
81
|
transSupportBasicHtmlNodes: true,
|
|
82
82
|
transKeepBasicHtmlNodesFor: ["br", "strong", "i"],
|
|
83
83
|
},
|
|
84
|
-
compatibilityJSON: "
|
|
84
|
+
compatibilityJSON: "v3",
|
|
85
85
|
};
|
|
86
86
|
if (!hasBeenInitialized) {
|
|
87
87
|
i18next
|
|
@@ -131,25 +131,10 @@ const useNamespaceTranslation = (namespace, options) => {
|
|
|
131
131
|
namespace,
|
|
132
132
|
})));
|
|
133
133
|
}
|
|
134
|
-
// Explicitly handle the three different function overloads of t()
|
|
135
134
|
if (arguments.length === 3 && typeof arg2 === "string") {
|
|
136
|
-
|
|
137
|
-
const defaultValue = arg2;
|
|
138
|
-
const opt = arg3;
|
|
139
|
-
return t(key, defaultValue, opt);
|
|
140
|
-
}
|
|
141
|
-
else if (typeof arg2 === "string") {
|
|
142
|
-
// Case: t(key, defaultValue)
|
|
143
|
-
return t(key, arg2);
|
|
144
|
-
}
|
|
145
|
-
else if (arg2) {
|
|
146
|
-
// Case: t(key, options)
|
|
147
|
-
return t(key, arg2);
|
|
148
|
-
}
|
|
149
|
-
else {
|
|
150
|
-
// Case: t(key)
|
|
151
|
-
return t(key);
|
|
135
|
+
return t(key, arg2, arg3);
|
|
152
136
|
}
|
|
137
|
+
return t(key, arg2);
|
|
153
138
|
}, [i18NextInstance, namespace, captureException, t]);
|
|
154
139
|
// Replace t function with customT
|
|
155
140
|
const updatedUseTranslation = react.useMemo(() => {
|
package/index.esm.js
CHANGED
|
@@ -79,7 +79,7 @@ const initializeTranslationsForApp = () => {
|
|
|
79
79
|
transSupportBasicHtmlNodes: true,
|
|
80
80
|
transKeepBasicHtmlNodesFor: ["br", "strong", "i"],
|
|
81
81
|
},
|
|
82
|
-
compatibilityJSON: "
|
|
82
|
+
compatibilityJSON: "v3",
|
|
83
83
|
};
|
|
84
84
|
if (!hasBeenInitialized) {
|
|
85
85
|
i18next
|
|
@@ -129,25 +129,10 @@ const useNamespaceTranslation = (namespace, options) => {
|
|
|
129
129
|
namespace,
|
|
130
130
|
})));
|
|
131
131
|
}
|
|
132
|
-
// Explicitly handle the three different function overloads of t()
|
|
133
132
|
if (arguments.length === 3 && typeof arg2 === "string") {
|
|
134
|
-
|
|
135
|
-
const defaultValue = arg2;
|
|
136
|
-
const opt = arg3;
|
|
137
|
-
return t(key, defaultValue, opt);
|
|
138
|
-
}
|
|
139
|
-
else if (typeof arg2 === "string") {
|
|
140
|
-
// Case: t(key, defaultValue)
|
|
141
|
-
return t(key, arg2);
|
|
142
|
-
}
|
|
143
|
-
else if (arg2) {
|
|
144
|
-
// Case: t(key, options)
|
|
145
|
-
return t(key, arg2);
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
// Case: t(key)
|
|
149
|
-
return t(key);
|
|
133
|
+
return t(key, arg2, arg3);
|
|
150
134
|
}
|
|
135
|
+
return t(key, arg2);
|
|
151
136
|
}, [i18NextInstance, namespace, captureException, t]);
|
|
152
137
|
// Replace t function with customT
|
|
153
138
|
const updatedUseTranslation = useMemo(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/i18n-library-translation",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.111",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "19.0.0",
|
|
11
|
-
"react-i18next": "^
|
|
11
|
+
"react-i18next": "^12.2.2",
|
|
12
12
|
"jest-fetch-mock": "^3.0.3",
|
|
13
|
-
"i18next": "
|
|
14
|
-
"i18next-browser-languagedetector": "
|
|
15
|
-
"i18next-resources-to-backend": "^1.
|
|
16
|
-
"@trackunit/iris-app-api": "1.3.
|
|
17
|
-
"@trackunit/react-core-hooks": "1.3.
|
|
13
|
+
"i18next": "21.10.0",
|
|
14
|
+
"i18next-browser-languagedetector": "6.1.8",
|
|
15
|
+
"i18next-resources-to-backend": "^1.1.4",
|
|
16
|
+
"@trackunit/iris-app-api": "1.3.106",
|
|
17
|
+
"@trackunit/react-core-hooks": "1.3.106"
|
|
18
18
|
},
|
|
19
19
|
"module": "./index.esm.js",
|
|
20
20
|
"main": "./index.cjs.js",
|
|
@@ -9,7 +9,7 @@ export type TransForLibs<LibKeys> = (key: LibKeys, arg2?: string | TOptions, arg
|
|
|
9
9
|
* @param options options to send to i18next
|
|
10
10
|
* @returns {[TransForLibs, i18n, boolean]} useTranslation with custom t function
|
|
11
11
|
*/
|
|
12
|
-
export declare const useNamespaceTranslation: <TranslationKeys extends string
|
|
12
|
+
export declare const useNamespaceTranslation: <TranslationKeys extends string>(namespace: string, options?: UseTranslationOptions) => [TransForLibs<TranslationKeys>, i18n, boolean] & {
|
|
13
13
|
t: TransForLibs<TranslationKeys>;
|
|
14
14
|
i18n: i18n;
|
|
15
15
|
ready: boolean;
|