Skip to content

Commit eb63b5c

Browse files
christian-byrnegithub-actions
andauthored
[feat] Add Traditional Chinese language support (#4410)
Co-authored-by: github-actions <[email protected]>
1 parent e6d78ab commit eb63b5c

File tree

8 files changed

+10828
-4
lines changed

8 files changed

+10828
-4
lines changed

.i18nrc.cjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ module.exports = defineConfig({
99
entry: 'src/locales/en',
1010
entryLocale: 'en',
1111
output: 'src/locales',
12-
outputLocales: ['zh', 'ru', 'ja', 'ko', 'fr', 'es'],
12+
outputLocales: ['zh', 'zh-TW', 'ru', 'ja', 'ko', 'fr', 'es'],
1313
reference: `Special names to keep untranslated: flux, photomaker, clip, vae, cfg, stable audio, stable cascade, stable zero, controlnet, lora, HiDream.
1414
'latent' is the short form of 'latent space'.
1515
'mask' is in the context of image processing.
16+
Note: For Traditional Chinese (Taiwan), use Taiwan-specific terminology and traditional characters.
1617
`
1718
});

scripts/check-unused-i18n-keys.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ async function checkNewUnusedKeys() {
166166

167167
// Report results
168168
if (unusedNewKeys.length > 0) {
169-
console.log('\n Found unused NEW i18n keys:\n')
169+
console.log('\n⚠️ Warning: Found unused NEW i18n keys:\n')
170170

171171
for (const key of unusedNewKeys.sort()) {
172172
console.log(` - ${key}`)
@@ -176,9 +176,10 @@ async function checkNewUnusedKeys() {
176176
console.log(
177177
'\nThese keys were added but are not used anywhere in the codebase.'
178178
)
179-
console.log('Please either use them or remove them before committing.')
179+
console.log('Consider using them or removing them in a future update.')
180180

181-
process.exit(1)
181+
// Changed from process.exit(1) to process.exit(0) for warning only
182+
process.exit(0)
182183
} else {
183184
// Silent success - no output needed
184185
}

src/constants/coreSettings.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,7 @@ export const CORE_SETTINGS: SettingParams[] = [
290290
options: [
291291
{ value: 'en', text: 'English' },
292292
{ value: 'zh', text: '中文' },
293+
{ value: 'zh-TW', text: '繁體中文' },
293294
{ value: 'ru', text: 'Русский' },
294295
{ value: 'ja', text: '日本語' },
295296
{ value: 'ko', text: '한국어' },

src/i18n.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ import ruCommands from './locales/ru/commands.json'
2424
import ru from './locales/ru/main.json'
2525
import ruNodes from './locales/ru/nodeDefs.json'
2626
import ruSettings from './locales/ru/settings.json'
27+
import zhTWCommands from './locales/zh-TW/commands.json'
28+
import zhTW from './locales/zh-TW/main.json'
29+
import zhTWNodes from './locales/zh-TW/nodeDefs.json'
30+
import zhTWSettings from './locales/zh-TW/settings.json'
2731
import zhCommands from './locales/zh/commands.json'
2832
import zh from './locales/zh/main.json'
2933
import zhNodes from './locales/zh/nodeDefs.json'
@@ -41,6 +45,7 @@ function buildLocale<M, N, C, S>(main: M, nodes: N, commands: C, settings: S) {
4145
const messages = {
4246
en: buildLocale(en, enNodes, enCommands, enSettings),
4347
zh: buildLocale(zh, zhNodes, zhCommands, zhSettings),
48+
'zh-TW': buildLocale(zhTW, zhTWNodes, zhTWCommands, zhTWSettings),
4449
ru: buildLocale(ru, ruNodes, ruCommands, ruSettings),
4550
ja: buildLocale(ja, jaNodes, jaCommands, jaSettings),
4651
ko: buildLocale(ko, koNodes, koCommands, koSettings),

src/locales/zh-TW/commands.json

Lines changed: 249 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,249 @@
1+
{
2+
"Comfy-Desktop_CheckForUpdates": {
3+
"label": "檢查更新"
4+
},
5+
"Comfy-Desktop_Folders_OpenCustomNodesFolder": {
6+
"label": "開啟自訂節點資料夾"
7+
},
8+
"Comfy-Desktop_Folders_OpenInputsFolder": {
9+
"label": "開啟輸入資料夾"
10+
},
11+
"Comfy-Desktop_Folders_OpenLogsFolder": {
12+
"label": "開啟日誌資料夾"
13+
},
14+
"Comfy-Desktop_Folders_OpenModelConfig": {
15+
"label": "開啟 extra_model_paths.yaml"
16+
},
17+
"Comfy-Desktop_Folders_OpenModelsFolder": {
18+
"label": "開啟模型資料夾"
19+
},
20+
"Comfy-Desktop_Folders_OpenOutputsFolder": {
21+
"label": "開啟輸出資料夾"
22+
},
23+
"Comfy-Desktop_OpenDevTools": {
24+
"label": "開啟開發者工具"
25+
},
26+
"Comfy-Desktop_OpenUserGuide": {
27+
"label": "桌面版使用指南"
28+
},
29+
"Comfy-Desktop_Quit": {
30+
"label": "退出"
31+
},
32+
"Comfy-Desktop_Reinstall": {
33+
"label": "重新安裝"
34+
},
35+
"Comfy-Desktop_Restart": {
36+
"label": "重新啟動"
37+
},
38+
"Comfy_BrowseTemplates": {
39+
"label": "瀏覽範本"
40+
},
41+
"Comfy_Canvas_AddEditModelStep": {
42+
"label": "新增編輯模型步驟"
43+
},
44+
"Comfy_Canvas_DeleteSelectedItems": {
45+
"label": "刪除選取項目"
46+
},
47+
"Comfy_Canvas_FitView": {
48+
"label": "將視圖適應至所選節點"
49+
},
50+
"Comfy_Canvas_MoveSelectedNodes_Down": {
51+
"label": "將選取的節點下移"
52+
},
53+
"Comfy_Canvas_MoveSelectedNodes_Left": {
54+
"label": "左移選取的節點"
55+
},
56+
"Comfy_Canvas_MoveSelectedNodes_Right": {
57+
"label": "右移選取的節點"
58+
},
59+
"Comfy_Canvas_MoveSelectedNodes_Up": {
60+
"label": "上移選取的節點"
61+
},
62+
"Comfy_Canvas_ResetView": {
63+
"label": "重設視圖"
64+
},
65+
"Comfy_Canvas_Resize": {
66+
"label": "調整所選節點大小"
67+
},
68+
"Comfy_Canvas_ToggleLinkVisibility": {
69+
"label": "畫布切換連結可見性"
70+
},
71+
"Comfy_Canvas_ToggleLock": {
72+
"label": "畫布切換鎖定"
73+
},
74+
"Comfy_Canvas_ToggleSelectedNodes_Bypass": {
75+
"label": "略過/取消略過選取的節點"
76+
},
77+
"Comfy_Canvas_ToggleSelectedNodes_Collapse": {
78+
"label": "收合/展開選取的節點"
79+
},
80+
"Comfy_Canvas_ToggleSelectedNodes_Mute": {
81+
"label": "停用/啟用選取的節點"
82+
},
83+
"Comfy_Canvas_ToggleSelectedNodes_Pin": {
84+
"label": "釘選/取消釘選已選取的節點"
85+
},
86+
"Comfy_Canvas_ToggleSelected_Pin": {
87+
"label": "釘選/取消釘選已選項目"
88+
},
89+
"Comfy_Canvas_ZoomIn": {
90+
"label": "放大"
91+
},
92+
"Comfy_Canvas_ZoomOut": {
93+
"label": "縮小"
94+
},
95+
"Comfy_ClearPendingTasks": {
96+
"label": "清除待處理任務"
97+
},
98+
"Comfy_ClearWorkflow": {
99+
"label": "清除工作流程"
100+
},
101+
"Comfy_ContactSupport": {
102+
"label": "聯絡支援"
103+
},
104+
"Comfy_DuplicateWorkflow": {
105+
"label": "複製目前工作流程"
106+
},
107+
"Comfy_ExportWorkflow": {
108+
"label": "匯出工作流程"
109+
},
110+
"Comfy_ExportWorkflowAPI": {
111+
"label": "匯出工作流程(API 格式)"
112+
},
113+
"Comfy_Feedback": {
114+
"label": "提供回饋"
115+
},
116+
"Comfy_Graph_ConvertToSubgraph": {
117+
"label": "將選取內容轉換為子圖"
118+
},
119+
"Comfy_Graph_FitGroupToContents": {
120+
"label": "調整群組以符合內容"
121+
},
122+
"Comfy_Graph_GroupSelectedNodes": {
123+
"label": "群組所選節點"
124+
},
125+
"Comfy_GroupNode_ConvertSelectedNodesToGroupNode": {
126+
"label": "將選取的節點轉換為群組節點"
127+
},
128+
"Comfy_GroupNode_ManageGroupNodes": {
129+
"label": "管理群組節點"
130+
},
131+
"Comfy_GroupNode_UngroupSelectedGroupNodes": {
132+
"label": "取消群組所選群組節點"
133+
},
134+
"Comfy_Help_AboutComfyUI": {
135+
"label": "開啟關於 ComfyUI"
136+
},
137+
"Comfy_Help_OpenComfyOrgDiscord": {
138+
"label": "開啟 Comfy-Org Discord"
139+
},
140+
"Comfy_Help_OpenComfyUIDocs": {
141+
"label": "開啟 ComfyUI 文件"
142+
},
143+
"Comfy_Help_OpenComfyUIForum": {
144+
"label": "開啟 ComfyUI 論壇"
145+
},
146+
"Comfy_Help_OpenComfyUIIssues": {
147+
"label": "開啟 ComfyUI 問題追蹤"
148+
},
149+
"Comfy_Interrupt": {
150+
"label": "中斷"
151+
},
152+
"Comfy_LoadDefaultWorkflow": {
153+
"label": "載入預設工作流程"
154+
},
155+
"Comfy_Manager_CustomNodesManager": {
156+
"label": "切換自訂節點管理器"
157+
},
158+
"Comfy_Manager_ToggleManagerProgressDialog": {
159+
"label": "切換自訂節點管理器進度條"
160+
},
161+
"Comfy_MaskEditor_OpenMaskEditor": {
162+
"label": "為選取的節點開啟 Mask 編輯器"
163+
},
164+
"Comfy_NewBlankWorkflow": {
165+
"label": "新增空白工作流程"
166+
},
167+
"Comfy_OpenClipspace": {
168+
"label": "Clipspace"
169+
},
170+
"Comfy_OpenWorkflow": {
171+
"label": "開啟工作流程"
172+
},
173+
"Comfy_QueuePrompt": {
174+
"label": "將提示詞加入佇列"
175+
},
176+
"Comfy_QueuePromptFront": {
177+
"label": "將提示詞加入佇列前方"
178+
},
179+
"Comfy_QueueSelectedOutputNodes": {
180+
"label": "佇列所選的輸出節點"
181+
},
182+
"Comfy_Redo": {
183+
"label": "重做"
184+
},
185+
"Comfy_RefreshNodeDefinitions": {
186+
"label": "重新整理節點定義"
187+
},
188+
"Comfy_SaveWorkflow": {
189+
"label": "儲存工作流程"
190+
},
191+
"Comfy_SaveWorkflowAs": {
192+
"label": "另存工作流程"
193+
},
194+
"Comfy_ShowSettingsDialog": {
195+
"label": "顯示設定對話框"
196+
},
197+
"Comfy_ToggleTheme": {
198+
"label": "切換主題(深色/淺色)"
199+
},
200+
"Comfy_Undo": {
201+
"label": "復原"
202+
},
203+
"Comfy_User_OpenSignInDialog": {
204+
"label": "開啟登入對話框"
205+
},
206+
"Comfy_User_SignOut": {
207+
"label": "登出"
208+
},
209+
"Workspace_CloseWorkflow": {
210+
"label": "關閉當前工作流程"
211+
},
212+
"Workspace_NextOpenedWorkflow": {
213+
"label": "下一個已開啟的工作流程"
214+
},
215+
"Workspace_PreviousOpenedWorkflow": {
216+
"label": "上次開啟的工作流程"
217+
},
218+
"Workspace_SearchBox_Toggle": {
219+
"label": "切換搜尋框"
220+
},
221+
"Workspace_ToggleBottomPanel": {
222+
"label": "切換下方面板"
223+
},
224+
"Workspace_ToggleBottomPanelTab_command-terminal": {
225+
"label": "切換終端機底部面板"
226+
},
227+
"Workspace_ToggleBottomPanelTab_logs-terminal": {
228+
"label": "切換日誌底部面板"
229+
},
230+
"Workspace_ToggleFocusMode": {
231+
"label": "切換專注模式"
232+
},
233+
"Workspace_ToggleSidebarTab_model-library": {
234+
"label": "切換模型庫側邊欄",
235+
"tooltip": "模型庫"
236+
},
237+
"Workspace_ToggleSidebarTab_node-library": {
238+
"label": "切換節點庫側邊欄",
239+
"tooltip": "節點庫"
240+
},
241+
"Workspace_ToggleSidebarTab_queue": {
242+
"label": "切換佇列側邊欄",
243+
"tooltip": "佇列"
244+
},
245+
"Workspace_ToggleSidebarTab_workflows": {
246+
"label": "切換工作流程側邊欄",
247+
"tooltip": "工作流程"
248+
}
249+
}

0 commit comments

Comments
 (0)