-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(site): the official website temporarily blocks English #2199
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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') | ||
// } | ||
// ] | ||
// }, | ||
Comment on lines
+4
to
+20
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Codebase verification Verify and update all language-related configurations to ensure consistency with the temporary removal of the English version The search identified numerous language and internationalization settings throughout the codebase. To fully implement the temporary restriction of the English version, please ensure that all language-related configurations are appropriately updated or commented out. This will prevent any unintended access to English content in other parts of the application.
🔗 Analysis chainTemporary removal of language selection aligns with PR objectives The commented-out code block effectively implements the PR's goal of temporarily blocking the English version of the website. This change ensures that only the Chinese version is available, as intended. While this achieves the desired outcome, please consider the following points:
To ensure this change is consistently applied across the codebase, let's verify if there are any other language-related settings or switches that might need similar treatment: 🏁 Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Search for other language-related code that might need adjustment
# Test: Look for language-related variables or settings
echo "Searching for language-related code:"
rg --type js -i '(language|locale|lang|i18n)' --glob '!**/node_modules/**'
Length of output: 211946 |
||
{ | ||
// 示例代码风格 | ||
name: 'apiMode', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Consider a more flexible approach for language routing
The hardcoding of 'zh-CN' in the route path aligns with the PR objective of temporarily blocking the English version. However, this approach may have some drawbacks:
Consider using a configuration variable or environment flag to control the language restriction. This would allow for easier management and future flexibility. For example:
This approach would make it easier to lift the language restriction or add support for other languages in the future without modifying the router code.