@julseb-lib/react 0.1.83 → 1.0.0

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/README.md CHANGED
@@ -30,7 +30,7 @@ npm install @julseb-lib/react
30
30
  yarn add @julseb-lib/react
31
31
 
32
32
  # pnpm
33
- pnpm add @julseb-lib/react
33
+ pnpm install @julseb-lib/react
34
34
  ```
35
35
 
36
36
  ## Type Exports
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,