Browse Source

chore(i18n): add ts,js file support (#3552)

pull/3554/head
Li Kui 2 years ago
committed by GitHub
parent
commit
2c121edd3d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      .vscode/settings.json
  2. 2
      src/locales/lang/en.ts
  3. 2
      src/locales/lang/zh_CN.ts

4
.vscode/settings.json

@ -108,9 +108,7 @@
"i18n-ally.sortKeys": true,
"i18n-ally.namespace": true,
"i18n-ally.pathMatcher": "{locale}/{namespaces}.{ext}",
"i18n-ally.enabledParsers": [
"json"
],
"i18n-ally.enabledParsers": ["json","ts","js"],
"i18n-ally.sourceLanguage": "en",
"i18n-ally.displayLanguage": "zh-CN",
"i18n-ally.enabledFrameworks": [

2
src/locales/lang/en.ts

@ -1,7 +1,7 @@
import { genMessage } from '../helper';
import antdLocale from 'ant-design-vue/es/locale/en_US';
const modules = import.meta.glob('./en/**/*.json', { eager: true });
const modules = import.meta.glob('./en/**/*.{json,ts,js}', { eager: true });
export default {
message: {
...genMessage(modules as Recordable<Recordable>, 'en'),

2
src/locales/lang/zh_CN.ts

@ -2,7 +2,7 @@ import { genMessage } from '../helper';
import antdLocale from 'ant-design-vue/es/locale/zh_CN';
import { deepMerge } from '@/utils';
const modules = import.meta.glob('./zh-CN/**/*.json', { eager: true });
const modules = import.meta.glob('./zh-CN/**/*.{json,ts,js}', { eager: true });
export default {
message: {

Loading…
Cancel
Save