-
-
Notifications
You must be signed in to change notification settings - Fork 898
feat: add i18n framework with Chinese (zh-CN) localization #3184
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
Open
jiaminghua
wants to merge
3
commits into
wavetermdev:main
Choose a base branch
from
jiaminghua:feat/i18n-chinese-localization
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| import i18n from "i18next"; | ||
| import { initReactI18next } from "react-i18next"; | ||
|
|
||
| import en from "./locales/en.json"; | ||
| import zhCN from "./locales/zh-CN.json"; | ||
|
|
||
| i18n.use(initReactI18next).init({ | ||
| resources: { | ||
| en: { translation: en }, | ||
| "zh-CN": { translation: zhCN }, | ||
| }, | ||
| lng: "zh-CN", // default language | ||
| fallbackLng: "en", | ||
| interpolation: { | ||
| escapeValue: false, | ||
| }, | ||
| }); | ||
|
|
||
| export default i18n; | ||
|
|
||
| // Expose a global t function for use in non-React contexts (e.g. event handlers, menus) | ||
| declare global { | ||
| interface Window { | ||
| __waveI18n: { t: typeof i18n.t }; | ||
| } | ||
| } | ||
| window.__waveI18n = { t: i18n.t.bind(i18n) }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| { | ||
| "app.tabBarPosition": "Tab Bar Position", | ||
| "app.top": "Top", | ||
| "app.left": "Left", | ||
| "app.renameTab": "Rename Tab", | ||
| "app.copyTabId": "Copy TabId", | ||
| "app.flagTab": "Flag Tab", | ||
| "app.none": "None", | ||
| "app.green": "Green", | ||
| "app.teal": "Teal", | ||
| "app.blue": "Blue", | ||
| "app.purple": "Purple", | ||
| "app.red": "Red", | ||
| "app.orange": "Orange", | ||
| "app.yellow": "Yellow", | ||
| "app.backgrounds": "Backgrounds", | ||
| "app.default": "Default", | ||
| "app.closeTab": "Close Tab", | ||
| "app.magnifyBlock": "Magnify Block", | ||
| "app.unMagnifyBlock": "Un-Magnify Block", | ||
| "app.copyBlockId": "Copy BlockId", | ||
| "app.closeBlock": "Close Block", | ||
| "app.addToLayout": "Add to Layout", | ||
| "app.splitHorizontally": "Split Horizontally", | ||
| "app.splitVertically": "Split Vertically", | ||
| "app.settings": "Settings", | ||
| "app.close": "Close", | ||
| "app.connectTo": "Connect to (username@host)...", | ||
| "app.local": "Local", | ||
| "app.remote": "Remote", | ||
| "app.editConnections": "Edit Connections", | ||
| "app.reconnectTo": "Reconnect to {{connection}}", | ||
| "app.disconnect": "Disconnect {{connection}}", | ||
| "app.newConnection": "{{name}} (New Connection)", | ||
| "app.gitBash": "Git Bash", | ||
| "app.waveAI": "Wave AI", | ||
| "app.context": "Context", | ||
| "app.widgetContext": "Widget Context", | ||
| "app.widgetAccess": "Widget Access {{state}}", | ||
| "app.on": "ON", | ||
| "app.off": "OFF", | ||
| "app.moreOptions": "More options", | ||
| "app.newChat": "New Chat", | ||
| "app.maxOutputTokens": "Max Output Tokens", | ||
| "app.configureModes": "Configure Modes", | ||
| "app.hideWaveAI": "Hide Wave AI", | ||
| "app.about": "About", | ||
| "app.waveTerminal": "Wave Terminal", | ||
| "app.version": "Version", | ||
| "app.configFiles": "Config Files", | ||
| "app.connections": "Connections", | ||
| "app.themes": "Themes", | ||
| "app.keybindings": "Keybindings", | ||
| "app.errorRenderingViewHeader": "Error Rendering View Header: {{error}}", | ||
| "app.cancel": "Cancel", | ||
| "app.ok": "Ok", | ||
|
coderabbitai[bot] marked this conversation as resolved.
Outdated
|
||
| "app.aboutDescription": "Open-Source AI-Integrated Terminal", | ||
| "app.aboutTagline": "Built for Seamless Workflows", | ||
| "app.clientVersion": "Client Version", | ||
| "app.updateChannel": "Update Channel", | ||
| "app.github": "GitHub", | ||
| "app.website": "Website", | ||
| "app.openSource": "Open Source", | ||
| "app.sponsor": "Sponsor", | ||
| "app.viewDocumentation": "View documentation", | ||
| "app.visual": "Visual", | ||
| "app.rawJson": "Raw JSON", | ||
| "app.saving": "Saving...", | ||
| "app.save": "Save", | ||
| "app.unsavedChanges": "Unsaved changes", | ||
| "app.loading": "Loading...", | ||
| "app.configError": "Config Error" | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,73 @@ | ||
| { | ||
| "app.tabBarPosition": "标签页栏位置", | ||
| "app.top": "顶部", | ||
| "app.left": "左侧", | ||
| "app.renameTab": "重命名标签页", | ||
| "app.copyTabId": "复制标签页ID", | ||
| "app.flagTab": "标记标签页", | ||
| "app.none": "无", | ||
| "app.green": "绿色", | ||
| "app.teal": "青色", | ||
| "app.blue": "蓝色", | ||
| "app.purple": "紫色", | ||
| "app.red": "红色", | ||
| "app.orange": "橙色", | ||
| "app.yellow": "黄色", | ||
| "app.backgrounds": "背景", | ||
| "app.default": "默认", | ||
| "app.closeTab": "关闭标签页", | ||
| "app.magnifyBlock": "放大区块", | ||
| "app.unMagnifyBlock": "取消放大区块", | ||
| "app.copyBlockId": "复制区块ID", | ||
| "app.closeBlock": "关闭区块", | ||
| "app.addToLayout": "添加到布局", | ||
| "app.splitHorizontally": "水平拆分", | ||
| "app.splitVertically": "垂直拆分", | ||
| "app.settings": "设置", | ||
| "app.close": "关闭", | ||
| "app.connectTo": "连接到 (用户名@主机)...", | ||
| "app.local": "本地", | ||
| "app.remote": "远程", | ||
| "app.editConnections": "编辑连接", | ||
| "app.reconnectTo": "重新连接到 {{connection}}", | ||
| "app.disconnect": "断开连接 {{connection}}", | ||
| "app.newConnection": "{{name}} (新建连接)", | ||
| "app.gitBash": "Git Bash", | ||
| "app.waveAI": "Wave AI", | ||
| "app.context": "上下文", | ||
| "app.widgetContext": "小组件上下文", | ||
| "app.widgetAccess": "小组件访问 {{state}}", | ||
| "app.on": "开启", | ||
| "app.off": "关闭", | ||
| "app.moreOptions": "更多选项", | ||
| "app.newChat": "新建对话", | ||
| "app.maxOutputTokens": "最大输出令牌数", | ||
| "app.configureModes": "配置模式", | ||
| "app.hideWaveAI": "隐藏 Wave AI", | ||
| "app.about": "关于", | ||
| "app.waveTerminal": "Wave 终端", | ||
| "app.version": "版本", | ||
| "app.configFiles": "配置文件", | ||
| "app.connections": "连接", | ||
| "app.themes": "主题", | ||
| "app.keybindings": "快捷键", | ||
| "app.errorRenderingViewHeader": "渲染视图标题错误:{{error}}", | ||
| "app.cancel": "取消", | ||
| "app.ok": "确定", | ||
| "app.aboutDescription": "开源 AI 集成终端", | ||
| "app.aboutTagline": "为流畅工作流而生", | ||
| "app.clientVersion": "客户端版本", | ||
| "app.updateChannel": "更新频道", | ||
| "app.github": "GitHub", | ||
| "app.website": "官网", | ||
| "app.openSource": "开源", | ||
| "app.sponsor": "赞助", | ||
| "app.viewDocumentation": "查看文档", | ||
| "app.visual": "可视化", | ||
| "app.rawJson": "原始 JSON", | ||
| "app.saving": "保存中...", | ||
| "app.save": "保存", | ||
| "app.unsavedChanges": "未保存的更改", | ||
| "app.loading": "加载中...", | ||
| "app.configError": "配置错误" | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.