gemercheung 1 năm trước cách đây
mục cha
commit
1b308a96c8
3 tập tin đã thay đổi với 17 bổ sung15 xóa
  1. 2 3
      .vscode/settings.json
  2. 7 6
      src/locales/lang/en.ts
  3. 8 6
      src/locales/lang/zh.ts

+ 2 - 3
.vscode/settings.json

@@ -1,10 +1,9 @@
 {
-  "i18n-ally.localesPaths": ["src/locales/lang"],
+  "i18n-ally.localesPaths": ["src/locales/lang/webslate"],
   "i18n-ally.keystyle": "nested",
   "i18n-ally.sortKeys": true,
   "i18n-ally.namespace": true,
-  "i18n-ally.pathMatcher": "{locale}/{namespaces}.{ext}",
-  "i18n-ally.enabledParsers": ["ts"],
+  "i18n-ally.enabledParsers": ["json"],
   "i18n-ally.sourceLanguage": "zh",
   "i18n-ally.displayLanguage": "zh",
   "i18n-ally.enabledFrameworks": ["vue", "react"],

+ 7 - 6
src/locales/lang/en.ts

@@ -1,13 +1,14 @@
-import { genMessage } from '../helper'
+// import { genMessage } from '../helper'
 import antdLocale from 'ant-design-vue/es/locale/en_US'
 
-type modulesType = Record<string, Record<string, any>>
-// const modules = import.meta.globEager('./en/**/*.ts')
-const modules: modulesType = import.meta.glob('./en/**/*.ts', { eager: true })
-
+// type modulesType = Record<string, Record<string, any>>
+// // const modules = import.meta.globEager('./en/**/*.ts')
+// const modules: modulesType = import.meta.glob('./en/**/*.ts', { eager: true })
+import en from './webslate/en.json'
 export default {
   message: {
-    ...genMessage(modules, 'en'),
+    // ...genMessage(modules, 'en'),
+    ...en,
     antdLocale
   },
   dateLocale: null,

+ 8 - 6
src/locales/lang/zh.ts

@@ -1,13 +1,15 @@
 import { genMessage } from '../helper'
 import antdLocale from 'ant-design-vue/es/locale/zh_CN'
-type modulesType = Record<string, Record<string, any>>
-// const modules = import.meta.globEager('./zh-CN/**/*.ts')
-const modules: modulesType = import.meta.glob('./zh/**/*.ts', {
-  eager: true
-})
+// type modulesType = Record<string, Record<string, any>>
+// // const modules = import.meta.globEager('./zh-CN/**/*.ts')
+// const modules: modulesType = import.meta.glob('./zh/**/*.ts', {
+//   eager: true
+// })
+import zh from './webslate/zh.json'
 export default {
   message: {
-    ...genMessage(modules, 'zh'),
+    ...zh,
+    // ...genMessage(modules, 'zh'),
     antdLocale
   }
   // momentLocaleName: 'zh-cn',