yh-i18n 1.2.7 → 1.3.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.
Files changed (2) hide show
  1. package/index.js +2 -2
  2. package/package.json +20 -20
package/index.js CHANGED
@@ -25,8 +25,7 @@ import el_tr from "element-plus/dist/locale/tr.mjs";
25
25
 
26
26
  // 自动根据浏览器系统语言设置语言
27
27
  const navLang = navigator.language;
28
- const localLang = navLang === "zh_CN" || navLang === "en_US" ? navLang : false;
29
- const initlang = localStorage.local || localLang || "zh_CN";
28
+ const initlang = localStorage.translateLanguage || navLang || "zh_CN";
30
29
 
31
30
  export let i18n = null;
32
31
  window.translateReady = !!localStorage.translateReady || false;
@@ -73,6 +72,7 @@ export const useI18nStore = defineStore("i18nStore", () => {
73
72
  */
74
73
  function setLang(l) {
75
74
  lang.value = l;
75
+ localStorage.translateLanguage = l;
76
76
  if (i18n) {
77
77
  i18n.global.locale = l;
78
78
  }
package/package.json CHANGED
@@ -1,20 +1,20 @@
1
- {
2
- "name": "yh-i18n",
3
- "version": "1.2.7",
4
- "description": "对于国际化的封装",
5
- "main": "index.js",
6
- "scripts": {
7
- "pub:npm": "npm publish --registry https://registry.npmjs.org/ --no-git-checks",
8
- "pub:aliyun": "npm publish --registry https://packages.aliyun.com/60765e0161a945067837bb5f/npm/npm-registry/ --no-git-checks"
9
- },
10
- "dependencies": {
11
- "exceljs": "4.4.0"
12
- },
13
- "peerDependencies": {
14
- "vue-i18n": "9.8.0",
15
- "vue": "3.2.47",
16
- "vxe-table": "4.3.10",
17
- "element-plus": "2.4.4"
18
- },
19
- "author": "Liubin"
20
- }
1
+ {
2
+ "name": "yh-i18n",
3
+ "version": "1.3.0",
4
+ "description": "对于国际化的封装",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "pub:npm": "npm publish --registry https://registry.npmjs.org/ --no-git-checks",
8
+ "pub:aliyun": "npm publish --registry https://packages.aliyun.com/60765e0161a945067837bb5f/npm/npm-registry/ --no-git-checks"
9
+ },
10
+ "dependencies": {
11
+ "exceljs": "4.4.0"
12
+ },
13
+ "peerDependencies": {
14
+ "vue-i18n": "9.8.0",
15
+ "vue": "3.2.47",
16
+ "vxe-table": "4.3.10",
17
+ "element-plus": "2.3.8"
18
+ },
19
+ "author": "Liubin"
20
+ }