Skip to content

Commit 41f9ca8

Browse files
authored
feat(site): the official website temporarily blocks English (#2199)
1 parent 9a6114e commit 41f9ca8

File tree

5 files changed

+25
-21
lines changed

5 files changed

+25
-21
lines changed

examples/sites/src/i18n/index.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import zh from './zh.json'
55
import en from './en.json'
66

77
const messages = { enUS: en, zhCN: zh }
8-
$local._lang = $local._lang !== 'zhCN' && $local._lang !== 'enUS' ? 'zhCN' : $local._lang
8+
// $local._lang = $local._lang !== 'zhCN' && $local._lang !== 'enUS' ? 'zhCN' : $local._lang
9+
$local._lang = 'zhCN'
910
const customCreateI18n = ({ locale, messages }) =>
1011
createI18n({
1112
locale, // set locale

examples/sites/src/main.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ const isZhCn = location.href.includes(`/${zhPath}`)
4848
const isEnUs = location.href.includes(`/${enPath}`)
4949
const notMatchLang = (isZhCn && appData.lang !== ZH_CN_LANG) || (isEnUs && appData.lang !== EN_US_LANG)
5050
if (notMatchLang) {
51-
appData.lang = isEnUs ? EN_US_LANG : ZH_CN_LANG
51+
// appData.lang = isEnUs ? EN_US_LANG : ZH_CN_LANG 官网先屏蔽英文内容
52+
appData.lang = isEnUs ? ZH_CN_LANG : ZH_CN_LANG
5253
i18n.global.locale = appData.lang
5354
}
5455

examples/sites/src/router.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ const context = import.meta.env.VITE_CONTEXT
1212
let routes = [
1313
// 组件总览
1414
{
15-
path: `${context}:all?/:lang/:theme/overview`,
15+
path: `${context}:all?/zh-CN/:theme/overview`,
1616
component: Layout,
1717
name: 'overview',
1818
children: [{ name: 'Overview', path: '', component: Overview, meta: { title: '组件总览 | TinyVue' } }]
1919
},
2020
// 组件
2121
{
22-
path: `${context}:all?/:lang/:theme/components/:cmpId`,
22+
path: `${context}:all?/zh-CN/:theme/components/:cmpId`,
2323
component: Layout,
2424
name: 'components',
2525
children: [{ name: 'Components', path: '', component: Components }]

examples/sites/src/tools/appData.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ const appFn = {
1616
if (name !== appData.lang) {
1717
let url = location.href
1818
url = location.href.replace(LANG_PATH_MAP[appData.lang], LANG_PATH_MAP[name])
19-
appData.lang = name
19+
// appData.lang = name 官网先屏蔽英文内容
20+
appData.lang = ZH_CN_LANG
2021
location.replace(url)
2122
}
2223
},

examples/sites/src/tools/useStyleSettings.js

+17-16
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
/** 文档显示风格设置 */
22
const getStyleSettings = (i18nByKey) => {
33
const styleSettings = [
4-
{
5-
// 语言选择
6-
name: 'localeMode',
7-
defaultValue: 'zhCN',
8-
title: i18nByKey('localeType'),
9-
options: [
10-
{
11-
value: 'zhCN',
12-
text: i18nByKey('zh-cn')
13-
},
14-
{
15-
value: 'enUS',
16-
text: i18nByKey('en-us')
17-
}
18-
]
19-
},
4+
/** 官网英文适配后放开 */
5+
// {
6+
// // 语言选择
7+
// name: 'localeMode',
8+
// defaultValue: 'zhCN',
9+
// title: i18nByKey('localeType'),
10+
// options: [
11+
// {
12+
// value: 'zhCN',
13+
// text: i18nByKey('zh-cn')
14+
// },
15+
// {
16+
// value: 'enUS',
17+
// text: i18nByKey('en-us')
18+
// }
19+
// ]
20+
// },
2021
{
2122
// 示例代码风格
2223
name: 'apiMode',

0 commit comments

Comments
 (0)