@julseb-lib/react 0.1.21 → 0.1.22
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/index.cjs +3 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2616,7 +2616,9 @@ var useTranslation = (translations) => {
|
|
|
2616
2616
|
const [language, setLanguage] = (0, import_react13.useState)(currentLanguage);
|
|
2617
2617
|
const languages = Object.keys(translations);
|
|
2618
2618
|
(0, import_react13.useEffect)(() => {
|
|
2619
|
-
|
|
2619
|
+
if (window && typeof window !== "undefined") {
|
|
2620
|
+
currentLanguage = language || "en";
|
|
2621
|
+
}
|
|
2620
2622
|
}, [language]);
|
|
2621
2623
|
const translate = (key) => {
|
|
2622
2624
|
var _a;
|