@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 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
- setLanguage((0, import_utils20.detectLanguage)() ?? "en");
2474
+ if (localStorage.getItem("lang")) {
2475
+ setLanguage(
2476
+ localStorage.getItem("lang")?.split("-")[0].toLowerCase() ?? "en"
2477
+ );
2478
+ }
2475
2479
  }
2476
- }, [language]);
2480
+ }, []);
2477
2481
  const translate = (key) => translations?.[language]?.[key];
2478
2482
  return {
2479
2483
  translate,