diff --git a/examples/sites/src/i18n/index.js b/examples/sites/src/i18n/index.js index 1e3fdc8895..5cc5fd2756 100644 --- a/examples/sites/src/i18n/index.js +++ b/examples/sites/src/i18n/index.js @@ -5,7 +5,8 @@ import zh from './zh.json' import en from './en.json' const messages = { enUS: en, zhCN: zh } -$local._lang = $local._lang !== 'zhCN' && $local._lang !== 'enUS' ? 'zhCN' : $local._lang +// $local._lang = $local._lang !== 'zhCN' && $local._lang !== 'enUS' ? 'zhCN' : $local._lang +$local._lang = 'zhCN' const customCreateI18n = ({ locale, messages }) => createI18n({ locale, // set locale diff --git a/examples/sites/src/main.js b/examples/sites/src/main.js index 2c8038dc99..c90ac88bb5 100644 --- a/examples/sites/src/main.js +++ b/examples/sites/src/main.js @@ -48,7 +48,8 @@ const isZhCn = location.href.includes(`/${zhPath}`) const isEnUs = location.href.includes(`/${enPath}`) const notMatchLang = (isZhCn && appData.lang !== ZH_CN_LANG) || (isEnUs && appData.lang !== EN_US_LANG) if (notMatchLang) { - appData.lang = isEnUs ? EN_US_LANG : ZH_CN_LANG + // appData.lang = isEnUs ? EN_US_LANG : ZH_CN_LANG 官网先屏蔽英文内容 + appData.lang = isEnUs ? ZH_CN_LANG : ZH_CN_LANG i18n.global.locale = appData.lang } diff --git a/examples/sites/src/router.js b/examples/sites/src/router.js index 385e90476f..447410a8a5 100644 --- a/examples/sites/src/router.js +++ b/examples/sites/src/router.js @@ -12,14 +12,14 @@ const context = import.meta.env.VITE_CONTEXT let routes = [ // 组件总览 { - path: `${context}:all?/:lang/:theme/overview`, + path: `${context}:all?/zh-CN/:theme/overview`, component: Layout, name: 'overview', children: [{ name: 'Overview', path: '', component: Overview, meta: { title: '组件总览 | TinyVue' } }] }, // 组件 { - path: `${context}:all?/:lang/:theme/components/:cmpId`, + path: `${context}:all?/zh-CN/:theme/components/:cmpId`, component: Layout, name: 'components', children: [{ name: 'Components', path: '', component: Components }] diff --git a/examples/sites/src/tools/appData.js b/examples/sites/src/tools/appData.js index 7b2c68b6aa..ea0e3d3111 100644 --- a/examples/sites/src/tools/appData.js +++ b/examples/sites/src/tools/appData.js @@ -16,7 +16,8 @@ const appFn = { if (name !== appData.lang) { let url = location.href url = location.href.replace(LANG_PATH_MAP[appData.lang], LANG_PATH_MAP[name]) - appData.lang = name + // appData.lang = name 官网先屏蔽英文内容 + appData.lang = ZH_CN_LANG location.replace(url) } }, diff --git a/examples/sites/src/tools/useStyleSettings.js b/examples/sites/src/tools/useStyleSettings.js index 88f729ba1c..7bab785885 100644 --- a/examples/sites/src/tools/useStyleSettings.js +++ b/examples/sites/src/tools/useStyleSettings.js @@ -1,22 +1,23 @@ /** 文档显示风格设置 */ const getStyleSettings = (i18nByKey) => { const styleSettings = [ - { - // 语言选择 - name: 'localeMode', - defaultValue: 'zhCN', - title: i18nByKey('localeType'), - options: [ - { - value: 'zhCN', - text: i18nByKey('zh-cn') - }, - { - value: 'enUS', - text: i18nByKey('en-us') - } - ] - }, + /** 官网英文适配后放开 */ + // { + // // 语言选择 + // name: 'localeMode', + // defaultValue: 'zhCN', + // title: i18nByKey('localeType'), + // options: [ + // { + // value: 'zhCN', + // text: i18nByKey('zh-cn') + // }, + // { + // value: 'enUS', + // text: i18nByKey('en-us') + // } + // ] + // }, { // 示例代码风格 name: 'apiMode',