ziko-providers 0.3.0 → 0.5.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
@@ -1,4 +1,12 @@
1
- > [!NOTE]
1
+ This is project is deprecated
2
+ replaced by [ziko-i18n](https://www.npmjs.com/package/ziko-i18n)
3
+
4
+
5
+
6
+ [![zikojs community](https://github.com/zikojs/.github/raw/main/assets/community.svg)](https://github.com/zikojs)
7
+
8
+
9
+ <!-- > [!NOTE]
2
10
  > This project is part of the [ZikoJS](https://github.com/zakarialaoui10/ziko.js) ecosystem.
3
11
 
4
12
 
@@ -20,5 +28,5 @@ If you appreciate the library, kindly demonstrate your support by giving it a st
20
28
 
21
29
  ## Financial support -->
22
30
 
23
- # Licence
24
- This projet is licensed under the terms of MIT License
31
+ <!-- # Licence
32
+ This projet is licensed under the terms of MIT License --> -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ziko-providers",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -32,6 +32,12 @@
32
32
  "rollup": "^4.24.0"
33
33
  },
34
34
  "dependencies": {
35
- "ziko": "^0.62.0"
35
+ "mdzjs": "^0.11.3",
36
+ "zextra": "^0.13.0",
37
+ "ziko": "^0.62.0",
38
+ "ziko-server": "^0.18.1",
39
+ "ziko-tgl": "^0.7.5",
40
+ "ziko-wrapper": "^0.30.2",
41
+ "zikofy": "^0.7.2"
36
42
  }
37
43
  }
@@ -4,16 +4,24 @@ export function useTranslation(
4
4
  initialLang = __Ziko__?.__PROVIDERS__?.i18n?.lang,
5
5
  locals = __Ziko__.__PROVIDERS__?.i18n?.locals
6
6
  ) {
7
- const [getLang, setLang] = useState(initialLang);
7
+ const [lang, _setLang] = useState(initialLang);
8
+
9
+ const setLang = (lang, rtl) =>{
10
+ document.documentElement.lang = lang;
11
+ document.documentElement.style.direction = rtl ? 'rtl' : 'ltr'
12
+ _setLang(lang)
13
+ }
8
14
 
9
15
  setLang(initialLang)
10
16
 
11
17
  function t(key) {
12
18
  return () => ({
13
- value : locals[getLang().value][key],
19
+ value : locals[lang().value][key],
14
20
  isStateGetter: () => true,
15
21
  _subscribe: (fn) => {
16
- getLang()._subscribe(() => fn(locals[getLang().value][key]));
22
+ lang()._subscribe(
23
+ () => fn(locals[lang().value][key])
24
+ );
17
25
  }
18
26
  });
19
27
  }
Binary file