@julseb-lib/react 0.1.83 → 0.1.84
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 +6 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2471,9 +2471,13 @@ var useTranslation = (translations) => {
|
|
|
2471
2471
|
const languages = Object.keys(translations);
|
|
2472
2472
|
(0, import_react15.useEffect)(() => {
|
|
2473
2473
|
if (window && typeof window !== "undefined") {
|
|
2474
|
-
|
|
2474
|
+
if (localStorage.getItem("lang")) {
|
|
2475
|
+
setLanguage(
|
|
2476
|
+
localStorage.getItem("lang")?.split("-")[0].toLowerCase() ?? "en"
|
|
2477
|
+
);
|
|
2478
|
+
}
|
|
2475
2479
|
}
|
|
2476
|
-
}, [
|
|
2480
|
+
}, []);
|
|
2477
2481
|
const translate = (key) => translations?.[language]?.[key];
|
|
2478
2482
|
return {
|
|
2479
2483
|
translate,
|