├── README.md ├── dic4main.txt ├── dic4rend.txt ├── main.py ├── original_main.js ├── original_rend.js ├── temp_main.js └── temp_rend.js /README.md: -------------------------------------------------------------------------------- 1 | # LocalizeCFW 2 | CFW汉化 3 | 4 | ### 食用方法 5 | 6 | 把Releases界面的对应CFW版本号的app.asar文件放到 `C:\Users\...\Clash for Windows\resources\` 路径下替换文件即可。 7 | 8 | ### 无限期停更 9 | 从CFW 0.13.2开始,js文件已被加密,汉化无法继续进行,各位请期待CFW原生支持中文吧。 10 | 11 | Since CFW v0.13.2 has replaced the Chinese parts with some coded chars and I have no time to maintain this project anymore, I uploaded these files needed for localization, for those who can understand this sentence. 12 | -------------------------------------------------------------------------------- /dic4main.txt: -------------------------------------------------------------------------------- 1 | "Dashboard has crashed!" "控制面板崩溃啦!" 2 | "Dashboard" "控制面板" 3 | "Exit" "退出" 4 | "Force Quit" "强制退出" 5 | "Mixin" "混合模式" 6 | "Proxy Mode" "代理模式" 7 | "Quit" "退出" 8 | "Reload" "重载" 9 | "System Proxy" "系统代理" 10 | label:"Global" label:"全局" 11 | label:"Rule" label:"规则" 12 | label:"Direct" label:"直连" 13 | label:"Script" label:"脚本" -------------------------------------------------------------------------------- /dic4rend.txt: -------------------------------------------------------------------------------- 1 | " Proxy Group" "策略组" 2 | " Proxy" "节点" 3 | " is\n launching for editing.\n ")]),e._v(" "),n("div",[e._v("Close the editing file to Save.")] " 正在启动...\n ")]),e._v(" "),n("div",[e._v("关闭编辑中的文件以保存。")] 4 | ") has been released, download?" ") 已发布,是否下载?" 5 | ")." ") 。" 6 | "Active Connections" "活动连接" 7 | "Add" "添加" 8 | "Advertisement" "广告" 9 | "All","TCP","UDP" "全部","TCP","UDP" 10 | "Allow LAN" "允许局域网连接" 11 | "AlterId" "AlterId" 12 | "Appearance" "外观" 13 | "Break When Mode Change" "切换模式时断开" 14 | "Break When Profile Change" "切换配置时断开" 15 | "Break When Proxy Change" "切换节点时断开" 16 | "Bypass Domain/IPNet" "跳过域名/IP" 17 | "Cancel" "取消" 18 | "Cannot set system proxy" "无法设置系统代理" 19 | "Chains" "链" 20 | "Change information" "修改信息" 21 | "Check" "测试" 22 | "Child Processes" "子进程" 23 | "Choose outbound interface",message:"only works when TAP mode enabled" "选择出站接口",message:"仅在TAP模式开启时生效" 24 | "Clear" "清空" 25 | "Close All" "关闭所有" 26 | "Connected" "已连接" 27 | "Connection Breaking Strategy" "连接断开策略" 28 | "Connection Info" "连接信息" 29 | "Connections" "连接" 30 | "Content" "匹配内容" 31 | "Copy profile" "复制配置" 32 | "Copy proxy setting commands" "复制终端代理命令" 33 | "Core Version" "内核版本" 34 | "Could not connect to Clash Core" "无法连接到 Clash 内核" 35 | "Could not switch to this profile!" "无法切换到此配置文件!错误:" 36 | "Create a new rule" "创建一条新规则" 37 | "Dark" "暗黑" 38 | "Default Icon Path" "默认图标路径" 39 | "Default","Latency","Alphabet" "默认","延迟","字母" 40 | "Destination" "目的地址" 41 | "Detected: " "已检测到:" 42 | "Developer" "开发者" 43 | "Dial [" "对 " 44 | "Direct Mode" "直连模式" 45 | "Disconnected" "未连接" 46 | "Display Type" "显示类型" 47 | "Do not show this dialog anymore" "不再显示此窗口" 48 | "Docs" "文档" 49 | "Domain or IPNet" "域名或IP" 50 | "Download GeoIP database failed with error: " "下载GeoIP数据库时出现错误:" 51 | "Download Speed" "下载速度" 52 | "Download Traffic" "下载流量" 53 | "Download and install (might take a few minutes)" "下载并安装 (可能需要几分钟) " 54 | "Download from a URL" "填入订阅地址" 55 | "Download profile failed with error: " "配置下载失败,错误:" 56 | "Download profile failed with error: HTTP Response Status Code(" "配置下载失败,HTTP响应状态码 ()" 57 | "Download" "下载" 58 | "Download","Copy URL","Cancel" "下载","复制链接","取消" 59 | "Downloading" "下载中..." 60 | "Drag to sort or add to the list on the right." "拖动以排序或添加到右侧列表。" 61 | "Duplicate profile" "创建副本" 62 | "Edit in Text Mode" "文本模式下编辑" 63 | "Edit in text mode" "文本模式下编辑" 64 | "Edit policies" "编辑节点" 65 | "Edit profile information" "编辑配置信息" 66 | "Edit rules" "编辑规则" 67 | "Edit" "编辑" 68 | "Editor" "编辑器" 69 | "Empty log list" "无日志记录" 70 | "Error!" "下载出错!" 71 | "Error" "错误" 72 | "Feedback" "反馈" 73 | "Folder Path" "文件夹路径" 74 | "Follow System Theme" "跟随系统主题" 75 | "Font Family" "字体" 76 | "General YAML" "基础配置文件" 77 | "General" "常规" 78 | "GeoIP Database" "GeoIP 数据库" 79 | "Global Mode" "全局模式" 80 | "Go to URL" "打开链接" 81 | "Group Name" "策略组名称" 82 | "HTTP Port" "HTTP 端口" 83 | "Health Check" "连通性测试" 84 | "Host" "目标节点" 85 | "ICO(.ico) asset path" "图标(.ico)资源路径" 86 | "Ignore this version" "忽略此版本" 87 | "Import" "导入" 88 | "Input a new file name" "输入新的备注" 89 | "Input fields are alternative" "密钥和下载链接择一填入" 90 | "Install" "安装" 91 | "Installing" "安装中" 92 | "Interface Name" "接口名" 93 | "Keep Disconnected" "保留关闭的连接" 94 | "Last Updated: " "上次更新:" 95 | "Latency Test Timeout" "延迟测试超时阈值" 96 | "Latency Test URL" "延迟测试URL" 97 | "Light" "亮白" 98 | "Loading..." "加载中..." 99 | "Log Level" "日志级别" 100 | "Logs" "日志" 101 | "MaxMind User License Key" "MaxMind 用户许可密钥" 102 | "Mixin" "混合模式" 103 | "Mode Change" "切换代理模式" 104 | "Name" "名称" 105 | "Name" "备注" 106 | "New version(" "新版本 (" 107 | "New" "新建" 108 | "No new updates found." "未找到新版本。" 109 | "No provider in this profile." "此配置不包含代理集。" 110 | "No" "取消" 111 | "None","Chain","All" "否","仅链","所有" 112 | "Note" "注意" 113 | "Notifications" "通知" 114 | "OK" "确认" 115 | "Obfs (Optional, tls or http)" "Obfs(可选, tls 或 http)" 116 | "Obfs-host (Optional)" "Obfs-host(可选)" 117 | "Open Folder" "打开文件夹" 118 | "Open logs folder" "打开日志文件夹" 119 | "Open terminal with proxy set up" "打开终端并配置好终端代理" 120 | "Order By" "排序方式" 121 | "Outbound" "出站" 122 | "Override detected value" "覆写检测值" 123 | "PAC Content" "PAC 内容" 124 | "Parsers info" "解析器信息" 125 | "Parsers" "解析器" 126 | "Password (Optional)" "密码(可选)" 127 | "Password" "密码" 128 | "Path" "路径" 129 | "Please confirm" "请确认" 130 | "Port" "端口" 131 | "Processes" "进程" 132 | "Profile Change" "切换配置文件" 133 | "Profile Mixin" "混合配置" 134 | "Profiles folder path" "配置文件路径" 135 | "Profiles" "配置" 136 | "Proxies" "代理" 137 | "Proxy Change" "切换代理节点" 138 | "Proxy Groups" "策略组" 139 | "Proxy Item Width" "节点最小宽度" 140 | "Proxy Name" "节点名称" 141 | "Proxy Providers" "代理集" 142 | "Proxy or Policy" "节点或策略组" 143 | "Record" "录入" 144 | "Release Note:\r\n" "发布记录:\r\n" 145 | "Relevance" "相关链接" 146 | "Remove" "移除" 147 | "Request Headers" "请求头" 148 | "Request Logs" "请求日志" 149 | "Requests in "+e._s(this.mode)+" mode" e._s(this.mode)+" 模式下访问请求" 150 | "Reset All Settings" "重置所有配置项" 151 | "Restarting core..." "内核重启中..." 152 | "Rule Mode" "规则模式" 153 | "Rule" "规则" 154 | "SOCKS5 Port" "SOCKS5 端口" 155 | "Save" "保存" 156 | "Script Mode" "脚本模式" 157 | "Select After Updated" "更新后启用" 158 | "Select a terminal" "选择终端类型" 159 | "Select" "选择" 160 | "Server" "服务器地址" 161 | "Setting DNS..." "设置DNS..." 162 | "Settings" "设置" 163 | "Shortcuts" "快捷键" 164 | "Show Filter" "显示过滤器" 165 | "Show New Version Icon" "有新版本时提醒" 166 | "Silent Mode" "静默模式" 167 | "Skip Cert Verify" "跳过证书验证" 168 | "Sorry" "抱歉" 169 | "Source" "发起者" 170 | "Special Proxies" "特殊节点" 171 | "Start with Windows" "开机启动" 172 | "Start" "开始" 173 | "Stop" "停止" 174 | "Success!" "下载成功!" 175 | "Switching profile failed with status: " "配置文件切换失败,错误:" 176 | "System Proxy Bypass" "系统代理白名单" 177 | "System Proxy On Icon Path" "系统代理开启的图标路径" 178 | "System Proxy" "系统代理" 179 | "TAP Device" "虚拟网卡设备" 180 | "TAP device management" "TAP 设备管理" 181 | "Test latency" "延迟测试" 182 | "Thanks" "鸣谢" 183 | "Theme" "主题" 184 | "Time" "时间" 185 | "Timeout" "超时" 186 | "Top 100 matching rules(" "前一百条匹配规则(总条数:" 187 | "Total: "总共: 188 | "Tray" "托盘" 189 | "Try to repair" "尝试修复错误" 190 | "Type" "匹配类型" 191 | "Type" "类型" 192 | "URL" "地址" 193 | "UUID" "UUID" 194 | "UWP Loopback" "解除UWP回环" 195 | "Uninstalling" "卸载中" 196 | "Update GeoIP database" "更新 GeoIP 数据库" 197 | "Update Interval (hour)" "更新间隔(小时)" 198 | "Update Interval must be an integer" "更新间隔必须是一个整数" 199 | "Update this profile" "更新配置" 200 | "Update" "更新" 201 | "Updating GeoIP database is not allowed in CFW, please do it manually." "无法通过 CFW 更新 GeoIP 数据库,请手动更新并替换文件。" 202 | "Updating... (" "更新中... (" 203 | "Updating... (0%)" "更新中... (0%)" 204 | "Upload Speed" "上传速度" 205 | "Upload Traffic" "上传流量" 206 | "Upload" "上传" 207 | "User Name (Optional)" "用户名(可选)" 208 | "We found a new version for you, install it?" "发现新版本,是否安装?" 209 | "Yes" "确认" 210 | "[ Reset ]" "[ 重置 ]" 211 | "\n Cancel "\n 取消 212 | "\n Content "\n 内容 213 | "\n Last Updated "\n 上次更新 214 | "\n Add "\n 添加 215 | "\n Cancel "\n 取消 216 | "] failed" " 拨号失败" 217 | "check for app update, current: " "检查软件更新,当前版本:" 218 | "config.yaml and country.mmdb will be removed." "config.yaml and country.mmdb 将会被删除。" 219 | "confirm confirm-right" "confirm confirm-right",style:{"white-space":"nowrap"} 220 | "eg: google.com" "例:google.com" 221 | "fail to load general config.yaml with error: " "加载通用配置文件——config.yaml 失败,错误为:" 222 | "first luanch, creating config.yaml..." "初次启动,创建 config.yaml 文件..." 223 | "fiter by keywords" "关键词过滤" 224 | "mode: "模式: 225 | "oops, got an error here" "糟糕,发生了一个错误" 226 | "recording..." "记录中..." 227 | "下载","Copy URL","取消" "下载","复制链接","取消" 228 | Are you sure to delete 你确定要删除 229 | Close All 关闭全部 230 | Home Directory 配置文件目录 231 | If the installation box pops up, keep clicking "Next" until the installation is complete. 如果弹出安装窗口,请继续点击“Next”直到完成安装。 232 | Logs Folder 查看日志文件 233 | Mixin allows you to overwrite the original configuration file. 启用混合模式以覆写原配置文件。 234 | Refresh your browser to make requests. 刷新浏览器以发起请求。 235 | e._v("Launch Helper") e._v("启动") 236 | e._v("Manage") e._v("管理") 237 | e._v("New" e._v("新" 238 | e._v("Text Mode Edit") e._v("编辑") 239 | e._v("\n Launch Helper\n ") e._v("\n 启动\n ") 240 | e._v("\n Manage\n ") e._v("\n 管理\n ") 241 | e._v("\n Open Folder\n ") e._v("\n 打开\n ") 242 | e._v("\n Text Mode Edit\n ") e._v("\n 编辑\n ") 243 | e._v("新建" e._v("新" 244 | i+" had been released" "版本 "+i+" 已发布" 245 | message:'An adapter named "cfw-tap" will route your data into clash. message:'本机数据将会被名为 "cfw-tap" 的网络适配器传递给 Clash 。 246 | title:"Found ".concat(n.length," matching parsers" title:"发现 ".concat(n.length," 个匹配的解析器" 247 | title:"You are awesome",content:"The current version is up to date." title:"你真棒",content:"已经是最新版本。" 248 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | from shutil import copyfile 2 | 3 | dic = {} 4 | copyfile('original_rend.js', 'temp_rend.js') 5 | with open('dic4rend.txt',encoding='utf-8') as d: 6 | for line in d: 7 | (key, val) = line.strip('\n').split('\t') 8 | dic[key] = val 9 | 10 | list = [] 11 | with open('dic4rend.txt', 'r',encoding='utf-8') as f: 12 | for line in f: 13 | list.append(line.strip()) 14 | with open("dic4rend.txt", "w",encoding='utf-8') as f: 15 | for item in sorted(list): 16 | f.writelines(item) 17 | f.writelines('\n') 18 | 19 | with open("temp_rend.js",encoding='utf-8') as r: 20 | newText = r.read() 21 | for key in dic.keys(): 22 | newText = newText.replace(key, dic[key]) 23 | with open("renderer.js", "w",encoding='utf-8') as f: 24 | f.write(newText) 25 | 26 | dicMain = {} 27 | copyfile('original_main.js', 'temp_main.js') 28 | with open('dic4main.txt',encoding='utf-8') as md: 29 | for line in md: 30 | (key, val) = line.strip('\n').split('\t') 31 | dicMain[key] = val 32 | with open("temp_main.js",encoding='utf-8') as mr: 33 | newText = mr.read() 34 | for key in dicMain.keys(): 35 | newText = newText.replace(key, dicMain[key]) 36 | with open("main.js", "w",encoding='utf-8') as mf: 37 | mf.write(newText) -------------------------------------------------------------------------------- /original_main.js: -------------------------------------------------------------------------------- 1 | module.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:r})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,n){if(1&n&&(e=t(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)t.d(r,o,function(t){return e[t]}.bind(null,o));return r},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=5)}([function(e){e.exports=require("electron")},function(e){e.exports=require("path")},function(e,t,n){e.exports=n(6)},function(e){function t(e,t,n,r,o,i,a){try{var c=e[i](a),u=c.value}catch(e){return void n(e)}c.done?t(u):Promise.resolve(u).then(r,o)}e.exports=function(e){return function(){var n=this,r=arguments;return new Promise((function(o,i){function a(e){t(u,o,i,a,c,"next",e)}function c(e){t(u,o,i,a,c,"throw",e)}var u=e.apply(n,r);a(void 0)}))}}},function(e){e.exports=function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}},function(e,t,n){"use strict";function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t,n=1;n