From 2b35c139075a3b59af81c1289d90dac4ec24b3cd Mon Sep 17 00:00:00 2001 From: sws <1141121512@qq.com> Date: Thu, 23 Nov 2023 16:35:13 +0800 Subject: [PATCH] =?UTF-8?q?1.=E5=A4=9A=E8=AF=AD=E8=A8=80=202023.11.23?= =?UTF-8?q?=E5=91=A8=E5=9B=9B--sws?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- i18n_tools.config.js | 6 +++--- {locales => lang}/en.json | 0 {locales => lang}/index.js | 0 {locales => lang}/zh.json | 0 main.js | 2 +- 5 files changed, 4 insertions(+), 4 deletions(-) rename {locales => lang}/en.json (100%) rename {locales => lang}/index.js (100%) rename {locales => lang}/zh.json (100%) diff --git a/i18n_tools.config.js b/i18n_tools.config.js index 928ff008..e4193ad5 100644 --- a/i18n_tools.config.js +++ b/i18n_tools.config.js @@ -1,9 +1,9 @@ module.exports = { - entry: ['locales'], // 提取、还原、遗漏扫描入口文件夹,可以配置多个,默认是 src - outDir: 'locales', // i18n 输出文件夹 默认是 src/locales + entry: [''], // 提取、还原、遗漏扫描入口文件夹,可以配置多个,默认是 src + outDir: 'lang', // i18n 输出文件夹 默认是 src/locales outShow:2, //输出文件展示结构 1 扁平化结构 2树级结构 默认扁平化 - exclude: ['locales'], // 不提取的文件夹, 默认是 ['src/locales'] + exclude: ['lang'], // 不提取的文件夹, 默认是 ['src/locales'] extensions: ['.vue', '.js', '.ts'], // 提取的文件后缀名,默认是 ['.js', '.vue', '.ts'] filename: 'zh', // 输出的文件名,默认为 zh_cn extname: 'json', // 输出的文件后缀名默认为 js ,支持json和js(js格式为 module.exports = {} 或 export default {}), diff --git a/locales/en.json b/lang/en.json similarity index 100% rename from locales/en.json rename to lang/en.json diff --git a/locales/index.js b/lang/index.js similarity index 100% rename from locales/index.js rename to lang/index.js diff --git a/locales/zh.json b/lang/zh.json similarity index 100% rename from locales/zh.json rename to lang/zh.json diff --git a/main.js b/main.js index a5c280cd..515a4756 100644 --- a/main.js +++ b/main.js @@ -6,7 +6,7 @@ import base from './common/js/common/base'; import share from './common/js/common/share'; // 多语言引入并初始化 -import messages from './locales/index' +import messages from './lang/index' import VueI18n from 'vue-i18n'; let i18nConfig = { locale: uni.getLocale() || 'zh',