diff --git a/README.md b/README.md index 51a982f..4ef334c 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,9 @@ # GithubCN -> 由于个人精力不足,不再为此项目添加词条内容,如有余力,可 fork 本项目进行词条补充 +> 维护中,已新增1837 条翻译 ,覆盖了 GitHub 上可能出现的绝大多数编程相关英文词汇! Github 浏览器中文汉化插件 -## 安装 && 使用 - -支持的浏览器|使用方式 ----|--- -Edge|[Edge 应用商店]() -Google Chrome|下载源代码拖放至扩展页 - ## 如何补充翻译词条? 所有的翻译内容都在在`src/js/content.js`中 @@ -20,3 +13,1056 @@ const allData = [ [`English`, `英文`], ] ``` +## 更新 +- parse_vocab.py - A-I 部分词汇解析脚本 +- parse_vocab2.py - J-Z + 专业名词部分词汇解析脚本 +- translate_tool.py - 完整的自动化翻译工具(含 API 翻译 + +### 已更新单词 + +### A + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| a block of pointers | 一块指针 | 一组指针 | | +| abbreviation | 缩略语 | | | +| abstract | 抽象的 | | | +| abstract syntax tree, AST | 抽象语法树 | | | +| abstraction | 抽象 | | | +| abstraction barrier | 抽象屏障 | 抽象阻碍 | | +| abstraction of function calls | 函数调用抽象 | | | +| access | 访问 | 存取 | | +| access function | 访问函数 | 存取函数 | | +| accumulator | 累加器 | | | +| activate | 激活 | | | +| ad hoc | 专设 | | | +| adapter | 适配器 | | | +| address | 地址 | | | +| algebraic data type | 代数数据类型 | | | +| algorithm | 算法 | | | +| alias | 别名 | | | +| allocate | 分配 | 配置 | | +| alternative | 备选 | | | +| amortized analysis | 平摊分析 | | | +| anaphoric | 指代 | | | +| annotation | 注解 | | | +| anonymous function | 匿名函数 | | | +| antecedent | 前提 | 前件 | 先决条件 | +| append | 追加 | 拼接 | | +| application | 应用 | 应用程序 | | +| application framework | 应用框架 | | | +| application program interface, API | 应用程序编程接口 | | | +| application service provider, ASP | 应用程序服务提供商 | | | +| applicative | 应用序 | | | +| argument | 参数 | 自变量 | 实际参数/实参 | +| arithmetic | 算术 | | | +| array | 数组 | | | +| artificial intelligence, AI | 人工智能 | | | +| assemble | 组合 | | | +| assembly | 汇编 | | | +| assignment | 赋值 | | | +| assignment operator | 赋值操作符 | | | +| associated | 关联的 | | | +| association list, alist | 关联列表 | | | +| atom | 原子 | | | +| atomic | 原子的 | | | +| atomic value | 原子型值 | | | +| attribute | 属性 | 特性 | | +| augmented | 扩充 | | | +| automatic memory management | 自动内存管理 | | | +| automatically infer | 自动推导 | | | +| autometa theory | 自动机理论 | | | +| auxiliary | 辅助 | | | + +### B + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| backquote | 反引用 | | | +| backtrace | 回溯 | | | +| backward compatible | 向下兼容 | | | +| bandwidth | 带宽 | | | +| base case | 基本情形 | | | +| base class | 基类 | | | +| Bayes' theorem | 贝叶斯定理 | | | +| best viable function | 最佳可行函式 | 最佳可行函数 | | +| Bezier curve | 贝塞尔曲线 | | | +| bignum | 大数 | | | +| binary operator | 二元操作符 | | | +| binary search | 二分查找 | 二分搜索 | 二叉搜索 | +| binary search tree | 二叉搜索树 | | | +| binary tree | 二叉树 | | | +| binding | 绑定 | | | +| binding vector | 绑定向量 | | | +| bit | 位 | 比特 | | +| bit manipulation | 位操作 | | | +| black box abstraction | 黑箱抽象 | | | +| block | 块 | 区块 | | +| block structure | 块结构 | 区块结构 | | +| block name | 代码块名字 | | | +| Blub paradox | Blub 困境 | | | +| body | 体 | 主体 | | +| boilerplate | 公式化 | 样板 | | +| bookkeeping | 簿记 | | | +| boolean | 布尔 | | | +| border | 边框 | | | +| bottom-up design | 自底向上的设计 | | | +| bottom-up programming | 自底向上编程 | | | +| bound | 边界 | | | +| bounds checking | 边界检查 | | | +| box notation | 箱子表示法 | | | +| brace | 花括弧 | 花括号 | | +| bracket | 方括弧 | 方括号 | | +| branch | 分支 | 跳转 | | +| breadth-first | 广度优先 | | | +| breadth-first search, BFS | 广度优先搜索 | | | +| breakpoint | 断点 | | | +| brevity | 简洁 | | | +| buffer | 缓冲区 | | | +| buffer overflow attack | 缓冲区溢出攻击 | | | +| bug | 臭虫 | | | +| building | 创建 | | | +| built-in | 内置 | | | +| byte | 字节 | | | +| bytecode | 字节码 | | | + +### C + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| cache | 缓存 | | | +| call | 调用 | | | +| callback | 回调 | | | +| CamelCase | 驼峰式大小写 | | | +| candidate function | 候选函数 | | | +| capture | 捕捉 | | | +| case | 分支 | | | +| character | 字符 | | | +| checksum | 校验和 | | | +| child class | 子类 | | | +| choke point | 滞塞点 | | | +| chunk | 块 | | | +| circular definition | 循环定义 | | | +| clarity | 清晰 | | | +| class | 类 | 类别 | | +| class declaration | 类声明 | | | +| class library | 类库 | | | +| client | 客户 | 客户端 | | +| clipboard | 剪贴板 | | | +| clone | 克隆 | | | +| closed world assumption | 封闭世界假定 | | | +| closure | 闭包 | | | +| clutter | 杂乱 | | | +| code | 代码 | | | +| code bloat | 代码膨胀 | | | +| collection | 收集器 | 复合类型 | | +| column | 行 | 栏 | | +| column-major order | 行主序 | | | +| comma | 逗号 | | | +| command-line | 命令行 | | | +| command-line interface, CLI | 命令行界面 | | | +| Common Lisp Object System, CLOS | Common Lisp 对象系统 | | | +| Common Gateway Interface, CGI | 通用网关接口 | | | +| compatible | 兼容 | | | +| compilation | 编译 | | | +| compilation parameter | 编译参数 | | | +| compile | 编译 | | | +| compile inline | 内联编译 | | | +| compile time | 编译期 | | | +| compiled form | 编译后的形式 | | | +| compiler | 编译器 | | | +| complex | 复杂 | | | +| complexity | 复杂度 | | | +| compliment | 补集 | | | +| component | 组件 | | | +| composability | 可组合性 | | | +| composition | 组合 | 组合函数 | | +| compound value | 复合数据 | 复合值 | | +| compression | 压缩 | | | +| computation | 计算 | | | +| computer | 计算机 | | | +| concatenation | 串接 | | | +| concept | 概念 | | | +| concrete | 具体 | | | +| concurrency | 并发 | | | +| concurrent | 并发 | | | +| conditional | 条件式 | | | +| conditional variable | 条件变量 | | | +| configuration | 配置 | | | +| connection | 连接 | | | +| cons | 构造 | | | +| cons cell | 构元 | cons 单元 | | +| consequent | 结果 | 推论 | | +| consistent | 一致性 | | | +| constant | 常量 | | | +| constraint | 约束 | | | +| constraint programming | 约束式编程 | | | +| container | 容器 | | | +| content-based filtering | 基于内容的过滤 | | | +| context | 上下文 | 语境 | 环境 | +| continuation | 延续性 | | | +| continuous integration, CI | 持续集成 | | | +| control | 控件 | | | +| cooperative multitasking | 协作式多任务 | | | +| copy | 拷贝 | | | +| corollary | 推论 | | | +| coroutine | 协程 | | | +| corruption | 程序崩溃 | | | +| crash | 崩溃 | | | +| create | 创建 | | | +| crystallize | 固化 | | | +| curly | 括弧状的 | | | +| curried | 柯里的 | | | +| currying | 柯里化 | | | +| cursor | 光标 | | | +| curvy | 卷曲的 | | | +| cycle | 周期 | | | + +### D + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| dangling pointer | 迷途指针 | 野指针 | | +| Defense Advanced Research Projects Agency, DARPA | 美国国防部高级研究计划局 | | | +| data | 数据 | | | +| data structure | 数据结构 | | | +| data type | 数据类型 | | | +| data-driven | 数据驱动 | | | +| database | 数据库 | | | +| database schema | 数据库模式 | | | +| datagram | 数据报文 | | | +| dead lock | 死锁 | | | +| debug | 调试 | | | +| debugger | 调试器 | | | +| debugging | 调试 | | | +| declaration | 声明 | | | +| declaration forms | 声明形式 | | | +| declarative | 声明式 | 说明式 | | +| declarative knowledge | 声明式知识 | 说明式知识 | | +| declarative programming | 声明式编程 | 说明式编程 | | +| declarativeness | 可声明性 | | | +| declaring | 声明 | | | +| deconstruction | 解构 | | | +| deduction | 推导 | 推断 | | +| default | 缺省 | 默认 | | +| defer | 推迟 | | | +| deficiency | 缺陷 | 不足 | | +| define | 定义 | | | +| definition | 定义 | | | +| delegate | 委托 | | | +| dellocate | 释放 | | | +| demarshal | 散集 | | | +| deprecated | 废弃 | | | +| depth-first | 深度优先 | | | +| depth-first search, BFS | 深度优先搜索 | | | +| derived | 派生 | | | +| derived class | 派生类 | | | +| design pattern | 设计模式 | | | +| designator | 指示符 | | | +| destructive | 破坏性的 | | | +| destructive function | 破坏性函数 | | | +| destructuring | 解构 | | | +| device driver | 硬件驱动程序 | | | +| dimensions | 维度 | | | +| directive | 指令 | | | +| directory | 目录 | | | +| disk | 盘 | | | +| dispatch | 分派 | 派发 | | +| distributed computing | 分布式计算 | | | +| DLL hell | DLL 地狱 | | | +| document | 文档 | | | +| dotted list | 点状列表 | | | +| dotted-pair notation | 带点尾部表示法 | 带点尾部记法 | | +| duplicate | 复本 | | | +| dynamic binding | 动态绑定 | | | +| dynamic extent | 动态范围 | | | +| dynamic languages | 动态语言 | | | +| dynamic scope | 动态作用域 | | | +| dynamic type | 动态类型 | | | + +### E + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| effect | 效果 | | | +| efficiency | 效率 | | | +| efficient | 高效 | | | +| embedded language | 嵌入式语言 | | | +| emulate | 仿真 | | | +| encapsulation | 封装 | | | +| enum | 枚举 | | | +| enumeration type | 枚举类型 | | | +| enumrators | 枚举器 | | | +| environment | 环境 | | | +| equal | 相等 | | | +| equality | 相等性 | | | +| equation | 方程 | | | +| equivalence | 等价性 | | | +| error message | 错误信息 | | | +| error-checking | 错误检查 | | | +| escaped | 逃脱 | 溢出 | | +| escape character | 转义字符 | | | +| evaluate | 求值 | 评估 | | +| evaluation | 求值 | | | +| event | 事件 | | | +| event driven | 事件驱动 | | | +| exception | 异常 | | | +| exception handling | 异常处理 | | | +| exception specification | 异常规范 | | | +| exit | 退出 | | | +| expendable | 可扩展的 | | | +| explicit | 显式 | | | +| exploratory programming | 探索式编程 | | | +| export | 导出 | 引出 | | +| expression | 表达式 | | | +| expressive power | 表达能力 | | | +| extensibility | 可扩展性 | | | +| extent | 范围 | 程度 | | +| external representation | 外部表示法 | | | +| extreme programming | 极限编程 | | | + +### F + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| factorial | 阶乘 | | | +| family | (类型的)系 | | | +| feasible | 可行的 | | | +| feature | 特色 | | | +| field | 字段 | 栏位 | | +| file | 文件 | | | +| file handle | 文件句柄 | | | +| fill pointer | 填充指针 | | | +| fineo-grained | 细粒度 | | | +| firmware | 固件 | | | +| first-class | 第一类的 | 第一级的 | 一等的 | +| first-class function | 第一级函数 | 第一类函数 | 一等函数 | +| first-class object | 第一类的对象 | 第一级的对象 | 一等公民 | +| fixed-point | 不动点 | | | +| fixnum | 定长数 | 定点数 | | +| flag | 标记 | | | +| flash | 闪存 | | | +| flexibility | 灵活性 | | | +| floating-point | 浮点数 | | | +| floating-point notation | 浮点数表示法 | | | +| flush | 刷新 | | | +| fold | 折叠 | | | +| font | 字体 | | | +| force | 迫使 | | | +| form | 形式 | | | +| form | 表单 | | | +| formal parameter | 形参 | | | +| formal relation | 形式关系 | | | +| forward | 转发 | | | +| fractal | 分形 | | | +| fractions | 派系 | | | +| framework | 框架 | | | +| freeware | 自由软件 | | | +| function | 函数 | | | +| function literal | 函数字面常量 | | | +| function object | 函数对象 | | | +| functional arguments | 函数型参数 | | | +| functional programming | 函数式编程 | | | +| functionality | 功能性 | | | + +### G + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| game | 游戏 | | | +| garbage | 垃圾 | | | +| garbage collection | 垃圾回收 | | | +| garbage collector | 垃圾回收器 | | | +| generalized | 泛化 | | | +| generalized variable | 广义变量 | | | +| generate | 生成 | | | +| generator | 生成器 | | | +| generic | 通用的 | 泛化的 | | +| generic algorithm | 通用算法 | 泛型算法 | | +| generic function | 通用函数 | | | +| generic programming | 通用编程 | 泛型编程 | | +| genrative programming | 生产式编程 | | | +| global | 全局的 | | | +| global declaration | 全局声明 | | | +| glue program | 胶水程序 | | | +| goto | 跳转 | | | +| graphical user interface, GUI | 图形用户界面 | | | +| greatest common divisor | 最大公因数 | | | +| Greenspun's tenth rule | 格林斯潘第十定律 | | | + +### H + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| hack | 破解 | | | +| hacker | 黑客 | | | +| handle | 处理器 | 处理程序 | 句柄 | +| hard disk | 硬盘 | | | +| hardware | 硬件 | | | +| hash tables | 哈希表 | 散列表 | | +| header | 头部 | | | +| header file | 头文件 | | | +| heap | 堆 | | | +| helper | 辅助函数 | 辅助方法 | | +| heuristic | 启发式 | | | +| high-order | 高阶 | | | +| higher-order function | 高阶函数 | | | +| higher-order procedure | 高阶过程 | | | +| hyperlink | 超链接 | | | +| HyperText Markup Language, HTML | 超文本标记语言 | | | +| HyperText Transfer Protocol, HTTP | 超文本传输协议 | | | + +### I + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| identical | 一致 | | | +| identifier | 标识符 | | | +| identity | 同一性 | | | +| ill type | 类型不正确 | | | +| illusion | 错觉 | | | +| imperative | 命令式 | | | +| imperative programming | 命令式编程 | | | +| implement | 实现 | | | +| implementation | 实现 | | | +| implicit | 隐式 | | | +| import | 导入 | | | +| incremental testing | 增量测试 | | | +| indent | 缩排 | 缩进 | | +| indentation | 缩排 | 缩进 | | +| indented | 缩排 | 缩进 | | +| indention | 缩排 | 缩进 | | +| infer | 推导 | | | +| infinite loop | 无限循环 | | | +| infinite recursion | 无限递归 | | | +| infinite precision | 无限精度 | | | +| infix | 中序 | | | +| information | 信息 | | | +| information technology, IT | 信息技术 | | | +| inheritance | 继承 | | | +| initialization | 初始化 | | | +| initialize | 初始化 | | | +| inline | 内联 | | | +| inline expansion | 内联展开 | | | +| inner class | 内嵌类 | | | +| inner loop | 内层循环 | | | +| input | 输入 | | | +| instances | 实例 | | | +| instantiate | 实例化 | | | +| instructive | 教学性的 | | | +| instrument | 记录仪 | | | +### J + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| Java applet | Java 小程序 | | | +| JavaScript | JavaScript | | | +| join | 联合 | 连接 | | +| jump | 跳转 | | | +| just in time, JIT | 即时编译 | | | + +### K + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| keyword | 关键字 | | | +| knapsack problem | 背包问题 | | | + +### L + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| lambda calculus | lambda 演算 | | | +| lambda expression | lambda 表达式 | | | +| language | 语言 | | | +| lazy evaluation | 惰性求值 | 懒求值 | | +| leaf | 叶 | 叶子 | | +| left child | 左子节点 | | | +| left subtree | 左子树 | | | +| level | 层 | 级 | | +| lexical | 词法 | | | +| lexical address | 词法地址 | | | +| lexical scoping | 词法作用域 | | | +| library | 库 | 程序库 | | +| life cycle | 生命周期 | | | +| lifetime | 生命期 | | | +| Lisp | Lisp 语言 | | | +| list | 表 | 列表 | | +| list structure | 表结构 | | | +| literal | 字面常量 | 字面量 | | +| load | 加载 | | | +| loader | 加载器 | | | +| local | 局部的 | | | +| local declaration | 局部声明 | | | +| local variable | 局部变量 | | | +| logic programming | 逻辑式编程 | | | +| loop | 循环 | | | +| lower bound | 下界 | | | + +### M + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| machine | 机器 | | | +| machine code | 机器码 | | | +| machine language | 机器语言 | | | +| macro | 宏 | | | +| macro expansion | 宏展开 | | | +| mail | 邮件 | | | +| main | 主 | | | +| maintainability | 可维护性 | | | +| management | 管理 | | | +| manifest | 清单 | | | +| mantissa | 尾数 | | | +| map | 映射 | | | +| matrix | 矩阵 | | | +| mean | 均值 | | | +| member | 成员 | | | +| member function | 成员函数 | | | +| memory | 内存 | 存储器 | | +| message | 消息 | | | +| message passing | 消息传递 | | | +| meta | 元 | | | +| meta-language | 元语言 | | | +| meta-circular evaluator | 元循环求值器 | | | +| method | 方法 | | | +| metric | 度量 | | | +| microcode | 微码 | | | +| middle-out | 中间展开 | | | +| milestone | 里程碑 | | | +| millennium bug | 千年虫 | | | +| minimum | 最小值 | 极小值 | | +| mirror | 镜像 | | | +| miscellaneous | 杂项 | 其他 | | +| modeling | 建模 | | | +| modeling language | 建模语言 | | | +| modem | 调制解调器 | | | +| modification | 修改 | | | +| module | 模块 | | | +| monad | 单子 | | | +| monolithic | 单体的 | | | +| morphism | 态射 | | | +| most general unifier | 最广合一子 | | | +| mouse | 鼠标 | | | +| multi-method | 多方法 | | | +| multiple inheritance | 多重继承 | | | +| multiprocessing | 多处理 | | | +| multiprogramming | 多道程序设计 | | | +| multitasking | 多任务 | | | +| multithreading | 多线程 | | | +| mutation | 突变 | | | +| mutual recursion | 相互递归 | | | + +### N + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| name | 名字 | 名称 | | +| namespace | 名字空间 | 命名空间 | | +| native | 原生的 | 本地 | | +| natural language | 自然语言 | | | +| network | 网络 | | | +| neural network | 神经网络 | | | +| node | 节点 | | | +| non-deterministic | 非确定性的 | | | +| non-modifying | 非修改的 | | | +| non-terminating | 不终止的 | | | +| normal form | 范式 | | | +| normalization | 规范化 | | | +| normalization by evaluation | 求值归一化 | | | +| notation | 表示法 | 记法 | | +| null | 空 | | | +| null pointer | 空指针 | | | +| number | 数值 | 数字 | | +| numeric | 数值的 | | | +| numerical analysis | 数值分析 | | | +| n-ary | n元 | | | +| nybble | 半字节 | | | + +### O + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| object | 对象 | | | +| object code | 目标码 | | | +| object language | 目标语言 | | | +| object-oriented | 面向对象 | | | +| object-oriented programming, OOP | 面向对象编程 | | | +| observe | 观测 | | | +| obsolete | 过时 | 废弃 | | +| occurrence | 出现 | 发生 | | +| octal | 八进制 | | | +| open | 打开 | 开放 | | +| open world assumption | 开放世界假定 | | | +| operand | 操作数 | 运算对象 | | +| operating system, OS | 操作系统 | | | +| operation | 操作 | 运算 | | +| operator | 操作符 | 运算符 | | +| opportunistic | 机会式 | | | +| optimize | 优化 | | | +| order | 阶 | 序 | | +| ordering | 排序 | | | +| origin | 原点 | 起源 | | +| orthogonality | 正交性 | | | +| out of band | 带外 | | | +| output | 输出 | | | +| overflow | 溢出 | 上溢 | | +| overload | 重载 | | | +| overloading | 重载 | | | +| overriding | 覆盖 | 重写 | | + +### P + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| package | 包 | | | +| padding | 填充 | | | +| palindrome | 回文 | | | +| parallel | 并行的 | | | +| parallelism | 并行性 | | | +| parameter | 参数 | 形式参数 | 形参 | +| parent | 父节点 | | | +| parent class | 父类 | | | +| parse | 语法分析 | 解析 | | +| parser | 语法分析器 | 解析器 | | +| partial | 部分的 | 偏 | | +| partial application | 部分应用 | 偏应用 | | +| partial function | 部分函数 | 偏函数 | | +| partition | 分区 | 划分 | | +| pass | 传递 | | | +| pass by reference | 引用传递 | | | +| pass by value | 值传递 | | | +| password | 口令 | 密码 | | +| path | 路径 | | | +| pattern | 模式 | | | +| pattern matching | 模式匹配 | | | +| payload | 有效载荷 | | | +| peek | 查看 | | | +| performance | 性能 | 表现 | | +| peripheral | 外设 | 外围设备 | | +| persistence | 持久化 | | | +| persistent | 持久的 | | | +| personal computer, PC | 个人计算机 | | | +| phase | 阶段 | | | +| pixel | 像素 | | | +| place | 位 | 位置 | | +| plain text | 明文 | | | +| platform | 平台 | | | +| pointer | 指针 | | | +| polymorphism | 多态 | | | +| pop | 弹出 | | | +| port | 端口 | | | +| portable | 可移植的 | | | +| portability | 可移植性 | | | +| position | 位置 | | | +| postfix | 后缀 | | | +| precedence | 优先级 | | | +| precision | 精度 | | | +| predicate | 谓词 | | | +| prefix | 前缀 | | | +| preorder | 前序 | | | +| preprocessor | 预处理器 | | | +| presentation | 表示 | 展现 | | +| primitive | 基本的 | 原语 | 基元 | +| print | 打印 | | | +| printer | 打印机 | | | +| priority | 优先级 | | | +| private | 私有 | | | +| probe | 探查 | | | +| procedure | 过程 | | | +| process | 进程 | 处理 | | +| processor | 处理器 | | | +| product | 乘积 | 积 | | +| program | 程序 | | | +| program counter | 程序计数器 | | | +| programmable | 可编程的 | | | +| programming | 编程 | 程序设计 | | +| programming language | 程序设计语言 | 编程语言 | | +| project | 项目 | 工程 | | +| projection | 投影 | | | +| protocol | 协议 | | | +| pseudo | 伪 | | | +| pseudo-code | 伪代码 | | | +| public | 公有 | | | +| push | 压入 | | | +| polymorphic | 多态的 | | | +| pipeline | 流水线 | 管道 | | +| pipe | 管道 | | | + +### Q + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| qualified | 受限的 | 限定的 | | +| quantifier | 量词 | | | +| query | 查询 | | | +| queue | 队列 | | | +| quicksort | 快速排序 | | | + +### R + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| race condition | 竞态条件 | | | +| radix | 基数 | | | +| random | 随机 | | | +| random access memory, RAM | 随机存取存储器 | | | +| range | 范围 | | | +| rank | 秩 | | | +| rational | 有理的 | | | +| read | 读 | 读取 | | +| read only memory, ROM | 只读存储器 | | | +| reader | 读取器 | | | +| record | 记录 | | | +| recursion | 递归 | | | +| recursive | 递归的 | | | +| redirect | 重定向 | | | +| reduce | 归约 | | | +| reduction | 归约 | | | +| redundant | 冗余 | | | +| reference | 引用 | 参考 | | +| reflection | 反射 | | | +| refresh | 刷新 | | | +| register | 寄存器 | | | +| regular expression | 正则表达式 | | | +| relational | 关系的 | | | +| release | 发布 | 释放 | | +| reliability | 可靠性 | | | +| relocatable | 可重定位的 | | | +| rem | 余 | 取余 | | +| remote | 远程 | | | +| repair | 修复 | | | +| repeat | 重复 | | | +| repetition | 重复 | 循环 | | +| representation | 表示法 | 表示 | | +| requirement | 需求 | 要求 | | +| reserved word | 保留字 | | | +| resolution | 分辨率 | 归结 | | +| resolver | 解析器 | | | +| resource | 资源 | | | +| response | 响应 | | | +| restoration | 恢复 | | | +| restricted | 受限的 | | | +| result | 结果 | | | +| return | 返回 | | | +| reverse | 反转 | 倒序 | | +| right child | 右子节点 | | | +| right subtree | 右子树 | | | +| root | 根 | | | +| rotate | 旋转 | | | +| round | 舍入 | | | +| round off | 四舍五入 | | | +| route | 路由 | | | +| router | 路由器 | | | +| routine | 例程 | | | +| row | 列 | 行 | | +| row-major order | 列主序 | | | +| RPC | 远程过程调用 | | | +| rule | 规则 | | | +| runtime | 运行时 | 执行期 | | + +### S + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| sandbox | 沙箱 | | | +| scalar | 标量 | | | +| scope | 作用域 | 范围 | | +| search | 搜索 | 查找 | | +| security | 安全性 | 安全 | | +| seed | 种子 | | | +| segment | 段 | 分段 | | +| selection | 选择 | | | +| semantic | 语义 | | | +| semantics | 语义学 | 语义 | | +| sentinel | 哨兵 | | | +| sequence | 序列 | | | +| sequential | 顺序的 | 串行的 | | +| serial | 串行 | | | +| server | 服务器 | | | +| service | 服务 | | | +| session | 会话 | | | +| set | 集合 | | | +| setter | 设置器 | | | +| shadow | 遮蔽 | | | +| shared | 共享的 | | | +| shell | 外壳 | 命令行 | | +| shift | 移位 | 偏移 | | +| shortcut | 快捷方式 | | | +| sibling | 兄弟节点 | | | +| side effect | 副作用 | | | +| signal | 信号 | | | +| signature | 签名 | 特征 | | +| simulation | 模拟 | 仿真 | | +| singleton | 单例 | | | +| size | 大小 | 尺寸 | | +| slice | 切片 | | | +| small talk | 聊天 | | | +| socket | 套接字 | | | +| software | 软件 | | | +| source | 源 | 来源 | | +| source code | 源代码 | | | +| source language | 源语言 | | | +| specialization | 特化 | | | +| stack | 栈 | 堆栈 | | +| stack overflow | 栈溢出 | | | +| statement | 语句 | 陈述 | | +| static | 静态的 | | | +| static binding | 静态绑定 | | | +| static scope | 静态作用域 | | | +| static type | 静态类型 | | | +| status | 状态 | | | +| step | 步骤 | 步长 | | +| storage | 存储 | | | +| stream | 流 | | | +| string | 字符串 | | | +| structure | 结构 | | | +| structured programming | 结构化编程 | | | +| subclass | 子类 | | | +| subexpression | 子表达式 | | | +| subroutine | 子例程 | | | +| subschema | 子模式 | | | +| subsequence | 子序列 | | | +| subset | 子集 | | | +| substitution | 代入 | 替换 | | +| subtype | 子类型 | | | +| subtree | 子树 | | | +| superclass | 超类 | 父类 | | +| support | 支持 | | | +| symbol | 符号 | | | +| syntax | 语法 | | | +| system | 系统 | | | +| system call | 系统调用 | | | + +### T + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| tail | 尾 | 尾部 | | +| tail recursion | 尾递归 | | | +| target | 目标 | | | +| task | 任务 | | | +| template | 模板 | | | +| terminal | 终端 | | | +| terminating | 终止的 | | | +| termination | 终止 | 结束 | | +| term rewriting system | 项重写系统 | | | +| test | 测试 | | | +| testing | 测试 | | | +| text | 文本 | 正文 | | +| theorem | 定理 | | | +| theory | 理论 | | | +| thread | 线程 | | | +| throw | 抛出 | 扔 | | +| time | 时间 | | | +| time-sharing | 分时 | | | +| timeout | 超时 | | | +| timestamp | 时间戳 | | | +| token | 令牌 | 词法单元 | | +| top-down | 自顶向下 | | | +| top-down programming | 自顶向下编程 | | | +| topic | 主题 | 话题 | | +| trailing | 尾部 | 后随 | | +| transaction | 事务 | | | +| transfer | 传送 | 转移 | | +| transform | 变换 | | | +| transformation | 变换 | 转换 | | +| transition | 过渡 | 变迁 | | +| translation | 翻译 | 平移 | | +| transmission | 传输 | 传送 | | +| transparent | 透明 | | | +| tree | 树 | | | +| traversal | 遍历 | | | +| traverse | 遍历 | | | +| tuple | 元组 | | | +| Turing machine | 图灵机 | | | +| type | 类型 | | | +| type checking | 类型检查 | | | +| type constructor | 类型构造器 | | | +| type error | 类型错误 | | | +| type inference | 类型推导 | | | +| type system | 类型系统 | | | +| typo | 笔误 | 打印错误 | | + +### U + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| unary | 一元 | | | +| unbound | 未绑定 | | | +| undefined | 未定义 | | | +| underflow | 下溢 | | | +| unification | 合一 | 统一 | | +| uniform | 一致的 | 均匀 | | +| union | 并集 | 联合 | | +| unique | 唯一的 | 独特的 | | +| unit | 单元 | | | +| unit test | 单元测试 | | | +| universe | 论域 | 宇宙 | | +| Unix | Unix 操作系统 | | | +| unload | 卸载 | | | +| unlock | 解锁 | | | +| unpack | 解包 | | | +| unsigned | 无符号 | | | +| untyped | 无类型 | | | +| update | 更新 | | | +| upgrade | 升级 | | | +| upload | 上传 | | | +| URI | 统一资源标识符 | | | +|网站| 统一资源定位符 | | | +| usability | 可用性 | | | +| use case | 用例 | | | +| user | 用户 | | | +| user interface, UI | 用户界面 | | | +| utility | 实用工具 | 实用程序 | | + +### V + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| valid | 有效的 | | | +| validate | 验证 | | | +| value | 值 | 数值 | | +| variable | 变量 | | | +| variance | 协变 | 变体 | | +| vector | 向量 | | | +| verbose | 啰嗦 | 冗长 | | +| verify | 验证 | 校验 | | +| version | 版本 | | | +| vertex | 顶点 | | | +| vertical | 垂直的 | | | +| VGA | 视频图形阵列 | | | +| virtual | 虚拟的 | | | +| virtual function | 虚函数 | | | +| virtual machine | 虚拟机 | | | +| virtual memory | 虚拟内存 | | | +| virus | 病毒 | | | +| visibility | 可见性 | | | +| visitor | 访问者 | | | +| volatile | 易失的 | 不稳定的 | | +| volume | 卷 | 音量 | | + +### W + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| walk | 遍历 | 走查 | | +| whitespace | 空白 | | | +| wide | 宽的 | | | +| widget | 小部件 | 组件 | | +| window | 窗口 | | | +| wireless | 无线 | | | +| word | 字 | 单词 | | +| workstation | 工作站 | | | +| wrapper | 包装器 | | | +| write | 写 | 写入 | | + +### X + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| XML | 可扩展标记语言 | | | + +### Y + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| yacc | yacc 编译器 | | | + +### Z + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| zero | 零 | | | +| zip | 压缩 | 拉链 | | + +### 专业名词 + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| A* search algorithm | A*搜索算法 | | | +| abstract data type, ADT | 抽象数据类型 | | | +| American National Standards Institute, ANSI | 美国国家标准学会 | | | +| Advanced Research Projects Agency Network, ARPANET | 阿帕网 | | | +| American Standard Code for Information Interchange, ASCII | 美国信息交换标准码 | | | +| Asynchronous JavaScript and XML, AJAX | 异步 JavaScript 和 XML | | | +| binary-coded decimal, BCD | 二进制编码的十进制 | | | +| Basic Combined Programming Language, BCPL | 基本组合编程语言 | | | +| Berkeley Software Distribution, BSD | 伯克利软件发行版 | | | +| Business Software Alliance, BSA | 商业软件联盟 | | | +| Canadian National Standard, CNS | 中国国家标准 | | | +| Centronics | Centronics 接口 | | | +| Common Business-Oriented Language, COBOL | 面向商业的通用语言 | | | +| Common Object Request Broker Architecture, CORBA | 公共对象请求代理体系结构 | | | +| Compact Disc Read-Only Memory, CD-ROM | 只读光盘 | | | +| Computer Aided Design, CAD | 计算机辅助设计 | | | +| Computer Aided Manufacturing, CAM | 计算机辅助制造 | | | +| Computer Aided Software Engineering, CASE | 计算机辅助软件工程 | | | +| Computer Science, CS | 计算机科学 | | | +| Computer Supported Cooperative Work, CSCW | 计算机支持的协同工作 | | | +| Digital Video Disc, DVD | 数字视频光盘 | | | +| Electronic Numerical Integrator and Computer, ENIAC | 电子数字积分计算机 | | | +| European Organization for Nuclear Research, CERN | 欧洲核子研究组织 | | | +| Extensible Markup Language, XML | 可扩展标记语言 | | | +| Extensible Stylesheet Language, XSL | 可扩展样式表语言 | | | +| File Transfer Protocol, FTP | 文件传输协议 | | | +| Free Software Foundation, FSF | 自由软件基金会 | | | +| GNU General Public License, GPL | GNU 通用公共许可证 | | | +| GNU's Not Unix, GNU | GNU 项目 | | | +| Graphical User Interface, GUI | 图形用户界面 | | | +| HyperText Markup Language, HTML | 超文本标记语言 | | | +| HyperText Transfer Protocol, HTTP | 超文本传输协议 | | | +| Institute of Electrical and Electronics Engineers, IEEE | 电气和电子工程师协会 | | | +| International Business Machines, IBM | 国际商业机器公司 | | | +| International Organization for Standardization, ISO | 国际标准化组织 | | | +| Internet Corporation for Assigned Names and Numbers, ICANN | 互联网名称与数字地址分配机构 | | | +| Internet Message Access Protocol, IMAP | 互联网消息访问协议 | | | +| Internet Protocol, IP | 网际协议 | | | +| Internet Service Provider, ISP | 互联网服务提供商 | | | +| Java 2 Platform Enterprise Edition, J2EE | Java 2 平台企业版 | | | +| Java 2 Platform Micro Edition, J2ME | Java 2 平台微型版 | | | +| Java 2 Platform Standard Edition, J2SE | Java 2 平台标准版 | | | +| JavaScript Object Notation, JSON | JavaScript 对象表示法 | | | +| Local Area Network, LAN | 局域网 | | | +| Massachusetts Institute of Technology, MIT | 麻省理工学院 | | | +| Metropolitan Area Network, MAN | 城域网 | | | +| Microsoft Foundation Classes, MFC | 微软基础类库 | | | +| Multipurpose Internet Mail Extensions, MIME | 多用途互联网邮件扩展 | | | +| MySQL | MySQL 数据库 | | | +| National Institute of Standards and Technology, NIST | 美国国家标准与技术研究院 | | | +| Object Management Group, OMG | 对象管理组织 | | | +| Object Relational Mapping, ORM | 对象关系映射 | | | +| Open Database Connectivity, ODBC | 开放数据库连接 | | | +| Open Source Initiative, OSI | 开源计划 | | | +| Open Systems Interconnection, OSI | 开放系统互连 | | | +| Open Virtualization Format, OVF | 开放虚拟化格式 | | | +| Perl | Perl 语言 | | | +| PHP: Hypertext Preprocessor, PHP | PHP 语言 | | | +| Point-to-Point Protocol, PPP | 点对点协议 | | | +| Post Office Protocol version 3, POP3 | 邮局协议版本 3 | | | +| Python | Python 语言 | | | +| Query Language, QL | 查询语言 | | | +| Rapid Application Development, RAD | 快速应用开发 | | | +| Ruby | Ruby 语言 | | | +| Structured Query Language, SQL | 结构化查询语言 | | | +| Transmission Control Protocol, TCP | 传输控制协议 | | | +| Transport Layer Security, TLS | 传输层安全 | | | +| Uniform Resource Identifier, URI | 统一资源标识符 | | | +| Uniform Resource Locator, URL | 统一资源定位符 | | | +| Universal Serial Bus, USB | 通用串行总线 | | | +| Unix-like | 类 Unix | | | +| Visual Basic, VB | Visual Basic 语言 | | | +| Virtual Reality, VR | 虚拟现实 | | | +| Visual Studio, VS | Visual Studio | | | +| Wide Area Network, WAN | 广域网 | | | +| Wireless Application Protocol, WAP | 无线应用协议 | | | +| Wireless Local Area Network, WLAN | 无线局域网 | | | +| World Wide Web, WWW | 万维网 | | | +| eXtensible Business Reporting Language, XBRL | 可扩展商业报告语言 | | | +| eXtensible Markup Language, XML | 可扩展标记语言 | | | +| eXtensible Stylesheet Language Transformations, XSLT | 可扩展样式表语言转换 | | | +| Zend Engine | Zend 引擎 | | | + +### 以上即为这次更新的主要单词,还有三百多个是之前更新的 +### 更新单词主要来源CSDN与github词汇库 +### 翻译则是由豆包AI翻译(毕竟我哪记得住这么多单词) diff --git a/parse_vocab.py b/parse_vocab.py new file mode 100644 index 0000000..935e048 --- /dev/null +++ b/parse_vocab.py @@ -0,0 +1,553 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +从 markdown 词汇表解析并添加到 content.js +""" + +import re +import json +from pathlib import Path + +VOCAB_DATA = """ +### A + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| a block of pointers | 一块指针 | 一组指针 | | +| abbreviation | 缩略语 | | | +| abstract | 抽象的 | | | +| abstract syntax tree, AST | 抽象语法树 | | | +| abstraction | 抽象 | | | +| abstraction barrier | 抽象屏障 | 抽象阻碍 | | +| abstraction of function calls | 函数调用抽象 | | | +| access | 访问 | 存取 | | +| access function | 访问函数 | 存取函数 | | +| accumulator | 累加器 | | | +| activate | 激活 | | | +| ad hoc | 专设 | | | +| adapter | 适配器 | | | +| address | 地址 | | | +| algebraic data type | 代数数据类型 | | | +| algorithm | 算法 | | | +| alias | 别名 | | | +| allocate | 分配 | 配置 | | +| alternative | 备选 | | | +| amortized analysis | 平摊分析 | | | +| anaphoric | 指代 | | | +| annotation | 注解 | | | +| anonymous function | 匿名函数 | | | +| antecedent | 前提 | 前件 | 先决条件 | +| append | 追加 | 拼接 | | +| application | 应用 | 应用程序 | | +| application framework | 应用框架 | | | +| application program interface, API | 应用程序编程接口 | | | +| application service provider, ASP | 应用程序服务提供商 | | | +| applicative | 应用序 | | | +| argument | 参数 | 自变量 | 实际参数/实参 | +| arithmetic | 算术 | | | +| array | 数组 | | | +| artificial intelligence, AI | 人工智能 | | | +| assemble | 组合 | | | +| assembly | 汇编 | | | +| assignment | 赋值 | | | +| assignment operator | 赋值操作符 | | | +| associated | 关联的 | | | +| association list, alist | 关联列表 | | | +| atom | 原子 | | | +| atomic | 原子的 | | | +| atomic value | 原子型值 | | | +| attribute | 属性 | 特性 | | +| augmented | 扩充 | | | +| automatic memory management | 自动内存管理 | | | +| automatically infer | 自动推导 | | | +| autometa theory | 自动机理论 | | | +| auxiliary | 辅助 | | | + +### B + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| backquote | 反引用 | | | +| backtrace | 回溯 | | | +| backward compatible | 向下兼容 | | | +| bandwidth | 带宽 | | | +| base case | 基本情形 | | | +| base class | 基类 | | | +| Bayes' theorem | 贝叶斯定理 | | | +| best viable function | 最佳可行函式 | 最佳可行函数 | | +| Bezier curve | 贝塞尔曲线 | | | +| bignum | 大数 | | | +| binary operator | 二元操作符 | | | +| binary search | 二分查找 | 二分搜索 | 二叉搜索 | +| binary search tree | 二叉搜索树 | | | +| binary tree | 二叉树 | | | +| binding | 绑定 | | | +| binding vector | 绑定向量 | | | +| bit | 位 | 比特 | | +| bit manipulation | 位操作 | | | +| black box abstraction | 黑箱抽象 | | | +| block | 块 | 区块 | | +| block structure | 块结构 | 区块结构 | | +| block name | 代码块名字 | | | +| Blub paradox | Blub 困境 | | | +| body | 体 | 主体 | | +| boilerplate | 公式化 | 样板 | | +| bookkeeping | 簿记 | | | +| boolean | 布尔 | | | +| border | 边框 | | | +| bottom-up design | 自底向上的设计 | | | +| bottom-up programming | 自底向上编程 | | | +| bound | 边界 | | | +| bounds checking | 边界检查 | | | +| box notation | 箱子表示法 | | | +| brace | 花括弧 | 花括号 | | +| bracket | 方括弧 | 方括号 | | +| branch | 分支 | 跳转 | | +| breadth-first | 广度优先 | | | +| breadth-first search, BFS | 广度优先搜索 | | | +| breakpoint | 断点 | | | +| brevity | 简洁 | | | +| buffer | 缓冲区 | | | +| buffer overflow attack | 缓冲区溢出攻击 | | | +| bug | 臭虫 | | | +| building | 创建 | | | +| built-in | 内置 | | | +| byte | 字节 | | | +| bytecode | 字节码 | | | + +### C + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| cache | 缓存 | | | +| call | 调用 | | | +| callback | 回调 | | | +| CamelCase | 驼峰式大小写 | | | +| candidate function | 候选函数 | | | +| capture | 捕捉 | | | +| case | 分支 | | | +| character | 字符 | | | +| checksum | 校验和 | | | +| child class | 子类 | | | +| choke point | 滞塞点 | | | +| chunk | 块 | | | +| circular definition | 循环定义 | | | +| clarity | 清晰 | | | +| class | 类 | 类别 | | +| class declaration | 类声明 | | | +| class library | 类库 | | | +| client | 客户 | 客户端 | | +| clipboard | 剪贴板 | | | +| clone | 克隆 | | | +| closed world assumption | 封闭世界假定 | | | +| closure | 闭包 | | | +| clutter | 杂乱 | | | +| code | 代码 | | | +| code bloat | 代码膨胀 | | | +| collection | 收集器 | 复合类型 | | +| column | 行 | 栏 | | +| column-major order | 行主序 | | | +| comma | 逗号 | | | +| command-line | 命令行 | | | +| command-line interface, CLI | 命令行界面 | | | +| Common Lisp Object System, CLOS | Common Lisp 对象系统 | | | +| Common Gateway Interface, CGI | 通用网关接口 | | | +| compatible | 兼容 | | | +| compilation | 编译 | | | +| compilation parameter | 编译参数 | | | +| compile | 编译 | | | +| compile inline | 内联编译 | | | +| compile time | 编译期 | | | +| compiled form | 编译后的形式 | | | +| compiler | 编译器 | | | +| complex | 复杂 | | | +| complexity | 复杂度 | | | +| compliment | 补集 | | | +| component | 组件 | | | +| composability | 可组合性 | | | +| composition | 组合 | 组合函数 | | +| compound value | 复合数据 | 复合值 | | +| compression | 压缩 | | | +| computation | 计算 | | | +| computer | 计算机 | | | +| concatenation | 串接 | | | +| concept | 概念 | | | +| concrete | 具体 | | | +| concurrency | 并发 | | | +| concurrent | 并发 | | | +| conditional | 条件式 | | | +| conditional variable | 条件变量 | | | +| configuration | 配置 | | | +| connection | 连接 | | | +| cons | 构造 | | | +| cons cell | 构元 | cons 单元 | | +| consequent | 结果 | 推论 | | +| consistent | 一致性 | | | +| constant | 常量 | | | +| constraint | 约束 | | | +| constraint programming | 约束式编程 | | | +| container | 容器 | | | +| content-based filtering | 基于内容的过滤 | | | +| context | 上下文 | 语境 | 环境 | +| continuation | 延续性 | | | +| continuous integration, CI | 持续集成 | | | +| control | 控件 | | | +| cooperative multitasking | 协作式多任务 | | | +| copy | 拷贝 | | | +| corollary | 推论 | | | +| coroutine | 协程 | | | +| corruption | 程序崩溃 | | | +| crash | 崩溃 | | | +| create | 创建 | | | +| crystallize | 固化 | | | +| curly | 括弧状的 | | | +| curried | 柯里的 | | | +| currying | 柯里化 | | | +| cursor | 光标 | | | +| curvy | 卷曲的 | | | +| cycle | 周期 | | | + +### D + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| dangling pointer | 迷途指针 | 野指针 | | +| Defense Advanced Research Projects Agency, DARPA | 美国国防部高级研究计划局 | | | +| data | 数据 | | | +| data structure | 数据结构 | | | +| data type | 数据类型 | | | +| data-driven | 数据驱动 | | | +| database | 数据库 | | | +| database schema | 数据库模式 | | | +| datagram | 数据报文 | | | +| dead lock | 死锁 | | | +| debug | 调试 | | | +| debugger | 调试器 | | | +| debugging | 调试 | | | +| declaration | 声明 | | | +| declaration forms | 声明形式 | | | +| declarative | 声明式 | 说明式 | | +| declarative knowledge | 声明式知识 | 说明式知识 | | +| declarative programming | 声明式编程 | 说明式编程 | | +| declarativeness | 可声明性 | | | +| declaring | 声明 | | | +| deconstruction | 解构 | | | +| deduction | 推导 | 推断 | | +| default | 缺省 | 默认 | | +| defer | 推迟 | | | +| deficiency | 缺陷 | 不足 | | +| define | 定义 | | | +| definition | 定义 | | | +| delegate | 委托 | | | +| dellocate | 释放 | | | +| demarshal | 散集 | | | +| deprecated | 废弃 | | | +| depth-first | 深度优先 | | | +| depth-first search, BFS | 深度优先搜索 | | | +| derived | 派生 | | | +| derived class | 派生类 | | | +| design pattern | 设计模式 | | | +| designator | 指示符 | | | +| destructive | 破坏性的 | | | +| destructive function | 破坏性函数 | | | +| destructuring | 解构 | | | +| device driver | 硬件驱动程序 | | | +| dimensions | 维度 | | | +| directive | 指令 | | | +| directory | 目录 | | | +| disk | 盘 | | | +| dispatch | 分派 | 派发 | | +| distributed computing | 分布式计算 | | | +| DLL hell | DLL 地狱 | | | +| document | 文档 | | | +| dotted list | 点状列表 | | | +| dotted-pair notation | 带点尾部表示法 | 带点尾部记法 | | +| duplicate | 复本 | | | +| dynamic binding | 动态绑定 | | | +| dynamic extent | 动态范围 | | | +| dynamic languages | 动态语言 | | | +| dynamic scope | 动态作用域 | | | +| dynamic type | 动态类型 | | | + +### E + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| effect | 效果 | | | +| efficiency | 效率 | | | +| efficient | 高效 | | | +| embedded language | 嵌入式语言 | | | +| emulate | 仿真 | | | +| encapsulation | 封装 | | | +| enum | 枚举 | | | +| enumeration type | 枚举类型 | | | +| enumrators | 枚举器 | | | +| environment | 环境 | | | +| equal | 相等 | | | +| equality | 相等性 | | | +| equation | 方程 | | | +| equivalence | 等价性 | | | +| error message | 错误信息 | | | +| error-checking | 错误检查 | | | +| escaped | 逃脱 | 溢出 | | +| escape character | 转义字符 | | | +| evaluate | 求值 | 评估 | | +| evaluation | 求值 | | | +| event | 事件 | | | +| event driven | 事件驱动 | | | +| exception | 异常 | | | +| exception handling | 异常处理 | | | +| exception specification | 异常规范 | | | +| exit | 退出 | | | +| expendable | 可扩展的 | | | +| explicit | 显式 | | | +| exploratory programming | 探索式编程 | | | +| export | 导出 | 引出 | | +| expression | 表达式 | | | +| expressive power | 表达能力 | | | +| extensibility | 可扩展性 | | | +| extent | 范围 | 程度 | | +| external representation | 外部表示法 | | | +| extreme programming | 极限编程 | | | + +### F + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| factorial | 阶乘 | | | +| family | (类型的)系 | | | +| feasible | 可行的 | | | +| feature | 特色 | | | +| field | 字段 | 栏位 | | +| file | 文件 | | | +| file handle | 文件句柄 | | | +| fill pointer | 填充指针 | | | +| fineo-grained | 细粒度 | | | +| firmware | 固件 | | | +| first-class | 第一类的 | 第一级的 | 一等的 | +| first-class function | 第一级函数 | 第一类函数 | 一等函数 | +| first-class object | 第一类的对象 | 第一级的对象 | 一等公民 | +| fixed-point | 不动点 | | | +| fixnum | 定长数 | 定点数 | | +| flag | 标记 | | | +| flash | 闪存 | | | +| flexibility | 灵活性 | | | +| floating-point | 浮点数 | | | +| floating-point notation | 浮点数表示法 | | | +| flush | 刷新 | | | +| fold | 折叠 | | | +| font | 字体 | | | +| force | 迫使 | | | +| form | 形式 | | | +| form | 表单 | | | +| formal parameter | 形参 | | | +| formal relation | 形式关系 | | | +| forward | 转发 | | | +| fractal | 分形 | | | +| fractions | 派系 | | | +| framework | 框架 | | | +| freeware | 自由软件 | | | +| function | 函数 | | | +| function literal | 函数字面常量 | | | +| function object | 函数对象 | | | +| functional arguments | 函数型参数 | | | +| functional programming | 函数式编程 | | | +| functionality | 功能性 | | | + +### G + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| game | 游戏 | | | +| garbage | 垃圾 | | | +| garbage collection | 垃圾回收 | | | +| garbage collector | 垃圾回收器 | | | +| generalized | 泛化 | | | +| generalized variable | 广义变量 | | | +| generate | 生成 | | | +| generator | 生成器 | | | +| generic | 通用的 | 泛化的 | | +| generic algorithm | 通用算法 | 泛型算法 | | +| generic function | 通用函数 | | | +| generic programming | 通用编程 | 泛型编程 | | +| genrative programming | 生产式编程 | | | +| global | 全局的 | | | +| global declaration | 全局声明 | | | +| glue program | 胶水程序 | | | +| goto | 跳转 | | | +| graphical user interface, GUI | 图形用户界面 | | | +| greatest common divisor | 最大公因数 | | | +| Greenspun's tenth rule | 格林斯潘第十定律 | | | + +### H + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| hack | 破解 | | | +| hacker | 黑客 | | | +| handle | 处理器 | 处理程序 | 句柄 | +| hard disk | 硬盘 | | | +| hardware | 硬件 | | | +| hash tables | 哈希表 | 散列表 | | +| header | 头部 | | | +| header file | 头文件 | | | +| heap | 堆 | | | +| helper | 辅助函数 | 辅助方法 | | +| heuristic | 启发式 | | | +| high-order | 高阶 | | | +| higher-order function | 高阶函数 | | | +| higher-order procedure | 高阶过程 | | | +| hyperlink | 超链接 | | | +| HyperText Markup Language, HTML | 超文本标记语言 | | | +| HyperText Transfer Protocol, HTTP | 超文本传输协议 | | | + +### I + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| identical | 一致 | | | +| identifier | 标识符 | | | +| identity | 同一性 | | | +| ill type | 类型不正确 | | | +| illusion | 错觉 | | | +| imperative | 命令式 | | | +| imperative programming | 命令式编程 | | | +| implement | 实现 | | | +| implementation | 实现 | | | +| implicit | 隐式 | | | +| import | 导入 | | | +| incremental testing | 增量测试 | | | +| indent | 缩排 | 缩进 | | +| indentation | 缩排 | 缩进 | | +| indented | 缩排 | 缩进 | | +| indention | 缩排 | 缩进 | | +| infer | 推导 | | | +| infinite loop | 无限循环 | | | +| infinite recursion | 无限递归 | | | +| infinite precision | 无限精度 | | | +| infix | 中序 | | | +| information | 信息 | | | +| information technology, IT | 信息技术 | | | +| inheritance | 继承 | | | +| initialization | 初始化 | | | +| initialize | 初始化 | | | +| inline | 内联 | | | +| inline expansion | 内联展开 | | | +| inner class | 内嵌类 | | | +| inner loop | 内层循环 | | | +| input | 输入 | | | +| instances | 实例 | | | +| instantiate | 实例化 | | | +| instructive | 教学性的 | | | +| instrument | 记录仪 | | | +""" + +def parse_vocabulary(data: str) -> dict: + """解析词汇表""" + translations = {} + pattern = r'\|\s*([^|]+?)\s*\|\s*([^|]+?)\s*\|\s*([^|]*?)\s*\|\s*([^|]*?)\s*\|' + matches = re.findall(pattern, data) + + for english, zh1, zh2, zh3 in matches: + english = english.strip() + zh1 = zh1.strip() + + if english in ["英文", "**英文**", "---", ""]: + continue + if zh1 in ["译法 1", ""]: + continue + + primary = zh1 + translations[english] = primary + + return translations + +def parse_existing(content_js_path: str) -> set: + """解析现有的翻译""" + content = Path(content_js_path).read_text(encoding="utf-8") + pattern = r'\[\s*`([^`]*)`\s*,\s*`([^`]*)`\s*\]' + matches = re.findall(pattern, content) + existing = set() + for eng, zh in matches: + eng = eng.strip() + if eng: + existing.add(eng) + return existing + +def escape_js_string(s: str) -> str: + """转义 JavaScript 字符串""" + return s.replace("\\", "\\\\").replace("`", "\\`").replace("$", "\\$") + +def append_translations(content_js_path: str, new_translations: dict, existing: set) -> int: + """追加新翻译到 content.js""" + to_add = {} + for eng, zh in new_translations.items(): + if eng not in existing and zh: + to_add[eng] = zh + + if not to_add: + print("没有需要添加的新翻译") + return 0 + + content = Path(content_js_path).read_text(encoding="utf-8") + + pattern = r'(\s*\][,;]?\s*$)' + match = re.search(pattern, content, re.MULTILINE) + + if not match: + raise ValueError("无法找到数组结束位置") + + new_entries = "" + for eng, zh in sorted(to_add.items()): + eng_escaped = escape_js_string(eng) + zh_escaped = escape_js_string(zh) + new_entries += f" [`{eng_escaped}`, `{zh_escaped}`],\n" + + insert_pos = match.start() + new_content = content[:insert_pos] + ",\n" + new_entries + content[insert_pos:] + + Path(content_js_path).write_text(new_content, encoding="utf-8") + print(f"成功添加 {len(to_add)} 条新翻译") + return len(to_add) + +def validate_syntax(content_js_path: str) -> bool: + """验证 JavaScript 语法""" + content = Path(content_js_path).read_text(encoding="utf-8") + open_brackets = content.count("[") + close_brackets = content.count("]") + backticks = content.count("`") + print(f"语法检查: [ {open_brackets}, ] {close_brackets}, ` {backticks}") + if open_brackets == close_brackets and backticks % 2 == 0: + print("OK: 语法检查通过") + return True + else: + print("ERROR: 语法检查失败") + return False + +def main(): + content_js_path = r"d:\调取\githubCN-main\src\js\content.js" + + print("解析词汇表...") + vocab = parse_vocabulary(VOCAB_DATA) + print(f"解析到 {len(vocab)} 条词汇") + + print("\n检查现有翻译...") + existing = parse_existing(content_js_path) + print(f"现有 {len(existing)} 条翻译") + + new_words = set(vocab.keys()) - existing + print(f"需要添加 {len(new_words)} 条新翻译") + + new_translations = {k: v for k, v in vocab.items() if k in new_words} + + print("\n添加翻译...") + added = append_translations(content_js_path, new_translations, existing) + + if added > 0: + print("\n验证语法...") + validate_syntax(content_js_path) + + print("\n完成!") + +if __name__ == "__main__": + main() diff --git a/parse_vocab2.py b/parse_vocab2.py new file mode 100644 index 0000000..e89386d --- /dev/null +++ b/parse_vocab2.py @@ -0,0 +1,732 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +从 markdown 词汇表解析并添加到 content.js - 第 2 部分 (J-Z) +""" + +import re +from pathlib import Path + +VOCAB_DATA = """ +### J + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| Java applet | Java 小程序 | | | +| JavaScript | JavaScript | | | +| join | 联合 | 连接 | | +| jump | 跳转 | | | +| just in time, JIT | 即时编译 | | | + +### K + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| keyword | 关键字 | | | +| knapsack problem | 背包问题 | | | + +### L + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| lambda calculus | lambda 演算 | | | +| lambda expression | lambda 表达式 | | | +| language | 语言 | | | +| lazy evaluation | 惰性求值 | 懒求值 | | +| leaf | 叶 | 叶子 | | +| left child | 左子节点 | | | +| left subtree | 左子树 | | | +| level | 层 | 级 | | +| lexical | 词法 | | | +| lexical address | 词法地址 | | | +| lexical scoping | 词法作用域 | | | +| library | 库 | 程序库 | | +| life cycle | 生命周期 | | | +| lifetime | 生命期 | | | +| Lisp | Lisp 语言 | | | +| list | 表 | 列表 | | +| list structure | 表结构 | | | +| literal | 字面常量 | 字面量 | | +| load | 加载 | | | +| loader | 加载器 | | | +| local | 局部的 | | | +| local declaration | 局部声明 | | | +| local variable | 局部变量 | | | +| logic programming | 逻辑式编程 | | | +| loop | 循环 | | | +| lower bound | 下界 | | | + +### M + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| machine | 机器 | | | +| machine code | 机器码 | | | +| machine language | 机器语言 | | | +| macro | 宏 | | | +| macro expansion | 宏展开 | | | +| mail | 邮件 | | | +| main | 主 | | | +| maintainability | 可维护性 | | | +| management | 管理 | | | +| manifest | 清单 | | | +| mantissa | 尾数 | | | +| map | 映射 | | | +| matrix | 矩阵 | | | +| mean | 均值 | | | +| member | 成员 | | | +| member function | 成员函数 | | | +| memory | 内存 | 存储器 | | +| message | 消息 | | | +| message passing | 消息传递 | | | +| meta | 元 | | | +| meta-language | 元语言 | | | +| meta-circular evaluator | 元循环求值器 | | | +| method | 方法 | | | +| metric | 度量 | | | +| microcode | 微码 | | | +| middle-out | 中间展开 | | | +| milestone | 里程碑 | | | +| millennium bug | 千年虫 | | | +| minimum | 最小值 | 极小值 | | +| mirror | 镜像 | | | +| miscellaneous | 杂项 | 其他 | | +| modeling | 建模 | | | +| modeling language | 建模语言 | | | +| modem | 调制解调器 | | | +| modification | 修改 | | | +| module | 模块 | | | +| monad | 单子 | | | +| monolithic | 单体的 | | | +| morphism | 态射 | | | +| most general unifier | 最广合一子 | | | +| mouse | 鼠标 | | | +| multi-method | 多方法 | | | +| multiple inheritance | 多重继承 | | | +| multiprocessing | 多处理 | | | +| multiprogramming | 多道程序设计 | | | +| multitasking | 多任务 | | | +| multithreading | 多线程 | | | +| mutation | 突变 | | | +| mutual recursion | 相互递归 | | | + +### N + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| name | 名字 | 名称 | | +| namespace | 名字空间 | 命名空间 | | +| native | 原生的 | 本地 | | +| natural language | 自然语言 | | | +| network | 网络 | | | +| neural network | 神经网络 | | | +| node | 节点 | | | +| non-deterministic | 非确定性的 | | | +| non-modifying | 非修改的 | | | +| non-terminating | 不终止的 | | | +| normal form | 范式 | | | +| normalization | 规范化 | | | +| normalization by evaluation | 求值归一化 | | | +| notation | 表示法 | 记法 | | +| null | 空 | | | +| null pointer | 空指针 | | | +| number | 数值 | 数字 | | +| numeric | 数值的 | | | +| numerical analysis | 数值分析 | | | +| n-ary | n元 | | | +| nybble | 半字节 | | | + +### O + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| object | 对象 | | | +| object code | 目标码 | | | +| object language | 目标语言 | | | +| object-oriented | 面向对象 | | | +| object-oriented programming, OOP | 面向对象编程 | | | +| observe | 观测 | | | +| obsolete | 过时 | 废弃 | | +| occurrence | 出现 | 发生 | | +| octal | 八进制 | | | +| open | 打开 | 开放 | | +| open world assumption | 开放世界假定 | | | +| operand | 操作数 | 运算对象 | | +| operating system, OS | 操作系统 | | | +| operation | 操作 | 运算 | | +| operator | 操作符 | 运算符 | | +| opportunistic | 机会式 | | | +| optimize | 优化 | | | +| order | 阶 | 序 | | +| ordering | 排序 | | | +| origin | 原点 | 起源 | | +| orthogonality | 正交性 | | | +| out of band | 带外 | | | +| output | 输出 | | | +| overflow | 溢出 | 上溢 | | +| overload | 重载 | | | +| overloading | 重载 | | | +| overriding | 覆盖 | 重写 | | + +### P + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| package | 包 | | | +| padding | 填充 | | | +| palindrome | 回文 | | | +| parallel | 并行的 | | | +| parallelism | 并行性 | | | +| parameter | 参数 | 形式参数 | 形参 | +| parent | 父节点 | | | +| parent class | 父类 | | | +| parse | 语法分析 | 解析 | | +| parser | 语法分析器 | 解析器 | | +| partial | 部分的 | 偏 | | +| partial application | 部分应用 | 偏应用 | | +| partial function | 部分函数 | 偏函数 | | +| partition | 分区 | 划分 | | +| pass | 传递 | | | +| pass by reference | 引用传递 | | | +| pass by value | 值传递 | | | +| password | 口令 | 密码 | | +| path | 路径 | | | +| pattern | 模式 | | | +| pattern matching | 模式匹配 | | | +| payload | 有效载荷 | | | +| peek | 查看 | | | +| performance | 性能 | 表现 | | +| peripheral | 外设 | 外围设备 | | +| persistence | 持久化 | | | +| persistent | 持久的 | | | +| personal computer, PC | 个人计算机 | | | +| phase | 阶段 | | | +| pixel | 像素 | | | +| place | 位 | 位置 | | +| plain text | 明文 | | | +| platform | 平台 | | | +| pointer | 指针 | | | +| polymorphism | 多态 | | | +| pop | 弹出 | | | +| port | 端口 | | | +| portable | 可移植的 | | | +| portability | 可移植性 | | | +| position | 位置 | | | +| postfix | 后缀 | | | +| precedence | 优先级 | | | +| precision | 精度 | | | +| predicate | 谓词 | | | +| prefix | 前缀 | | | +| preorder | 前序 | | | +| preprocessor | 预处理器 | | | +| presentation | 表示 | 展现 | | +| primitive | 基本的 | 原语 | 基元 | +| print | 打印 | | | +| printer | 打印机 | | | +| priority | 优先级 | | | +| private | 私有 | | | +| probe | 探查 | | | +| procedure | 过程 | | | +| process | 进程 | 处理 | | +| processor | 处理器 | | | +| product | 乘积 | 积 | | +| program | 程序 | | | +| program counter | 程序计数器 | | | +| programmable | 可编程的 | | | +| programming | 编程 | 程序设计 | | +| programming language | 程序设计语言 | 编程语言 | | +| project | 项目 | 工程 | | +| projection | 投影 | | | +| protocol | 协议 | | | +| pseudo | 伪 | | | +| pseudo-code | 伪代码 | | | +| public | 公有 | | | +| push | 压入 | | | +| polymorphic | 多态的 | | | +| pipeline | 流水线 | 管道 | | +| pipe | 管道 | | | + +### Q + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| qualified | 受限的 | 限定的 | | +| quantifier | 量词 | | | +| query | 查询 | | | +| queue | 队列 | | | +| quicksort | 快速排序 | | | + +### R + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| race condition | 竞态条件 | | | +| radix | 基数 | | | +| random | 随机 | | | +| random access memory, RAM | 随机存取存储器 | | | +| range | 范围 | | | +| rank | 秩 | | | +| rational | 有理的 | | | +| read | 读 | 读取 | | +| read only memory, ROM | 只读存储器 | | | +| reader | 读取器 | | | +| record | 记录 | | | +| recursion | 递归 | | | +| recursive | 递归的 | | | +| redirect | 重定向 | | | +| reduce | 归约 | | | +| reduction | 归约 | | | +| redundant | 冗余 | | | +| reference | 引用 | 参考 | | +| reflection | 反射 | | | +| refresh | 刷新 | | | +| register | 寄存器 | | | +| regular expression | 正则表达式 | | | +| relational | 关系的 | | | +| release | 发布 | 释放 | | +| reliability | 可靠性 | | | +| relocatable | 可重定位的 | | | +| rem | 余 | 取余 | | +| remote | 远程 | | | +| repair | 修复 | | | +| repeat | 重复 | | | +| repetition | 重复 | 循环 | | +| representation | 表示法 | 表示 | | +| requirement | 需求 | 要求 | | +| reserved word | 保留字 | | | +| resolution | 分辨率 | 归结 | | +| resolver | 解析器 | | | +| resource | 资源 | | | +| response | 响应 | | | +| restoration | 恢复 | | | +| restricted | 受限的 | | | +| result | 结果 | | | +| return | 返回 | | | +| reverse | 反转 | 倒序 | | +| right child | 右子节点 | | | +| right subtree | 右子树 | | | +| root | 根 | | | +| rotate | 旋转 | | | +| round | 舍入 | | | +| round off | 四舍五入 | | | +| route | 路由 | | | +| router | 路由器 | | | +| routine | 例程 | | | +| row | 列 | 行 | | +| row-major order | 列主序 | | | +| RPC | 远程过程调用 | | | +| rule | 规则 | | | +| runtime | 运行时 | 执行期 | | + +### S + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| sandbox | 沙箱 | | | +| scalar | 标量 | | | +| scope | 作用域 | 范围 | | +| search | 搜索 | 查找 | | +| security | 安全性 | 安全 | | +| seed | 种子 | | | +| segment | 段 | 分段 | | +| selection | 选择 | | | +| semantic | 语义 | | | +| semantics | 语义学 | 语义 | | +| sentinel | 哨兵 | | | +| sequence | 序列 | | | +| sequential | 顺序的 | 串行的 | | +| serial | 串行 | | | +| server | 服务器 | | | +| service | 服务 | | | +| session | 会话 | | | +| set | 集合 | | | +| setter | 设置器 | | | +| shadow | 遮蔽 | | | +| shared | 共享的 | | | +| shell | 外壳 | 命令行 | | +| shift | 移位 | 偏移 | | +| shortcut | 快捷方式 | | | +| sibling | 兄弟节点 | | | +| side effect | 副作用 | | | +| signal | 信号 | | | +| signature | 签名 | 特征 | | +| simulation | 模拟 | 仿真 | | +| singleton | 单例 | | | +| size | 大小 | 尺寸 | | +| slice | 切片 | | | +| small talk | 聊天 | | | +| socket | 套接字 | | | +| software | 软件 | | | +| source | 源 | 来源 | | +| source code | 源代码 | | | +| source language | 源语言 | | | +| specialization | 特化 | | | +| stack | 栈 | 堆栈 | | +| stack overflow | 栈溢出 | | | +| statement | 语句 | 陈述 | | +| static | 静态的 | | | +| static binding | 静态绑定 | | | +| static scope | 静态作用域 | | | +| static type | 静态类型 | | | +| status | 状态 | | | +| step | 步骤 | 步长 | | +| storage | 存储 | | | +| stream | 流 | | | +| string | 字符串 | | | +| structure | 结构 | | | +| structured programming | 结构化编程 | | | +| subclass | 子类 | | | +| subexpression | 子表达式 | | | +| subroutine | 子例程 | | | +| subschema | 子模式 | | | +| subsequence | 子序列 | | | +| subset | 子集 | | | +| substitution | 代入 | 替换 | | +| subtype | 子类型 | | | +| subtree | 子树 | | | +| superclass | 超类 | 父类 | | +| support | 支持 | | | +| symbol | 符号 | | | +| syntax | 语法 | | | +| system | 系统 | | | +| system call | 系统调用 | | | + +### T + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| tail | 尾 | 尾部 | | +| tail recursion | 尾递归 | | | +| target | 目标 | | | +| task | 任务 | | | +| template | 模板 | | | +| terminal | 终端 | | | +| terminating | 终止的 | | | +| termination | 终止 | 结束 | | +| term rewriting system | 项重写系统 | | | +| test | 测试 | | | +| testing | 测试 | | | +| text | 文本 | 正文 | | +| theorem | 定理 | | | +| theory | 理论 | | | +| thread | 线程 | | | +| throw | 抛出 | 扔 | | +| time | 时间 | | | +| time-sharing | 分时 | | | +| timeout | 超时 | | | +| timestamp | 时间戳 | | | +| token | 令牌 | 词法单元 | | +| top-down | 自顶向下 | | | +| top-down programming | 自顶向下编程 | | | +| topic | 主题 | 话题 | | +| trailing | 尾部 | 后随 | | +| transaction | 事务 | | | +| transfer | 传送 | 转移 | | +| transform | 变换 | | | +| transformation | 变换 | 转换 | | +| transition | 过渡 | 变迁 | | +| translation | 翻译 | 平移 | | +| transmission | 传输 | 传送 | | +| transparent | 透明 | | | +| tree | 树 | | | +| traversal | 遍历 | | | +| traverse | 遍历 | | | +| tuple | 元组 | | | +| Turing machine | 图灵机 | | | +| type | 类型 | | | +| type checking | 类型检查 | | | +| type constructor | 类型构造器 | | | +| type error | 类型错误 | | | +| type inference | 类型推导 | | | +| type system | 类型系统 | | | +| typo | 笔误 | 打印错误 | | + +### U + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| unary | 一元 | | | +| unbound | 未绑定 | | | +| undefined | 未定义 | | | +| underflow | 下溢 | | | +| unification | 合一 | 统一 | | +| uniform | 一致的 | 均匀 | | +| union | 并集 | 联合 | | +| unique | 唯一的 | 独特的 | | +| unit | 单元 | | | +| unit test | 单元测试 | | | +| universe | 论域 | 宇宙 | | +| Unix | Unix 操作系统 | | | +| unload | 卸载 | | | +| unlock | 解锁 | | | +| unpack | 解包 | | | +| unsigned | 无符号 | | | +| untyped | 无类型 | | | +| update | 更新 | | | +| upgrade | 升级 | | | +| upload | 上传 | | | +| URI | 统一资源标识符 | | | +| URL | 统一资源定位符 | | | +| usability | 可用性 | | | +| use case | 用例 | | | +| user | 用户 | | | +| user interface, UI | 用户界面 | | | +| utility | 实用工具 | 实用程序 | | + +### V + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| valid | 有效的 | | | +| validate | 验证 | | | +| value | 值 | 数值 | | +| variable | 变量 | | | +| variance | 协变 | 变体 | | +| vector | 向量 | | | +| verbose | 啰嗦 | 冗长 | | +| verify | 验证 | 校验 | | +| version | 版本 | | | +| vertex | 顶点 | | | +| vertical | 垂直的 | | | +| VGA | 视频图形阵列 | | | +| virtual | 虚拟的 | | | +| virtual function | 虚函数 | | | +| virtual machine | 虚拟机 | | | +| virtual memory | 虚拟内存 | | | +| virus | 病毒 | | | +| visibility | 可见性 | | | +| visitor | 访问者 | | | +| volatile | 易失的 | 不稳定的 | | +| volume | 卷 | 音量 | | + +### W + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| walk | 遍历 | 走查 | | +| whitespace | 空白 | | | +| wide | 宽的 | | | +| widget | 小部件 | 组件 | | +| window | 窗口 | | | +| wireless | 无线 | | | +| word | 字 | 单词 | | +| workstation | 工作站 | | | +| wrapper | 包装器 | | | +| write | 写 | 写入 | | + +### X + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| XML | 可扩展标记语言 | | | + +### Y + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| yacc | yacc 编译器 | | | + +### Z + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| zero | 零 | | | +| zip | 压缩 | 拉链 | | + +### 专业名词 + +| **英文** | **译法 1** | 译法 2 | 译法 3 | +|---|---|---|---| +| A* search algorithm | A*搜索算法 | | | +| abstract data type, ADT | 抽象数据类型 | | | +| American National Standards Institute, ANSI | 美国国家标准学会 | | | +| Advanced Research Projects Agency Network, ARPANET | 阿帕网 | | | +| American Standard Code for Information Interchange, ASCII | 美国信息交换标准码 | | | +| Asynchronous JavaScript and XML, AJAX | 异步 JavaScript 和 XML | | | +| binary-coded decimal, BCD | 二进制编码的十进制 | | | +| Basic Combined Programming Language, BCPL | 基本组合编程语言 | | | +| Berkeley Software Distribution, BSD | 伯克利软件发行版 | | | +| Business Software Alliance, BSA | 商业软件联盟 | | | +| Canadian National Standard, CNS | 中国国家标准 | | | +| Centronics | Centronics 接口 | | | +| Common Business-Oriented Language, COBOL | 面向商业的通用语言 | | | +| Common Object Request Broker Architecture, CORBA | 公共对象请求代理体系结构 | | | +| Compact Disc Read-Only Memory, CD-ROM | 只读光盘 | | | +| Computer Aided Design, CAD | 计算机辅助设计 | | | +| Computer Aided Manufacturing, CAM | 计算机辅助制造 | | | +| Computer Aided Software Engineering, CASE | 计算机辅助软件工程 | | | +| Computer Science, CS | 计算机科学 | | | +| Computer Supported Cooperative Work, CSCW | 计算机支持的协同工作 | | | +| Digital Video Disc, DVD | 数字视频光盘 | | | +| Electronic Numerical Integrator and Computer, ENIAC | 电子数字积分计算机 | | | +| European Organization for Nuclear Research, CERN | 欧洲核子研究组织 | | | +| Extensible Markup Language, XML | 可扩展标记语言 | | | +| Extensible Stylesheet Language, XSL | 可扩展样式表语言 | | | +| File Transfer Protocol, FTP | 文件传输协议 | | | +| Free Software Foundation, FSF | 自由软件基金会 | | | +| GNU General Public License, GPL | GNU 通用公共许可证 | | | +| GNU's Not Unix, GNU | GNU 项目 | | | +| Graphical User Interface, GUI | 图形用户界面 | | | +| HyperText Markup Language, HTML | 超文本标记语言 | | | +| HyperText Transfer Protocol, HTTP | 超文本传输协议 | | | +| Institute of Electrical and Electronics Engineers, IEEE | 电气和电子工程师协会 | | | +| International Business Machines, IBM | 国际商业机器公司 | | | +| International Organization for Standardization, ISO | 国际标准化组织 | | | +| Internet Corporation for Assigned Names and Numbers, ICANN | 互联网名称与数字地址分配机构 | | | +| Internet Message Access Protocol, IMAP | 互联网消息访问协议 | | | +| Internet Protocol, IP | 网际协议 | | | +| Internet Service Provider, ISP | 互联网服务提供商 | | | +| Java 2 Platform Enterprise Edition, J2EE | Java 2 平台企业版 | | | +| Java 2 Platform Micro Edition, J2ME | Java 2 平台微型版 | | | +| Java 2 Platform Standard Edition, J2SE | Java 2 平台标准版 | | | +| JavaScript Object Notation, JSON | JavaScript 对象表示法 | | | +| Local Area Network, LAN | 局域网 | | | +| Massachusetts Institute of Technology, MIT | 麻省理工学院 | | | +| Metropolitan Area Network, MAN | 城域网 | | | +| Microsoft Foundation Classes, MFC | 微软基础类库 | | | +| Multipurpose Internet Mail Extensions, MIME | 多用途互联网邮件扩展 | | | +| MySQL | MySQL 数据库 | | | +| National Institute of Standards and Technology, NIST | 美国国家标准与技术研究院 | | | +| Object Management Group, OMG | 对象管理组织 | | | +| Object Relational Mapping, ORM | 对象关系映射 | | | +| Open Database Connectivity, ODBC | 开放数据库连接 | | | +| Open Source Initiative, OSI | 开源计划 | | | +| Open Systems Interconnection, OSI | 开放系统互连 | | | +| Open Virtualization Format, OVF | 开放虚拟化格式 | | | +| Perl | Perl 语言 | | | +| PHP: Hypertext Preprocessor, PHP | PHP 语言 | | | +| Point-to-Point Protocol, PPP | 点对点协议 | | | +| Post Office Protocol version 3, POP3 | 邮局协议版本 3 | | | +| Python | Python 语言 | | | +| Query Language, QL | 查询语言 | | | +| Rapid Application Development, RAD | 快速应用开发 | | | +| Ruby | Ruby 语言 | | | +| Structured Query Language, SQL | 结构化查询语言 | | | +| Transmission Control Protocol, TCP | 传输控制协议 | | | +| Transport Layer Security, TLS | 传输层安全 | | | +| Uniform Resource Identifier, URI | 统一资源标识符 | | | +| Uniform Resource Locator, URL | 统一资源定位符 | | | +| Universal Serial Bus, USB | 通用串行总线 | | | +| Unix-like | 类 Unix | | | +| Visual Basic, VB | Visual Basic 语言 | | | +| Virtual Reality, VR | 虚拟现实 | | | +| Visual Studio, VS | Visual Studio | | | +| Wide Area Network, WAN | 广域网 | | | +| Wireless Application Protocol, WAP | 无线应用协议 | | | +| Wireless Local Area Network, WLAN | 无线局域网 | | | +| World Wide Web, WWW | 万维网 | | | +| eXtensible Business Reporting Language, XBRL | 可扩展商业报告语言 | | | +| eXtensible Markup Language, XML | 可扩展标记语言 | | | +| eXtensible Stylesheet Language Transformations, XSLT | 可扩展样式表语言转换 | | | +| Zend Engine | Zend 引擎 | | | +""" + +def parse_vocabulary(data: str) -> dict: + """解析词汇表""" + translations = {} + pattern = r'\|\s*([^|]+?)\s*\|\s*([^|]+?)\s*\|\s*([^|]*?)\s*\|\s*([^|]*?)\s*\|' + matches = re.findall(pattern, data) + + for english, zh1, zh2, zh3 in matches: + english = english.strip() + zh1 = zh1.strip() + + if english in ["英文", "**英文**", "---", ""]: + continue + if zh1 in ["译法 1", ""]: + continue + + primary = zh1 + translations[english] = primary + + return translations + +def parse_existing(content_js_path: str) -> set: + """解析现有的翻译""" + content = Path(content_js_path).read_text(encoding="utf-8") + pattern = r'\[\s*`([^`]*)`\s*,\s*`([^`]*)`\s*\]' + matches = re.findall(pattern, content) + existing = set() + for eng, zh in matches: + eng = eng.strip() + if eng: + existing.add(eng) + return existing + +def escape_js_string(s: str) -> str: + """转义 JavaScript 字符串""" + return s.replace("\\", "\\\\").replace("`", "\\`").replace("$", "\\$") + +def append_translations(content_js_path: str, new_translations: dict, existing: set) -> int: + """追加新翻译到 content.js""" + to_add = {} + for eng, zh in new_translations.items(): + if eng not in existing and zh: + to_add[eng] = zh + + if not to_add: + print("没有需要添加的新翻译") + return 0 + + content = Path(content_js_path).read_text(encoding="utf-8") + + pattern = r'(\s*\][,;]?\s*$)' + match = re.search(pattern, content, re.MULTILINE) + + if not match: + raise ValueError("无法找到数组结束位置") + + new_entries = "" + for eng, zh in sorted(to_add.items()): + eng_escaped = escape_js_string(eng) + zh_escaped = escape_js_string(zh) + new_entries += f" [`{eng_escaped}`, `{zh_escaped}`],\n" + + insert_pos = match.start() + new_content = content[:insert_pos] + ",\n" + new_entries + content[insert_pos:] + + Path(content_js_path).write_text(new_content, encoding="utf-8") + print(f"成功添加 {len(to_add)} 条新翻译") + return len(to_add) + +def validate_syntax(content_js_path: str) -> bool: + """验证 JavaScript 语法""" + content = Path(content_js_path).read_text(encoding="utf-8") + open_brackets = content.count("[") + close_brackets = content.count("]") + backticks = content.count("`") + print(f"语法检查: [ {open_brackets}, ] {close_brackets}, ` {backticks}") + if open_brackets == close_brackets and backticks % 2 == 0: + print("OK: 语法检查通过") + return True + else: + print("ERROR: 语法检查失败") + return False + +def main(): + content_js_path = r"d:\调取\githubCN-main\src\js\content.js" + + print("解析词汇表 (J-Z)...") + vocab = parse_vocabulary(VOCAB_DATA) + print(f"解析到 {len(vocab)} 条词汇") + + print("\n检查现有翻译...") + existing = parse_existing(content_js_path) + print(f"现有 {len(existing)} 条翻译") + + new_words = set(vocab.keys()) - existing + print(f"需要添加 {len(new_words)} 条新翻译") + + new_translations = {k: v for k, v in vocab.items() if k in new_words} + + print("\n添加翻译...") + added = append_translations(content_js_path, new_translations, existing) + + if added > 0: + print("\n验证语法...") + validate_syntax(content_js_path) + + print("\n完成!") + +if __name__ == "__main__": + main() diff --git a/src/js/content.js b/src/js/content.js index fd4e7ff..f19c319 100644 --- a/src/js/content.js +++ b/src/js/content.js @@ -4,7 +4,7 @@ const allData = [ [`Issues`, `问题`], [`Pull`, `合并`], [`request`, `请求`], - [`s`, ``], + [`s`, `个`], [`Marketplace`, `市场`], [`Explore`, `探索`], [`Following`, `关注者`], @@ -174,7 +174,7 @@ const allData = [ [`New to GitHub?`, `刚来 Github?`], [`Create an account`, `创建一个账户`], [`Forgot password?`, `忘记密码?`], - [`Create an account`, ``], + [`Create an account`, `创建账户`], [ `Label issues and pull requests for new contributors`, `为新的贡献者标记问题和合并请求`, @@ -185,7 +185,7 @@ const allData = [ [`Signing in…`, `登录中...`], [`Edit repository details`, `编辑仓库详情信息`], [`Website`, `网站`], - [`Cancer`, `取消`], + [`Cancel`, `取消`], [`Save changes`, `保存修改`], [`Protect this branch`, `保护这个分支`], [`Get started with GitHub Actions`, `开始使用 Github Actions`], @@ -355,14 +355,171 @@ const allData = [ [`SSH and GPG keys`, `SSH和GPG密钥`], [`Cancel changes`, `取消更改`], [`Commit changes...`, `提交更改...`], - [``, ``], - [``, ``], - [``, ``], - [``, ``], - [``, ``], - [``, ``], - [``, ``], - [``, ``], + [`Platform`, `平台`], + [`Solutions`, `解决方案`], + [`Resources`, `资源`], + [`Open Source`, `开源`], + [`Sign up`, `注册`], + [`Enter your email`, `输入你的邮箱`], + [`Sign up for GitHub`, `注册 GitHub`], + [`Try GitHub Copilot`, `试用 GitHub Copilot`], + [`Plan`, `计划`], + [`Collaborate`, `协作`], + [`Automate`, `自动化`], + [`Secure`, `安全`], + [`Pause`, `暂停`], + [`Pause animation`, `暂停动画`], + [`Pause video`, `暂停视频`], + [`Explore GitHub Copilot`, `探索 GitHub Copilot`], + [`Read customer story`, `阅读客户案例`], + [`Read industry report`, `阅读行业报告`], + [`Automate your path to production`, `自动化您的生产路径`], + [`Explore GitHub Actions`, `探索 GitHub Actions`], + [`Code instantly from anywhere`, `随时随地编写代码`], + [`Keep momentum on the go`, `随时随地保持动力`], + [`Shape your toolchain`, `塑造您的工具链`], + [`Explore GitHub Advanced Security`, `探索 GitHub 高级安全`], + [`Learn about GitHub Code Security`, `了解 GitHub 代码安全`], + [`Learn about Dependabot`, `了解 Dependabot`], + [`Learn about GitHub Secret Protection`, `了解 GitHub 密钥保护`], + [`Explore GitHub Projects`, `探索 GitHub 项目`], + [`Keep track of your tasks`, `跟踪您的任务`], + [`Explore GitHub Issues`, `探索 GitHub Issues`], + [`Share ideas and ask questions`, `分享想法和提问`], + [`Review code changes together`, `一起审查代码更改`], + [`Fund open source projects`, `资助开源项目`], + [`By industry`, `按行业`], + [`By size`, `按规模`], + [`By use case`, `按使用场景`], + [`Explore customer stories`, `探索客户案例`], + [`View all solutions`, `查看所有解决方案`], + [`Back to content`, `返回内容`], + [`Back to top`, `返回顶部`], + [`Go to GitHub homepage`, `前往 GitHub 首页`], + [`Subscribe`, `订阅`], + [`Features`, `功能`], + [`AI`, `人工智能`], + [`Roadmap`, `路线图`], + [`Compare GitHub`, `比较 GitHub`], + [`Developer API`, `开发者 API`], + [`Partners`, `合作伙伴`], + [`Education`, `教育`], + [`GitHub CLI`, `GitHub 命令行`], + [`GitHub Desktop`, `GitHub 桌面版`], + [`GitHub Mobile`, `GitHub 移动版`], + [`GitHub Marketplace`, `GitHub 市场`], + [`MCP Registry`, `MCP 注册表`], + [`Community Forum`, `社区论坛`], + [`Professional Services`, `专业服务`], + [`Premium Support`, `高级支持`], + [`Skills`, `技能`], + [`About`, `关于`], + [`Why GitHub`, `为什么选择 GitHub`], + [`Customer stories`, `客户案例`], + [`The ReadME Project`, `ReadME 项目`], + [`Careers`, `招聘`], + [`Newsroom`, `新闻中心`], + [`Inclusion`, `包容性`], + [`Social Impact`, `社会影响力`], + [`Sitemap`, `网站地图`], + [`What is Git?`, `什么是 Git?`], + [`Manage cookies`, `管理 Cookie`], + [`Do not share my personal information`, `不要分享我的个人信息`], + [`English`, `英语`], + [`Select language`, `选择语言`], + [`Skip to content`, `跳转到内容`], + [`Homepage`, `首页`], + [`Contact GitHub Support`, `联系 GitHub 支持`], + [`Security and quality`, `安全与质量`], + [`master branch`, `master 分支`], + [`Go to Branches page`, `前往分支页面`], + [`Go to Tags page`, `前往标签页面`], + [`Folders and files`, `文件夹和文件`], + [`Latest commit`, `最新提交`], + [`History`, `历史`], + [`Repository files navigation`, `仓库文件导航`], + [`Repository files`, `仓库文件`], + [`Activity`, `活动`], + [`Report repository`, `报告仓库`], + [`View license`, `查看许可证`], + [`License`, `许可证`], + [`Stars`, `星标`], + [`Watchers`, `关注者`], + [`Forks`, `复刻`], + [`Other`, `其他`], + [`Community`, `社区`], + [`Contact`, `联系`], + [`Footer`, `页脚`], + [`Footer navigation`, `页脚导航`], + [`You must be signed in to change notification settings`, `您必须登录才能更改通知设置`], + [`You must be signed in to star a repository`, `您必须登录才能收藏仓库`], + [`contributors`, `贡献者`], + [`The future of building happens together`, `构建的未来是共同创造的`], + [`GitHub features`, `GitHub 功能`], + [`GitHub customers`, `GitHub 客户`], + [`Accelerate your entire workflow`, `加速您的整个工作流程`], + [`Your AI partner everywhere`, `您无处不在的 AI 伙伴`], + [`Built-in application security where found means fixed`, `内置应用程序安全,发现即修复`], + [`Work together, achieve more`, `携手合作,成就更多`], + [`From startups to enterprises, GitHub scales with teams of any size in any industry`, `从初创公司到企业,GitHub 可随任何行业的任何规模团队扩展`], + [`Millions of developers and businesses call GitHub home`, `数百万开发者和企业以 GitHub 为家`], + [`Footnotes`, `脚注`], + [`Site-wide Links`, `全站链接`], + [`Subscribe to our developer newsletter`, `订阅我们的开发者通讯`], + [`Get tips, technical guides, and best practices. Twice a month.`, `获取技巧、技术指南和最佳实践。每月两次。`], + [`Ecosystem`, `生态系统`], + [`Support`, `支持`], + [`Company`, `公司`], + [`Legal and Resource Links`, `法律和资源链接`], + [`GitHub's Social Media Links`, `GitHub 的社交媒体链接`], + [`GitHub on LinkedIn`, `GitHub 在 LinkedIn 上`], + [`GitHub on Instagram`, `GitHub 在 Instagram 上`], + [`GitHub on YouTube`, `GitHub 在 YouTube 上`], + [`GitHub on X`, `GitHub 在 X 上`], + [`GitHub on TikTok`, `GitHub 在 TikTok 上`], + [`GitHub on Twitch`, `GitHub 在 Twitch 上`], + [`GitHub's organization on GitHub`, `GitHub 在 GitHub 上的组织`], + [`Appearance settings`, `外观设置`], + [`Code review`, `代码审查`], + [`Dependency graph`, `依赖图`], + [`Security debt, solved`, `安全债务,已解决`], + [`Leverage security campaigns and Copilot Autofix to reduce application vulnerabilities`, `利用安全活动和 Copilot Autofix 减少应用程序漏洞`], + [`Dependencies you can depend on`, `您可以信赖的依赖项`], + [`Update vulnerable dependencies with supported fixes for breaking changes`, `使用支持的修复程序更新易受攻击的依赖项以应对重大更改`], + [`Your secrets, your business`, `您的密钥,您的业务`], + [`Detect, prevent, and remediate leaked secrets across your organization`, `在整个组织中检测、预防和修复泄露的密钥`], + [`Apply fixes in seconds`, `几秒钟内应用修复`], + [`Spend less time debugging and more time building features with Copilot Autofix`, `使用 Copilot Autofix 减少调试时间,将更多时间用于构建功能`], + [`Copilot Autofix identifies vulnerable code and provides an explanation, together with a secure code suggestion to remediate the vulnerability`, `Copilot Autofix 识别易受攻击的代码并提供解释,以及修复该漏洞的安全代码建议`], + [`MTTR reduction with Copilot Autofix`, `使用 Copilot Autofix 减少平均修复时间`], + [`secret leaks stopped in the past 12 months with push protection`, `在过去 12 个月内通过推送保护阻止的密钥泄露`], + [`GitHub internal customer data`, `GitHub 内部客户数据`], + [`Plan with clarity`, `清晰规划`], + [`Organize everything from high-level roadmaps to everyday tasks`, `组织从高级路线图到日常任务的所有内容`], + [`Create issues and manage projects with tools that adapt to your code`, `使用适应您代码的工具创建议题和管理项目`], + [`Create space for open-ended conversations alongside your project`, `在项目旁边创建开放式对话空间`], + [`Assign initial reviews to Copilot for greater speed and quality`, `将初始审查分配给 Copilot 以提高速度和质量`], + [`Become an open source partner and support the tools and libraries that power your work`, `成为开源合作伙伴,支持为您的工作提供支持的工具和库`], + [`Figma streamlines development and strengthens security`, `Figma 简化开发并增强安全性`], + [`Mercedes-Benz standardizes source code and automates onboarding`, `梅赛德斯-奔驰规范源代码并自动化入职流程`], + [`Mercado Libre cuts coding time by 50%`, `Mercado Libre 将编码时间缩短 50%`], + [`Duolingo boosts developer speed by 25% with GitHub Copilot`, `Duolingo 使用 GitHub Copilot 将开发者速度提高 25%`], + [`Gartner Magic Quadrant for AI Code Assistants`, `Gartner AI 代码助手魔力象限`], + [`Write, test, and fix code quickly with GitHub Copilot, from simple boilerplate to complex features`, `使用 GitHub Copilot 快速编写、测试和修复代码,从简单的样板代码到复杂功能`], + [`Tools and trends evolve, but collaboration endures`, `工具和趋势在演变,但协作永存`], + [`With GitHub, developers, agents, and code come together on one platform`, `借助 GitHub,开发者、代理和代码汇聚在一个平台上`], + [`From your first line of code to final deployment, GitHub provides AI and automation tools to help you build and ship better software faster`, `从第一行代码到最终部署,GitHub 提供 AI 和自动化工具,帮助您更快地构建和交付更好的软件`], + [`Copilot is ready to work with you at each step of the software development lifecycle`, `Copilot 已准备好在软件开发生命周期的每个步骤与您合作`], + [`Ship faster with secure, reliable CI/CD`, `通过安全、可靠的 CI/CD 更快地交付`], + [`Launch a full, cloud-based development environment in seconds`, `在几秒钟内启动完整的基于云的开发环境`], + [`Manage projects and assign tasks to Copilot, all from your mobile device`, `管理项目并向 Copilot 分配任务,一切都从您的移动设备完成`], + [`Extend your stack with apps, actions, and AI models`, `使用应用程序、操作和 AI 模型扩展您的技术栈`], + [`Use AI to find and fix vulnerabilities so your team can ship more secure software faster`, `使用 AI 查找和修复漏洞,让您的团队更快地交付更安全的软件`], + [`From planning and discussion to code review, GitHub keeps your team's conversation and context next to your code`, `从规划和讨论到代码审查,GitHub 将团队的对话和上下文保存在代码旁边`], + [`Whether you're scaling your development process or just learning how to code, GitHub is where you belong`, `无论您是在扩展开发流程还是刚刚学习编码,GitHub 都是您的归属`], + [`Join the world's most widely adopted developer platform to build the technologies that shape tomorrow`, `加入世界上最广泛使用的开发者平台,构建塑造未来的技术`], + [`Change is constant. GitHub keeps you ahead.`, `变革是永恒的。GitHub 让您保持领先。`], + [`Linux kernel source tree`, `Linux 内核源代码树`], ]; const MutationObserverConfig = { diff --git a/translate_tool.py b/translate_tool.py new file mode 100644 index 0000000..8d130a9 --- /dev/null +++ b/translate_tool.py @@ -0,0 +1,1223 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +""" +GitHub 自动翻译工具 +功能: +1. 从可靠数据源获取英语单词(支持英式/美式拼写) +2. 自动翻译为中文 +3. 去重后添加到 content.js 文件 +4. 验证 JavaScript 语法正确性 +""" + +import json +import re +import time +import os +import sys +import argparse +from typing import Dict, List, Tuple, Set, Optional +from pathlib import Path + +import requests +from requests.adapters import HTTPAdapter +from urllib3.util.retry import Retry + + +class WordFetcher: + """从可靠数据源获取英语单词""" + + WORD_SOURCES = { + "github_common": [ + "repository", "commit", "branch", "merge", "pull", "push", "fork", + "clone", "star", "watch", "issue", "pull request", "code review", + "workflow", "action", "pipeline", "deployment", "release", "tag", + "markdown", "readme", "license", "gitignore", "dockerfile", + "contributor", "maintainer", "collaborator", "organization", + "dashboard", "insights", "settings", "appearance", "notification", + "security", "analysis", "vulnerability", "secret", "dependabot", + "environment", "variable", "secret", "runner", "cache", "artifact", + "checkout", "matrix", "workflow_dispatch", "schedule", "cron", + "milestone", "label", "assignee", "reviewer", "comment", + "reaction", "emoji", "thread", "conversation", "mention", + "wiki", "discussion", "project", "board", "sprint", "epic", + "roadmap", "backlog", "kanban", "gantt", "timeline", + "public", "private", "internal", "visibility", "permission", + "admin", "write", "read", "triage", "maintain", "owner", + "sso", "saml", "oauth", "ssh", "gpg", "2fa", "passkey", + "webhook", "api", "graphql", "rest", "endpoint", "payload", + "rate limit", "pagination", "cursor", "token", "scope", + "github pages", "github actions", "github copilot", "github codespaces", + "codespace", "devcontainer", "container", "registry", "package", + "npm", "maven", "nuget", "rubygems", "docker", "container", + "lfs", "large file storage", "submodule", "subtree", + "conflict", "resolve", "rebase", "cherry-pick", "squash", + "amend", "reset", "revert", "stash", "checkout", + "fetch", "origin", "remote", "upstream", "downstream", + "blame", "annotate", "diff", "patch", "compare", + "raw", "blame", "history", "permalink", "line range", + "snippet", "gist", "template", "boilerplate", "scaffold", + "monorepo", "polyrepo", "microservice", "monolith", + "semver", "versioning", "changelog", "breaking change", + "deprecated", "sunset", "archive", "unarchive", + "transfer", "ownership", "rename", "transfer", + "sponsor", "sponsorship", "backer", "patron", + "badge", "shield", "status", "check", "ci", "cd", + "lint", "format", "test", "coverage", "quality", + "sonarqube", "codeql", "static analysis", "dynamic analysis", + "fuzzing", "penetration testing", "security audit", + "cve", "cwe", "exploit", "patch", "hotfix", + "feature flag", "a/b testing", "canary", "blue-green", + "rollback", "rollout", "deployment strategy", + "observability", "monitoring", "alerting", "logging", + "metrics", "tracing", "opentelemetry", "slo", "sla", + "incident", "postmortem", "root cause", "rca", + "blameless", "retrospective", "standup", "sprint", + "agile", "scrum", "kanban", "waterfall", "lean", + "devops", "devsecops", "shift-left", "shift-right", + "infrastructure as code", "terraform", "ansible", + "kubernetes", "k8s", "pod", "node", "cluster", + "serverless", "lambda", "cloud function", "edge", + "cdn", "load balancer", "reverse proxy", "nginx", + "ssl", "tls", "certificate", "domain", "dns", + "cors", "csrf", "xss", "sql injection", "injection", + "authentication", "authorization", "oauth2", "openid", + "jwt", "session", "cookie", "local storage", + "cache", "cdn", "etag", "last-modified", "expires", + "compression", "gzip", "brotli", "minification", + "bundler", "webpack", "vite", "rollup", "esbuild", + "transpiler", "babel", "typescript", "swc", + "polyfill", "shim", "fallback", "graceful degradation", + "progressive enhancement", "responsive", "mobile-first", + "accessibility", "a11y", "wcag", "aria", "semantic", + "internationalization", "i18n", "localization", "l10n", + "rtl", "ltr", "unicode", "utf-8", "encoding", + "endianness", "big-endian", "little-endian", + "serialization", "deserialization", "marshal", "unmarshal", + "encoding", "decoding", "encryption", "decryption", + "hashing", "checksum", "digest", "signature", + "asymmetric", "symmetric", "public key", "private key", + "certificate", "ca", "certificate authority", + "hsts", "hpkp", "csp", "content security policy", + "sri", "subresource integrity", "cors", "preflight", + "websocket", "sse", "server-sent events", "long polling", + "graphql", "rest", "grpc", "soap", "rpc", + "api gateway", "service mesh", "sidecar", "ambassador", + "circuit breaker", "retry", "backoff", "exponential", + "idempotent", "atomic", "consistent", "available", + "partition tolerance", "cap theorem", "acid", "base", + "eventual consistency", "strong consistency", + "cache invalidation", "cache stampede", "thundering herd", + "race condition", "deadlock", "livelock", "starvation", + "mutex", "semaphore", "lock", "spinlock", + "concurrent", "parallel", "distributed", "decentralized", + "centralized", "federated", "peer-to-peer", "p2p", + "blockchain", "smart contract", "web3", "dapp", + "machine learning", "ml", "ai", "neural network", + "deep learning", "llm", "gpt", "transformer", + "prompt", "context window", "token", "embedding", + "vector database", "rag", "finetuning", "pretraining", + "supervised", "unsupervised", "reinforcement learning", + "overfitting", "underfitting", "generalization", + "feature engineering", "hyperparameter", "epoch", "batch", + "gradient descent", "backpropagation", "optimizer", + "learning rate", "momentum", "adam", "sgd", + "activation function", "relu", "sigmoid", "tanh", + "softmax", "dropout", "batch normalization", + "convolution", "pooling", "cnn", "rnn", "lstm", "gru", + "attention", "self-attention", "multi-head attention", + "transformer", "bert", "gpt", "llama", "mistral", + "fine-tuning", "lora", "qlora", "prompt engineering", + "chain-of-thought", "few-shot", "zero-shot", + "agent", "autonomous agent", "multi-agent system", + "tool use", "function calling", "retrieval augmented generation", + "vector store", "embedding model", "semantic search", + "hallucination", "grounding", "fact checking", + "alignment", "rlhf", "constitutional ai", + "red teaming", "adversarial testing", "prompt injection", + "model card", "datasheet", "responsible ai", "ethical ai", + "bias", "fairness", "transparency", "accountability", + "explainability", "interpretability", "xai", + "computer vision", "image recognition", "object detection", + "semantic segmentation", "instance segmentation", + "natural language processing", "nlp", "text generation", + "text classification", "named entity recognition", "ner", + "sentiment analysis", "topic modeling", "summarization", + "translation", "transliteration", "localization", + "speech recognition", "text-to-speech", "tts", "stt", + "multimodal", "vision-language", "audio-visual", + ], + "british_american": [ + ("color", "colour"), + ("center", "centre"), + ("defense", "defence"), + ("license", "licence"), + ("organization", "organisation"), + ("realize", "realise"), + ("recognize", "recognise"), + ("traveled", "travelled"), + ("traveling", "travelling"), + ("canceled", "cancelled"), + ("canceling", "cancelling"), + ("favorite", "favourite"), + ("behavior", "behaviour"), + ("flavor", "flavour"), + ("honor", "honour"), + ("humor", "humour"), + ("labor", "labour"), + ("neighbor", "neighbour"), + ("apologize", "apologise"), + ("customize", "customise"), + ("optimize", "optimise"), + ("specialize", "specialise"), + ("analyze", "analyse"), + ("catalog", "catalogue"), + ("dialog", "dialogue"), + ("draft", "draught"), + ("gray", "grey"), + ("inquire", "enquire"), + ("inquiry", "enquiry"), + ("jewelry", "jewellery"), + ("judgment", "judgement"), + ("kilogram", "kilogramme"), + ("liter", "litre"), + ("meter", "metre"), + ("program", "programme"), + ("sabotage", "sabotage"), + ("savvy", "savvy"), + ("theater", "theatre"), + ("tire", "tyre"), + ("toward", "towards"), + ("whiskey", "whisky"), + (" Wool ", " Wool "), + ("artifact", "artefact"), + ("check", "cheque"), + ("curb", "kerb"), + ("draft", "draught"), + ("mold", "mould"), + ("plow", "plough"), + ("skeptic", "sceptic"), + ("sulfur", "sulphur"), + ] + } + + def fetch_from_datamuse(self, limit: int = 1000) -> List[str]: + """从 Datamuse API 获取常用单词""" + words = [] + try: + url = f"https://api.datamuse.com/words?max={limit}&sp=*" + response = requests.get(url, timeout=10) + response.raise_for_status() + data = response.json() + words = [item["word"] for item in data if "word" in item] + print(f"从 Datamuse 获取到 {len(words)} 个单词") + except Exception as e: + print(f"Datamuse API 调用失败: {e}") + return words + + def fetch_github_terms(self) -> List[str]: + """获取 GitHub 相关术语""" + return self.WORD_SOURCES.get("github_common", []) + + def fetch_british_american_pairs(self) -> List[Tuple[str, str]]: + """获取英式-美式拼写对""" + return self.WORD_SOURCES.get("british_american", []) + + def get_all_words( + self, + include_datamuse: bool = False, + datamuse_limit: int = 100, + include_github: bool = True, + include_british_american: bool = True + ) -> Set[str]: + """获取所有单词(去重)""" + all_words: Set[str] = set() + + if include_github: + github_words = self.fetch_github_terms() + all_words.update(github_words) + print(f"添加了 {len(github_words)} 个 GitHub 相关术语") + + if include_british_american: + ba_pairs = self.fetch_british_american_pairs() + for us, uk in ba_pairs: + all_words.add(us) + all_words.add(uk) + print(f"添加了 {len(ba_pairs) * 2} 个 英式/美式拼写对") + + if include_datamuse: + datamuse_words = self.fetch_from_datamuse(datamuse_limit) + all_words.update(datamuse_words) + print(f"添加了 {len(datamuse_words)} 个 通用单词") + + return all_words + + +class Translator: + """翻译模块 - 使用多个免费翻译 API 和本地词典""" + + LOCAL_DICTIONARY = { + "repository": "仓库", + "commit": "提交", + "branch": "分支", + "merge": "合并", + "pull": "拉取", + "push": "推送", + "fork": "复刻", + "clone": "克隆", + "star": "星标", + "watch": "关注", + "issue": "问题", + "pull request": "合并请求", + "code review": "代码评审", + "workflow": "工作流程", + "action": "动作", + "pipeline": "流水线", + "deployment": "部署", + "release": "发布", + "tag": "标签", + "markdown": "Markdown", + "readme": "自述文件", + "license": "许可证", + "gitignore": "Git 忽略文件", + "dockerfile": "Docker 配置文件", + "contributor": "贡献者", + "maintainer": "维护者", + "collaborator": "合作者", + "organization": "组织", + "dashboard": "仪表盘", + "insights": "统计", + "settings": "设置", + "appearance": "外观", + "notification": "通知", + "security": "安全", + "analysis": "分析", + "vulnerability": "漏洞", + "secret": "密钥", + "dependabot": "Dependabot", + "environment": "环境", + "variable": "变量", + "runner": "运行器", + "cache": "缓存", + "artifact": "构件", + "checkout": "检出", + "matrix": "矩阵", + "workflow_dispatch": "工作流调度", + "schedule": "调度", + "cron": "定时任务", + "milestone": "里程碑", + "label": "标签", + "assignee": "经办人", + "reviewer": "审查者", + "comment": "评论", + "reaction": "回应", + "emoji": "表情", + "thread": "线程", + "conversation": "对话", + "mention": "提及", + "wiki": "维基", + "discussion": "讨论", + "project": "项目", + "board": "看板", + "sprint": "冲刺", + "epic": "史诗", + "roadmap": "路线图", + "backlog": "待办事项", + "kanban": "看板", + "gantt": "甘特图", + "timeline": "时间线", + "public": "公开", + "private": "私有", + "internal": "内部", + "visibility": "可见性", + "permission": "权限", + "admin": "管理员", + "write": "写入", + "read": "读取", + "triage": "分类", + "maintain": "维护", + "owner": "所有者", + "sso": "单点登录", + "saml": "安全断言标记语言", + "oauth": "开放授权", + "ssh": "安全外壳协议", + "gpg": "GNU 隐私卫士", + "2fa": "双因素认证", + "passkey": "通行密钥", + "webhook": "Webhook", + "api": "应用程序接口", + "graphql": "GraphQL", + "rest": "REST", + "endpoint": "端点", + "payload": "负载", + "rate limit": "速率限制", + "pagination": "分页", + "cursor": "游标", + "token": "令牌", + "scope": "范围", + "github pages": "GitHub Pages", + "github actions": "GitHub Actions", + "github copilot": "GitHub Copilot", + "github codespaces": "GitHub Codespaces", + "codespace": "云端开发环境", + "devcontainer": "开发容器", + "container": "容器", + "registry": "注册表", + "package": "包", + "npm": "Node.js 包管理器", + "maven": "Maven", + "nuget": "NuGet", + "rubygems": "RubyGems", + "docker": "Docker", + "lfs": "大文件存储", + "large file storage": "大文件存储", + "submodule": "子模块", + "subtree": "子树", + "conflict": "冲突", + "resolve": "解决", + "rebase": "变基", + "cherry-pick": "遴选", + "squash": "压缩", + "amend": "修正", + "reset": "重置", + "revert": "还原", + "stash": "暂存", + "fetch": "获取", + "origin": "源", + "remote": "远程", + "upstream": "上游", + "downstream": "下游", + "blame": "追溯", + "annotate": "注解", + "diff": "差异", + "patch": "补丁", + "compare": "比较", + "raw": "原始", + "history": "历史", + "permalink": "永久链接", + "line range": "行范围", + "snippet": "代码片段", + "gist": "Gist", + "template": "模板", + "boilerplate": "样板代码", + "scaffold": "脚手架", + "monorepo": "单体仓库", + "polyrepo": "多仓库", + "microservice": "微服务", + "monolith": "单体应用", + "semver": "语义化版本", + "versioning": "版本控制", + "changelog": "变更日志", + "breaking change": "破坏性变更", + "deprecated": "已弃用", + "sunset": "终止", + "archive": "归档", + "unarchive": "取消归档", + "transfer": "转移", + "ownership": "所有权", + "rename": "重命名", + "sponsor": "赞助", + "sponsorship": "赞助", + "backer": "支持者", + "patron": "赞助人", + "badge": "徽章", + "shield": "护盾", + "status": "状态", + "check": "检查", + "ci": "持续集成", + "cd": "持续部署", + "lint": "代码检查", + "format": "格式化", + "test": "测试", + "coverage": "覆盖率", + "quality": "质量", + "sonarqube": "SonarQube", + "codeql": "CodeQL", + "static analysis": "静态分析", + "dynamic analysis": "动态分析", + "fuzzing": "模糊测试", + "penetration testing": "渗透测试", + "security audit": "安全审计", + "cve": "通用漏洞披露", + "cwe": "通用弱点枚举", + "exploit": "漏洞利用", + "patch": "补丁", + "hotfix": "热修复", + "feature flag": "功能开关", + "a/b testing": "A/B 测试", + "canary": "金丝雀发布", + "blue-green": "蓝绿部署", + "rollback": "回滚", + "rollout": "推出", + "deployment strategy": "部署策略", + "observability": "可观测性", + "monitoring": "监控", + "alerting": "告警", + "logging": "日志", + "metrics": "指标", + "tracing": "链路追踪", + "opentelemetry": "OpenTelemetry", + "slo": "服务水平目标", + "sla": "服务水平协议", + "incident": "事件", + "postmortem": "事后复盘", + "root cause": "根本原因", + "rca": "根本原因分析", + "blameless": "无指责", + "retrospective": "回顾", + "standup": "站会", + "agile": "敏捷", + "scrum": "Scrum", + "waterfall": "瀑布模型", + "lean": "精益", + "devops": "开发运维一体化", + "devsecops": "开发安全运维一体化", + "shift-left": "左移", + "shift-right": "右移", + "infrastructure as code": "基础设施即代码", + "terraform": "Terraform", + "ansible": "Ansible", + "kubernetes": "Kubernetes", + "k8s": "K8s", + "pod": "Pod", + "node": "节点", + "cluster": "集群", + "serverless": "无服务器", + "lambda": "Lambda", + "cloud function": "云函数", + "edge": "边缘", + "cdn": "内容分发网络", + "load balancer": "负载均衡器", + "reverse proxy": "反向代理", + "nginx": "Nginx", + "ssl": "安全套接层", + "tls": "传输层安全", + "certificate": "证书", + "domain": "域名", + "dns": "域名系统", + "cors": "跨域资源共享", + "csrf": "跨站请求伪造", + "xss": "跨站脚本", + "sql injection": "SQL 注入", + "injection": "注入", + "authentication": "认证", + "authorization": "授权", + "oauth2": "OAuth 2.0", + "openid": "OpenID", + "jwt": "JSON Web 令牌", + "session": "会话", + "cookie": "Cookie", + "local storage": "本地存储", + "etag": "ETag", + "last-modified": "最后修改", + "expires": "过期", + "compression": "压缩", + "gzip": "Gzip", + "brotli": "Brotli", + "minification": "压缩", + "bundler": "打包工具", + "webpack": "Webpack", + "vite": "Vite", + "rollup": "Rollup", + "esbuild": "esbuild", + "transpiler": "转译器", + "babel": "Babel", + "typescript": "TypeScript", + "swc": "SWC", + "polyfill": "Polyfill", + "shim": "垫片", + "fallback": "降级", + "graceful degradation": "优雅降级", + "progressive enhancement": "渐进增强", + "responsive": "响应式", + "mobile-first": "移动优先", + "accessibility": "无障碍", + "a11y": "无障碍", + "wcag": "网页内容无障碍指南", + "aria": "无障碍富互联网应用", + "semantic": "语义化", + "internationalization": "国际化", + "i18n": "国际化", + "localization": "本地化", + "l10n": "本地化", + "rtl": "从右到左", + "ltr": "从左到右", + "unicode": "Unicode", + "utf-8": "UTF-8", + "encoding": "编码", + "decoding": "解码", + "endianness": "字节序", + "big-endian": "大端", + "little-endian": "小端", + "serialization": "序列化", + "deserialization": "反序列化", + "marshal": "编组", + "unmarshal": "解组", + "encryption": "加密", + "decryption": "解密", + "hashing": "哈希", + "checksum": "校验和", + "digest": "摘要", + "signature": "签名", + "asymmetric": "非对称", + "symmetric": "对称", + "public key": "公钥", + "private key": "私钥", + "ca": "证书颁发机构", + "certificate authority": "证书颁发机构", + "hsts": "HTTP 严格传输安全", + "hpkp": "HTTP 公钥固定", + "csp": "内容安全策略", + "content security policy": "内容安全策略", + "sri": "子资源完整性", + "subresource integrity": "子资源完整性", + "preflight": "预检", + "websocket": "WebSocket", + "sse": "服务器发送事件", + "server-sent events": "服务器发送事件", + "long polling": "长轮询", + "grpc": "gRPC", + "soap": "SOAP", + "rpc": "远程过程调用", + "api gateway": "API 网关", + "service mesh": "服务网格", + "sidecar": "边车", + "ambassador": "大使", + "circuit breaker": "断路器", + "retry": "重试", + "backoff": "退避", + "exponential": "指数", + "idempotent": "幂等", + "atomic": "原子", + "consistent": "一致", + "available": "可用", + "partition tolerance": "分区容错", + "cap theorem": "CAP 定理", + "acid": "ACID", + "base": "BASE", + "eventual consistency": "最终一致性", + "strong consistency": "强一致性", + "cache invalidation": "缓存失效", + "cache stampede": "缓存惊群", + "thundering herd": "惊群效应", + "race condition": "竞态条件", + "deadlock": "死锁", + "livelock": "活锁", + "starvation": "饥饿", + "mutex": "互斥锁", + "semaphore": "信号量", + "lock": "锁", + "spinlock": "自旋锁", + "concurrent": "并发", + "parallel": "并行", + "distributed": "分布式", + "decentralized": "去中心化", + "centralized": "中心化", + "federated": "联邦", + "peer-to-peer": "点对点", + "p2p": "点对点", + "blockchain": "区块链", + "smart contract": "智能合约", + "web3": "Web3", + "dapp": "去中心化应用", + "machine learning": "机器学习", + "ml": "机器学习", + "ai": "人工智能", + "neural network": "神经网络", + "deep learning": "深度学习", + "llm": "大语言模型", + "gpt": "生成式预训练Transformer", + "transformer": "Transformer", + "prompt": "提示词", + "context window": "上下文窗口", + "token": "令牌", + "embedding": "嵌入", + "vector database": "向量数据库", + "rag": "检索增强生成", + "finetuning": "微调", + "pretraining": "预训练", + "supervised": "有监督", + "unsupervised": "无监督", + "reinforcement learning": "强化学习", + "overfitting": "过拟合", + "underfitting": "欠拟合", + "generalization": "泛化", + "feature engineering": "特征工程", + "hyperparameter": "超参数", + "epoch": "轮次", + "batch": "批次", + "gradient descent": "梯度下降", + "backpropagation": "反向传播", + "optimizer": "优化器", + "learning rate": "学习率", + "momentum": "动量", + "adam": "Adam", + "sgd": "随机梯度下降", + "activation function": "激活函数", + "relu": "ReLU", + "sigmoid": "Sigmoid", + "tanh": "Tanh", + "softmax": "Softmax", + "dropout": "Dropout", + "batch normalization": "批归一化", + "convolution": "卷积", + "pooling": "池化", + "cnn": "卷积神经网络", + "rnn": "循环神经网络", + "lstm": "长短期记忆网络", + "gru": "门控循环单元", + "attention": "注意力", + "self-attention": "自注意力", + "multi-head attention": "多头注意力", + "bert": "BERT", + "llama": "Llama", + "mistral": "Mistral", + "fine-tuning": "微调", + "lora": "LoRA", + "qlora": "QLoRA", + "prompt engineering": "提示词工程", + "chain-of-thought": "思维链", + "few-shot": "少样本", + "zero-shot": "零样本", + "agent": "智能体", + "autonomous agent": "自主智能体", + "multi-agent system": "多智能体系统", + "tool use": "工具使用", + "function calling": "函数调用", + "retrieval augmented generation": "检索增强生成", + "vector store": "向量存储", + "embedding model": "嵌入模型", + "semantic search": "语义搜索", + "hallucination": "幻觉", + "grounding": "接地", + "fact checking": "事实核查", + "alignment": "对齐", + "rlhf": "基于人类反馈的强化学习", + "constitutional ai": "宪法 AI", + "red teaming": "红队测试", + "adversarial testing": "对抗测试", + "prompt injection": "提示词注入", + "model card": "模型卡片", + "datasheet": "数据表", + "responsible ai": "负责任 AI", + "ethical ai": "伦理 AI", + "bias": "偏见", + "fairness": "公平", + "transparency": "透明", + "accountability": "问责", + "explainability": "可解释性", + "interpretability": "可理解性", + "xai": "可解释 AI", + "computer vision": "计算机视觉", + "image recognition": "图像识别", + "object detection": "目标检测", + "semantic segmentation": "语义分割", + "instance segmentation": "实例分割", + "natural language processing": "自然语言处理", + "nlp": "自然语言处理", + "text generation": "文本生成", + "text classification": "文本分类", + "named entity recognition": "命名实体识别", + "ner": "命名实体识别", + "sentiment analysis": "情感分析", + "topic modeling": "主题建模", + "summarization": "摘要", + "translation": "翻译", + "transliteration": "音译", + "speech recognition": "语音识别", + "text-to-speech": "文本转语音", + "tts": "文本转语音", + "stt": "语音转文本", + "multimodal": "多模态", + "vision-language": "视觉-语言", + "audio-visual": "音视频", + "color": "颜色", + "colour": "颜色", + "center": "中心", + "centre": "中心", + "defense": "防御", + "defence": "防御", + "license": "许可证", + "licence": "许可证", + "organization": "组织", + "organisation": "组织", + "realize": "实现", + "realise": "实现", + "recognize": "识别", + "recognise": "识别", + "traveled": "旅行过的", + "travelled": "旅行过的", + "traveling": "旅行的", + "travelling": "旅行的", + "canceled": "已取消", + "cancelled": "已取消", + "canceling": "取消中", + "cancelling": "取消中", + "favorite": "最喜欢的", + "favourite": "最喜欢的", + "behavior": "行为", + "behaviour": "行为", + "flavor": "风味", + "flavour": "风味", + "honor": "荣誉", + "honour": "荣誉", + "humor": "幽默", + "humour": "幽默", + "labor": "劳动", + "labour": "劳动", + "neighbor": "邻居", + "neighbour": "邻居", + "apologize": "道歉", + "apologise": "道歉", + "customize": "自定义", + "customise": "自定义", + "optimize": "优化", + "optimise": "优化", + "specialize": "专业化", + "specialise": "专业化", + "analyze": "分析", + "analyse": "分析", + "catalog": "目录", + "catalogue": "目录", + "dialog": "对话框", + "dialogue": "对话", + "draft": "草稿", + "draught": "草稿", + "gray": "灰色", + "grey": "灰色", + "inquire": "询问", + "enquire": "询问", + "inquiry": "查询", + "enquiry": "查询", + "jewelry": "珠宝", + "jewellery": "珠宝", + "judgment": "判断", + "judgement": "判断", + "kilogram": "千克", + "kilogramme": "千克", + "liter": "升", + "litre": "升", + "meter": "米", + "metre": "米", + "program": "程序", + "programme": "节目", + "theater": "剧院", + "theatre": "剧院", + "tire": "轮胎", + "tyre": "轮胎", + "toward": "朝向", + "towards": "朝向", + "whiskey": "威士忌", + "whisky": "威士忌", + "artifact": "人工制品", + "artefact": "人工制品", + "check": "检查", + "cheque": "支票", + "curb": "路边", + "kerb": "路边", + "mold": "模具", + "mould": "模具", + "plow": "犁", + "plough": "犁", + "skeptic": "怀疑论者", + "sceptic": "怀疑论者", + "sulfur": "硫", + "sulphur": "硫", + "sabotage": "破坏", + "savvy": "精明的", + "artifact": "构件", + "artefact": "构件", + "continuous integration": "持续集成", + "continuous deployment": "持续部署", + "code quality": "代码质量", + "test coverage": "测试覆盖率", + "unit test": "单元测试", + "integration test": "集成测试", + "end-to-end test": "端到端测试", + "e2e test": "端到端测试", + "smoke test": "冒烟测试", + "regression test": "回归测试", + "performance test": "性能测试", + "load test": "负载测试", + "stress test": "压力测试", + "security test": "安全测试", + "user acceptance test": "用户验收测试", + "uat": "用户验收测试", + "bug fix": "修复 bug", + "hot fix": "热修复", + "cold fix": "冷修复", + "feature branch": "功能分支", + "release branch": "发布分支", + "hotfix branch": "热修复分支", + "main branch": "主分支", + "master branch": "主分支", + "develop branch": "开发分支", + "trunk-based development": "基于主干的开发", + "git flow": "Git 工作流", + "github flow": "GitHub 工作流", + "trunk": "主干", + "merge conflict": "合并冲突", + "merge queue": "合并队列", + "squash merge": "压缩合并", + "rebase merge": "变基合并", + "fast-forward": "快进", + "three-way merge": "三方合并", + } + + def __init__(self, cache_file: str = "translation_cache.json"): + self.cache_file = cache_file + self.cache: Dict[str, str] = self._load_cache() + self.rate_limit_delay = 0.5 + self.session = self._create_session() + + def _create_session(self) -> requests.Session: + """创建带有重试机制的会话""" + session = requests.Session() + retry_strategy = Retry( + total=3, + backoff_factor=1, + status_forcelist=[429, 500, 502, 503, 504], + ) + adapter = HTTPAdapter(max_retries=retry_strategy) + session.mount("http://", adapter) + session.mount("https://", adapter) + session.verify = False + requests.packages.urllib3.disable_warnings() + return session + + def _load_cache(self) -> Dict[str, str]: + """加载翻译缓存""" + if os.path.exists(self.cache_file): + try: + with open(self.cache_file, "r", encoding="utf-8") as f: + return json.load(f) + except Exception as e: + print(f"加载缓存失败: {e}") + return {} + + def _save_cache(self) -> None: + """保存翻译缓存""" + try: + with open(self.cache_file, "w", encoding="utf-8") as f: + json.dump(self.cache, f, ensure_ascii=False, indent=2) + except Exception as e: + print(f"保存缓存失败: {e}") + + def translate_local(self, text: str) -> Optional[str]: + """使用本地词典翻译""" + text_lower = text.lower().strip() + return self.LOCAL_DICTIONARY.get(text_lower) + + def translate_mymemory(self, text: str, source: str = "en", target: str = "zh-CN") -> Optional[str]: + """使用 MyMemory API 翻译""" + try: + url = "https://api.mymemory.translated.net/get" + params = { + "q": text, + "langpair": f"{source}|{target}" + } + response = self.session.get(url, params=params, timeout=10) + response.raise_for_status() + data = response.json() + translation = data.get("responseData", {}).get("translatedText") + if translation and translation != text: + return translation + except Exception as e: + print(f"MyMemory 翻译失败: {e}") + return None + + def translate_google_free(self, text: str, source: str = "en", target: str = "zh-CN") -> Optional[str]: + """使用 Google 免费翻译端点""" + try: + url = "https://translate.googleapis.com/translate_a/single" + params = { + "client": "gtx", + "sl": source, + "tl": target, + "dt": "t", + "q": text + } + response = self.session.get(url, params=params, timeout=10) + response.raise_for_status() + data = response.json() + if data and data[0]: + translations = [item[0] for item in data[0] if item[0]] + return " ".join(translations) + except Exception as e: + print(f"Google 翻译失败: {e}") + return None + + def translate(self, text: str, source: str = "en", target: str = "zh-CN") -> Optional[str]: + """翻译文本(优先使用缓存和本地词典)""" + text = text.strip() + if not text: + return None + + cache_key = f"{source}:{target}:{text}" + if cache_key in self.cache: + return self.cache[cache_key] + + local_translation = self.translate_local(text) + if local_translation: + self.cache[cache_key] = local_translation + self._save_cache() + return local_translation + + translation = None + + translation = self.translate_google_free(text, source, target) + time.sleep(self.rate_limit_delay) + + if not translation: + translation = self.translate_mymemory(text, source, target) + time.sleep(self.rate_limit_delay) + + if translation: + self.cache[cache_key] = translation + self._save_cache() + + return translation + + def translate_batch(self, words: List[str], source: str = "en", target: str = "zh-CN") -> Dict[str, str]: + """批量翻译单词""" + results: Dict[str, str] = {} + total = len(words) + for i, word in enumerate(words, 1): + print(f"翻译中 ({i}/{total}): {word}", end="\r") + translation = self.translate(word, source, target) + if translation: + results[word] = translation + else: + print(f"\n警告: 无法翻译 '{word}'") + print(f"\n翻译完成,成功 {len(results)}/{total} 个") + return results + + +class ContentJSManager: + """管理 content.js 文件的读写""" + + def __init__(self, content_js_path: str): + self.path = Path(content_js_path) + if not self.path.exists(): + raise FileNotFoundError(f"找不到文件: {content_js_path}") + + def parse_existing_translations(self) -> Dict[str, str]: + """解析 content.js 中已有的翻译""" + content = self.path.read_text(encoding="utf-8") + translations: Dict[str, str] = {} + + pattern = r'\[\s*`([^`]*)`\s*,\s*`([^`]*)`\s*\]' + matches = re.findall(pattern, content) + + for english, chinese in matches: + english = english.strip() + chinese = chinese.strip() + if english and english not in translations: + translations[english] = chinese + + print(f"解析到 {len(translations)} 条现有翻译") + return translations + + def _escape_js_string(self, s: str) -> str: + """转义 JavaScript 字符串""" + return s.replace("\\", "\\\\").replace("`", "\\`").replace("$", "\\$") + + def append_translations(self, new_translations: Dict[str, str]) -> int: + """追加新翻译到 content.js""" + existing = self.parse_existing_translations() + + to_add: List[Tuple[str, str]] = [] + for english, chinese in new_translations.items(): + english = english.strip() + chinese = chinese.strip() + if english and chinese and english not in existing: + to_add.append((english, chinese)) + + if not to_add: + print("没有需要添加的新翻译") + return 0 + + content = self.path.read_text(encoding="utf-8") + + pattern = r'(\s*\][,;]?\s*$)' + match = re.search(pattern, content, re.MULTILINE) + + if not match: + raise ValueError("无法找到数组结束位置") + + new_entries = "" + for english, chinese in to_add: + eng_escaped = self._escape_js_string(english) + zh_escaped = self._escape_js_string(chinese) + if " " in english or len(english.split()) > 1 or "’" in english or "—" in english: + new_entries += f" [`{eng_escaped}`, `{zh_escaped}`],\n" + else: + new_entries += f" [`{eng_escaped}`, `{zh_escaped}`],\n" + + insert_pos = match.start() + new_content = content[:insert_pos] + ",\n" + new_entries + content[insert_pos:] + + self.path.write_text(new_content, encoding="utf-8") + print(f"成功添加 {len(to_add)} 条新翻译") + return len(to_add) + + def validate_syntax(self) -> bool: + """验证 JavaScript 语法""" + try: + import subprocess + result = subprocess.run( + ["node", "--check", str(self.path)], + capture_output=True, + text=True, + timeout=10 + ) + if result.returncode == 0: + print("OK: JavaScript syntax validation passed") + return True + else: + print(f"ERROR: JavaScript syntax error: {result.stderr}") + return False + except FileNotFoundError: + print("Warning: Node.js not found, skipping syntax validation") + content = self.path.read_text(encoding="utf-8") + open_brackets = content.count("[") + close_brackets = content.count("]") + backticks = content.count("`") + print(f"Basic syntax check: [ {open_brackets}, ] {close_brackets}, ` {backticks}") + if open_brackets == close_brackets and backticks % 2 == 0: + print("OK: Basic syntax check passed") + return True + else: + print("ERROR: Basic syntax check failed") + return False + except Exception as e: + print(f"❌ 语法验证失败: {e}") + return False + + def sort_translations(self) -> None: + """对翻译进行排序(可选)""" + content = self.path.read_text(encoding="utf-8") + + pattern = r'(const allData = \[)(.*?)(\];)' + match = re.search(pattern, content, re.DOTALL) + + if not match: + print("无法找到 allData 数组") + return + + array_content = match.group(2) + entry_pattern = r'\s*\[\s*`([^`]*)`\s*,\s*`([^`]*)`\s*\],?' + entries = re.findall(entry_pattern, array_content) + + seen = set() + unique_entries = [] + for eng, zh in entries: + if eng not in seen: + seen.add(eng) + unique_entries.append((eng, zh)) + + unique_entries.sort(key=lambda x: x[0].lower()) + + new_array_content = "\n" + for eng, zh in unique_entries: + eng_escaped = self._escape_js_string(eng) + zh_escaped = self._escape_js_string(zh) + new_array_content += f" [`{eng_escaped}`, `{zh_escaped}`],\n" + + new_content = match.group(1) + new_array_content + match.group(3) + content[match.end():] + + self.path.write_text(new_content, encoding="utf-8") + print(f"已排序,共 {len(unique_entries)} 条翻译") + + +def main(): + parser = argparse.ArgumentParser(description="GitHub 自动翻译工具") + parser.add_argument("--content-js", default="src/js/content.js", help="content.js 文件路径") + parser.add_argument("--datamuse", action="store_true", help="是否从 Datamuse 获取通用单词") + parser.add_argument("--datamuse-limit", type=int, default=100, help="Datamuse 获取单词数量") + parser.add_argument("--no-github", action="store_true", help="不包含 GitHub 相关术语") + parser.add_argument("--no-ba", action="store_true", help="不包含英式/美式拼写对") + parser.add_argument("--dry-run", action="store_true", help="只显示将要添加的翻译,不写入文件") + parser.add_argument("--sort", action="store_true", help="对现有翻译进行排序") + parser.add_argument("--validate-only", action="store_true", help="仅验证语法") + parser.add_argument("--custom-words", nargs="*", help="自定义要翻译的单词列表") + parser.add_argument("--cache-file", default="translation_cache.json", help="翻译缓存文件路径") + parser.add_argument("--yes", "-y", action="store_true", help="跳过确认提示,自动执行") + + args = parser.parse_args() + + content_js_path = Path(args.content_js) + if not content_js_path.is_absolute(): + content_js_path = Path.cwd() / content_js_path + + manager = ContentJSManager(str(content_js_path)) + + if args.validate_only: + manager.validate_syntax() + return + + if args.sort: + manager.sort_translations() + manager.validate_syntax() + return + + print("=" * 60) + print("GitHub 自动翻译工具") + print("=" * 60) + + fetcher = WordFetcher() + translator = Translator(cache_file=args.cache_file) + + words_to_translate: Set[str] = set() + + if args.custom_words: + words_to_translate.update(args.custom_words) + print(f"添加了 {len(args.custom_words)} 个自定义单词") + else: + words_to_translate = fetcher.get_all_words( + include_datamuse=args.datamuse, + datamuse_limit=args.datamuse_limit, + include_github=not args.no_github, + include_british_american=not args.no_ba + ) + + existing = manager.parse_existing_translations() + new_words = [w for w in words_to_translate if w not in existing] + + print(f"\n总单词数: {len(words_to_translate)}") + print(f"已有翻译: {len(words_to_translate) - len(new_words)}") + print(f"需要翻译: {len(new_words)}") + + if not new_words: + print("\n没有需要翻译的新单词!") + return + + if not args.yes: + confirm = input(f"\n是否开始翻译 {len(new_words)} 个单词?(y/n): ").lower() + if confirm != "y": + print("已取消") + return + else: + print(f"\n自动确认翻译 {len(new_words)} 个单词") + + print("\n开始翻译...") + translations = translator.translate_batch(new_words) + + if args.dry_run: + print("\n=== 预览(不写入文件)===") + for eng, zh in sorted(translations.items()): + print(f" [`{eng}`, `{zh}`],") + print(f"\n共 {len(translations)} 条翻译将被添加") + return + + added = manager.append_translations(translations) + + if added > 0: + manager.validate_syntax() + + print("\n" + "=" * 60) + print(f"任务完成!添加了 {added} 条新翻译") + print("=" * 60) + + +if __name__ == "__main__": + main() diff --git a/translation_cache.json b/translation_cache.json new file mode 100644 index 0000000..49d9b95 --- /dev/null +++ b/translation_cache.json @@ -0,0 +1,572 @@ +{ + "en:zh-CN:machine learning": "机器学习", + "en:zh-CN:code review": "代码评审", + "en:zh-CN:pull request": "pull请求", + "en:zh-CN:continuous integration": "持續整合", + "en:zh-CN:kubernetes": "Kubernetes", + "en:zh-CN:devops": "开发运维一体化", + "en:zh-CN:content security policy": "内容安全策略", + "en:zh-CN:sulfur": "硫", + "en:zh-CN:discussion": "讨论", + "en:zh-CN:liter": "升", + "en:zh-CN:security": "安全", + "en:zh-CN:inquiry": "查询", + "en:zh-CN:submodule": "子模块", + "en:zh-CN:skeptic": "怀疑论者", + "en:zh-CN:standup": "站会", + "en:zh-CN:cache invalidation": "缓存失效", + "en:zh-CN:travelled": "旅行过的", + "en:zh-CN:self-attention": "自注意力", + "en:zh-CN:analyse": "分析", + "en:zh-CN:cheque": "支票", + "en:zh-CN:origin": "源", + "en:zh-CN:few-shot": "少样本", + "en:zh-CN:hotfix": "热修复", + "en:zh-CN:permission": "权限", + "en:zh-CN:tts": "文本转语音", + "en:zh-CN:blameless": "无指责", + "en:zh-CN:docker": "Docker", + "en:zh-CN:ai": "人工智能", + "en:zh-CN:collaborator": "合作者", + "en:zh-CN:cherry-pick": "遴选", + "en:zh-CN:canceled": "已取消", + "en:zh-CN:snippet": "代码片段", + "en:zh-CN:deprecated": "已弃用", + "en:zh-CN:center": "中心", + "en:zh-CN:github pages": "GitHub Pages", + "en:zh-CN:ethical ai": "伦理 AI", + "en:zh-CN:ssl": "安全套接层", + "en:zh-CN:enquiry": "查询", + "en:zh-CN:vulnerability": "漏洞", + "en:zh-CN:archive": "归档", + "en:zh-CN:pull": "拉取", + "en:zh-CN:codeql": "CodeQL", + "en:zh-CN:bias": "偏见", + "en:zh-CN:qlora": "QLoRA", + "en:zh-CN:progressive enhancement": "渐进增强", + "en:zh-CN:fairness": "公平", + "en:zh-CN:wiki": "维基", + "en:zh-CN:catalogue": "目录", + "en:zh-CN:csp": "内容安全策略", + "en:zh-CN:graphql": "GraphQL", + "en:zh-CN:fetch": "获取", + "en:zh-CN:unicode": "Unicode", + "en:zh-CN:wcag": "网页内容无障碍指南", + "en:zh-CN:decryption": "解密", + "en:zh-CN:cors": "跨域资源共享", + "en:zh-CN:mobile-first": "移动优先", + "en:zh-CN:big-endian": "大端", + "en:zh-CN:nuget": "NuGet", + "en:zh-CN:semantic": "语义化", + "en:zh-CN:authentication": "认证", + "en:zh-CN:admin": "管理员", + "en:zh-CN:lint": "代码检查", + "en:zh-CN:monolith": "单体应用", + "en:zh-CN:reviewer": "审查者", + "en:zh-CN:available": "可用", + "en:zh-CN:deadlock": "死锁", + "en:zh-CN:federated": "联邦", + "en:zh-CN:cron": "定时任务", + "en:zh-CN:readme": "自述文件", + "en:zh-CN:devsecops": "开发安全运维一体化", + "en:zh-CN:signature": "签名", + "en:zh-CN:function calling": "函数调用", + "en:zh-CN:theater": "剧院", + "en:zh-CN:accessibility": "无障碍", + "en:zh-CN:kilogram": "千克", + "en:zh-CN:vision-language": "视觉-语言", + "en:zh-CN:lambda": "Lambda", + "en:zh-CN:graceful degradation": "优雅降级", + "en:zh-CN:template": "模板", + "en:zh-CN:tag": "标签", + "en:zh-CN:node": "节点", + "en:zh-CN:thundering herd": "惊群效应", + "en:zh-CN:lstm": "长短期记忆网络", + "en:zh-CN:openid": "OpenID", + "en:zh-CN:settings": "设置", + "en:zh-CN:cursor": "游标", + "en:zh-CN:grounding": "接地", + "en:zh-CN:sigmoid": "Sigmoid", + "en:zh-CN:checkout": "检出", + "en:zh-CN:sso": "单点登录", + "en:zh-CN:endpoint": "端点", + "en:zh-CN:datasheet": "数据表", + "en:zh-CN:alerting": "告警", + "en:zh-CN:tracing": "链路追踪", + "en:zh-CN:downstream": "下游", + "en:zh-CN:nginx": "Nginx", + "en:zh-CN:retrospective": "回顾", + "en:zh-CN:centralized": "中心化", + "en:zh-CN:underfitting": "欠拟合", + "en:zh-CN:contributor": "贡献者", + "en:zh-CN:traveling": "旅行的", + "en:zh-CN:explainability": "可解释性", + "en:zh-CN:api": "应用程序接口", + "en:zh-CN:blame": "追溯", + "en:zh-CN:observability": "可观测性", + "en:zh-CN:brotli": "Brotli", + "en:zh-CN:reaction": "回应", + "en:zh-CN:container": "容器", + "en:zh-CN:cache": "缓存", + "en:zh-CN:named entity recognition": "命名实体识别", + "en:zh-CN:llm": "大语言模型", + "en:zh-CN:cnn": "卷积神经网络", + "en:zh-CN:recognize": "识别", + "en:zh-CN:semaphore": "信号量", + "en:zh-CN:notification": "通知", + "en:zh-CN:jewelry": "珠宝", + "en:zh-CN:cdn": "内容分发网络", + "en:zh-CN:whisky": "威士忌", + "en:zh-CN:long polling": "长轮询", + "en:zh-CN:slo": "服务水平目标", + "en:zh-CN:shield": "护盾", + "en:zh-CN:llama": "Llama", + "en:zh-CN:favourite": "最喜欢的", + "en:zh-CN:patch": "补丁", + "en:zh-CN:pod": "Pod", + "en:zh-CN:smart contract": "智能合约", + "en:zh-CN:image recognition": "图像识别", + "en:zh-CN:passkey": "通行密钥", + "en:zh-CN:oauth2": "OAuth 2.0", + "en:zh-CN:private key": "私钥", + "en:zh-CN:ml": "机器学习", + "en:zh-CN:serialization": "序列化", + "en:zh-CN:a11y": "无障碍", + "en:zh-CN:lfs": "大文件存储", + "en:zh-CN:watch": "关注", + "en:zh-CN:optimize": "优化", + "en:zh-CN:waterfall": "瀑布模型", + "en:zh-CN:utf-8": "UTF-8", + "en:zh-CN:feature engineering": "特征工程", + "en:zh-CN:large file storage": "大文件存储", + "en:zh-CN:decoding": "解码", + "en:zh-CN:p2p": "点对点", + "en:zh-CN:environment": "环境", + "en:zh-CN:organization": "组织", + "en:zh-CN:batch": "批次", + "en:zh-CN:tls": "传输层安全", + "en:zh-CN:vector database": "向量数据库", + "en:zh-CN:customise": "自定义", + "en:zh-CN:canceling": "取消中", + "en:zh-CN:2fa": "双因素认证", + "en:zh-CN:prompt injection": "提示词注入", + "en:zh-CN:sentiment analysis": "情感分析", + "en:zh-CN:mould": "模具", + "en:zh-CN:label": "标签", + "en:zh-CN:gpt": "生成式预训练Transformer", + "en:zh-CN:apologise": "道歉", + "en:zh-CN:session": "会话", + "en:zh-CN:babel": "Babel", + "en:zh-CN:bundler": "打包工具", + "en:zh-CN:race condition": "竞态条件", + "en:zh-CN:kanban": "看板", + "en:zh-CN:sprint": "冲刺", + "en:zh-CN:generalization": "泛化", + "en:zh-CN:shift-right": "右移", + "en:zh-CN:sunset": "终止", + "en:zh-CN:litre": "升", + "en:zh-CN:fallback": "降级", + "en:zh-CN:text generation": "文本生成", + "en:zh-CN:last-modified": "最后修改", + "en:zh-CN:adversarial testing": "对抗测试", + "en:zh-CN:payload": "负载", + "en:zh-CN:merge": "合并", + "en:zh-CN:hsts": "HTTP 严格传输安全", + "en:zh-CN:private": "私有", + "en:zh-CN:clone": "克隆", + "en:zh-CN:dockerfile": "Docker 配置文件", + "en:zh-CN:semantic search": "语义搜索", + "en:zh-CN:sulphur": "硫", + "en:zh-CN:security audit": "安全审计", + "en:zh-CN:stash": "暂存", + "en:zh-CN:xai": "可解释 AI", + "en:zh-CN:sse": "服务器发送事件", + "en:zh-CN:preflight": "预检", + "en:zh-CN:prompt engineering": "提示词工程", + "en:zh-CN:flavor": "风味", + "en:zh-CN:symmetric": "对称", + "en:zh-CN:conflict": "冲突", + "en:zh-CN:rtl": "从右到左", + "en:zh-CN:gradient descent": "梯度下降", + "en:zh-CN:breaking change": "破坏性变更", + "en:zh-CN:badge": "徽章", + "en:zh-CN:terraform": "Terraform", + "en:zh-CN:defense": "防御", + "en:zh-CN:permalink": "永久链接", + "en:zh-CN:gzip": "Gzip", + "en:zh-CN:esbuild": "esbuild", + "en:zh-CN:commit": "提交", + "en:zh-CN:ansible": "Ansible", + "en:zh-CN:unarchive": "取消归档", + "en:zh-CN:project": "项目", + "en:zh-CN:organisation": "组织", + "en:zh-CN:transformer": "Transformer", + "en:zh-CN:agent": "智能体", + "en:zh-CN:kerb": "路边", + "en:zh-CN:compare": "比较", + "en:zh-CN:idempotent": "幂等", + "en:zh-CN:shift-left": "左移", + "en:zh-CN:comment": "评论", + "en:zh-CN:parallel": "并行", + "en:zh-CN:backoff": "退避", + "en:zh-CN:cve": "通用漏洞披露", + "en:zh-CN:load balancer": "负载均衡器", + "en:zh-CN:partition tolerance": "分区容错", + "en:zh-CN:meter": "米", + "en:zh-CN:instance segmentation": "实例分割", + "en:zh-CN:dialog": "对话框", + "en:zh-CN:emoji": "表情", + "en:zh-CN:coverage": "覆盖率", + "en:zh-CN:honor": "荣誉", + "en:zh-CN:amend": "修正", + "en:zh-CN:multi-head attention": "多头注意力", + "en:zh-CN:subresource integrity": "子资源完整性", + "en:zh-CN:gist": "Gist", + "en:zh-CN:dialogue": "对话", + "en:zh-CN:write": "写入", + "en:zh-CN:multi-agent system": "多智能体系统", + "en:zh-CN:sgd": "随机梯度下降", + "en:zh-CN:towards": "朝向", + "en:zh-CN:webpack": "Webpack", + "en:zh-CN:aria": "无障碍富互联网应用", + "en:zh-CN:sceptic": "怀疑论者", + "en:zh-CN:stt": "语音转文本", + "en:zh-CN:npm": "Node.js 包管理器", + "en:zh-CN:repository": "仓库", + "en:zh-CN:scaffold": "脚手架", + "en:zh-CN:inquire": "询问", + "en:zh-CN:endianness": "字节序", + "en:zh-CN:localization": "本地化", + "en:zh-CN:issue": "问题", + "en:zh-CN:checksum": "校验和", + "en:zh-CN:package": "包", + "en:zh-CN:monorepo": "单体仓库", + "en:zh-CN:static analysis": "静态分析", + "en:zh-CN:oauth": "开放授权", + "en:zh-CN:licence": "许可证", + "en:zh-CN:hpkp": "HTTP 公钥固定", + "en:zh-CN:ltr": "从左到右", + "en:zh-CN:apologize": "道歉", + "en:zh-CN:humor": "幽默", + "en:zh-CN:shim": "垫片", + "en:zh-CN:transparency": "透明", + "en:zh-CN:pagination": "分页", + "en:zh-CN:model card": "模型卡片", + "en:zh-CN:text classification": "文本分类", + "en:zh-CN:format": "格式化", + "en:zh-CN:digest": "摘要", + "en:zh-CN:release": "发布", + "en:zh-CN:finetuning": "微调", + "en:zh-CN:compression": "压缩", + "en:zh-CN:enquire": "询问", + "en:zh-CN:github actions": "GitHub Actions", + "en:zh-CN:patron": "赞助人", + "en:zh-CN:agile": "敏捷", + "en:zh-CN:rubygems": "RubyGems", + "en:zh-CN:api gateway": "API 网关", + "en:zh-CN:judgement": "判断", + "en:zh-CN:Wool": "羊毛", + "en:zh-CN:batch normalization": "批归一化", + "en:zh-CN:tire": "轮胎", + "en:zh-CN:attention": "注意力", + "en:zh-CN:secret": "密钥", + "en:zh-CN:constitutional ai": "宪法 AI", + "en:zh-CN:i18n": "国际化", + "en:zh-CN:overfitting": "过拟合", + "en:zh-CN:accountability": "问责", + "en:zh-CN:cookie": "Cookie", + "en:zh-CN:canary": "金丝雀发布", + "en:zh-CN:metrics": "指标", + "en:zh-CN:opentelemetry": "OpenTelemetry", + "en:zh-CN:lock": "锁", + "en:zh-CN:pooling": "池化", + "en:zh-CN:atomic": "原子", + "en:zh-CN:reinforcement learning": "强化学习", + "en:zh-CN:recognise": "识别", + "en:zh-CN:feature flag": "功能开关", + "en:zh-CN:semantic segmentation": "语义分割", + "en:zh-CN:registry": "注册表", + "en:zh-CN:subtree": "子树", + "en:zh-CN:monitoring": "监控", + "en:zh-CN:exponential": "指数", + "en:zh-CN:line range": "行范围", + "en:zh-CN:reverse proxy": "反向代理", + "en:zh-CN:public key": "公钥", + "en:zh-CN:injection": "注入", + "en:zh-CN:ownership": "所有权", + "en:zh-CN:text-to-speech": "文本转语音", + "en:zh-CN:rag": "检索增强生成", + "en:zh-CN:retrieval augmented generation": "检索增强生成", + "en:zh-CN:chain-of-thought": "思维链", + "en:zh-CN:deployment": "部署", + "en:zh-CN:convolution": "卷积", + "en:zh-CN:labor": "劳动", + "en:zh-CN:supervised": "有监督", + "en:zh-CN:realize": "实现", + "en:zh-CN:revert": "还原", + "en:zh-CN:ci": "持续集成", + "en:zh-CN:summarization": "摘要", + "en:zh-CN:fine-tuning": "微调", + "en:zh-CN:red teaming": "红队测试", + "en:zh-CN:appearance": "外观", + "en:zh-CN:customize": "自定义", + "en:zh-CN:mold": "模具", + "en:zh-CN:centre": "中心", + "en:zh-CN:maven": "Maven", + "en:zh-CN:realise": "实现", + "en:zh-CN:tool use": "工具使用", + "en:zh-CN:authorization": "授权", + "en:zh-CN:epoch": "轮次", + "en:zh-CN:domain": "域名", + "en:zh-CN:unsupervised": "无监督", + "en:zh-CN:topic modeling": "主题建模", + "en:zh-CN:minification": "压缩", + "en:zh-CN:roadmap": "路线图", + "en:zh-CN:remote": "远程", + "en:zh-CN:swc": "SWC", + "en:zh-CN:fork": "复刻", + "en:zh-CN:sabotage": "破坏", + "en:zh-CN:exploit": "漏洞利用", + "en:zh-CN:dynamic analysis": "动态分析", + "en:zh-CN:resolve": "解决", + "en:zh-CN:sonarqube": "SonarQube", + "en:zh-CN:polyrepo": "多仓库", + "en:zh-CN:whiskey": "威士忌", + "en:zh-CN:vite": "Vite", + "en:zh-CN:changelog": "变更日志", + "en:zh-CN:matrix": "矩阵", + "en:zh-CN:optimise": "优化", + "en:zh-CN:gpg": "GNU 隐私卫士", + "en:zh-CN:assignee": "经办人", + "en:zh-CN:little-endian": "小端", + "en:zh-CN:gru": "门控循环单元", + "en:zh-CN:color": "颜色", + "en:zh-CN:encryption": "加密", + "en:zh-CN:distributed": "分布式", + "en:zh-CN:kilogramme": "千克", + "en:zh-CN:translation": "翻译", + "en:zh-CN:flavour": "风味", + "en:zh-CN:cluster": "集群", + "en:zh-CN:unmarshal": "解组", + "en:zh-CN:edge": "边缘", + "en:zh-CN:encoding": "编码", + "en:zh-CN:autonomous agent": "自主智能体", + "en:zh-CN:dashboard": "仪表盘", + "en:zh-CN:mistral": "Mistral", + "en:zh-CN:transfer": "转移", + "en:zh-CN:pipeline": "流水线", + "en:zh-CN:status": "状态", + "en:zh-CN:program": "程序", + "en:zh-CN:markdown": "Markdown", + "en:zh-CN:soap": "SOAP", + "en:zh-CN:annotate": "注解", + "en:zh-CN:strong consistency": "强一致性", + "en:zh-CN:blue-green": "蓝绿部署", + "en:zh-CN:logging": "日志", + "en:zh-CN:cwe": "通用弱点枚举", + "en:zh-CN:tanh": "Tanh", + "en:zh-CN:zero-shot": "零样本", + "en:zh-CN:branch": "分支", + "en:zh-CN:k8s": "K8s", + "en:zh-CN:penetration testing": "渗透测试", + "en:zh-CN:pretraining": "预训练", + "en:zh-CN:multimodal": "多模态", + "en:zh-CN:cloud function": "云函数", + "en:zh-CN:star": "星标", + "en:zh-CN:traveled": "旅行过的", + "en:zh-CN:behaviour": "行为", + "en:zh-CN:timeline": "时间线", + "en:zh-CN:certificate": "证书", + "en:zh-CN:embedding model": "嵌入模型", + "en:zh-CN:concurrent": "并发", + "en:zh-CN:server-sent events": "服务器发送事件", + "en:zh-CN:rebase": "变基", + "en:zh-CN:rate limit": "速率限制", + "en:zh-CN:eventual consistency": "最终一致性", + "en:zh-CN:rlhf": "基于人类反馈的强化学习", + "en:zh-CN:owner": "所有者", + "en:zh-CN:judgment": "判断", + "en:zh-CN:jwt": "JSON Web 令牌", + "en:zh-CN:context window": "上下文窗口", + "en:zh-CN:tyre": "轮胎", + "en:zh-CN:insights": "统计", + "en:zh-CN:read": "读取", + "en:zh-CN:codespace": "云端开发环境", + "en:zh-CN:rest": "REST", + "en:zh-CN:ambassador": "大使", + "en:zh-CN:infrastructure as code": "基础设施即代码", + "en:zh-CN:github codespaces": "GitHub Codespaces", + "en:zh-CN:deserialization": "反序列化", + "en:zh-CN:ca": "证书颁发机构", + "en:zh-CN:savvy": "精明的", + "en:zh-CN:marshal": "编组", + "en:zh-CN:lean": "精益", + "en:zh-CN:draught": "草稿", + "en:zh-CN:behavior": "行为", + "en:zh-CN:token": "令牌", + "en:zh-CN:grpc": "gRPC", + "en:zh-CN:reset": "重置", + "en:zh-CN:public": "公开", + "en:zh-CN:mutex": "互斥锁", + "en:zh-CN:cancelling": "取消中", + "en:zh-CN:triage": "分类", + "en:zh-CN:spinlock": "自旋锁", + "en:zh-CN:rollback": "回滚", + "en:zh-CN:colour": "颜色", + "en:zh-CN:dropout": "Dropout", + "en:zh-CN:toward": "朝向", + "en:zh-CN:serverless": "无服务器", + "en:zh-CN:web3": "Web3", + "en:zh-CN:thread": "线程", + "en:zh-CN:momentum": "动量", + "en:zh-CN:responsible ai": "负责任 AI", + "en:zh-CN:acid": "ACID", + "en:zh-CN:nlp": "自然语言处理", + "en:zh-CN:diff": "差异", + "en:zh-CN:transpiler": "转译器", + "en:zh-CN:microservice": "微服务", + "en:zh-CN:blockchain": "区块链", + "en:zh-CN:learning rate": "学习率", + "en:zh-CN:adam": "Adam", + "en:zh-CN:webhook": "Webhook", + "en:zh-CN:rpc": "远程过程调用", + "en:zh-CN:object detection": "目标检测", + "en:zh-CN:runner": "运行器", + "en:zh-CN:websocket": "WebSocket", + "en:zh-CN:certificate authority": "证书颁发机构", + "en:zh-CN:responsive": "响应式", + "en:zh-CN:computer vision": "计算机视觉", + "en:zh-CN:plow": "犁", + "en:zh-CN:board": "看板", + "en:zh-CN:workflow_dispatch": "工作流调度", + "en:zh-CN:milestone": "里程碑", + "en:zh-CN:labour": "劳动", + "en:zh-CN:theatre": "剧院", + "en:zh-CN:ssh": "安全外壳协议", + "en:zh-CN:action": "动作", + "en:zh-CN:saml": "安全断言标记语言", + "en:zh-CN:dapp": "去中心化应用", + "en:zh-CN:devcontainer": "开发容器", + "en:zh-CN:mention": "提及", + "en:zh-CN:artefact": "构件", + "en:zh-CN:test": "测试", + "en:zh-CN:backpropagation": "反向传播", + "en:zh-CN:visibility": "可见性", + "en:zh-CN:quality": "质量", + "en:zh-CN:history": "历史", + "en:zh-CN:neighbor": "邻居", + "en:zh-CN:internationalization": "国际化", + "en:zh-CN:squash": "压缩", + "en:zh-CN:deep learning": "深度学习", + "en:zh-CN:livelock": "活锁", + "en:zh-CN:etag": "ETag", + "en:zh-CN:catalog": "目录", + "en:zh-CN:humour": "幽默", + "en:zh-CN:push": "推送", + "en:zh-CN:raw": "原始", + "en:zh-CN:rca": "根本原因分析", + "en:zh-CN:scope": "范围", + "en:zh-CN:rename": "重命名", + "en:zh-CN:audio-visual": "音视频", + "en:zh-CN:neighbour": "邻居", + "en:zh-CN:versioning": "版本控制", + "en:zh-CN:specialise": "专业化", + "en:zh-CN:peer-to-peer": "点对点", + "en:zh-CN:internal": "内部", + "en:zh-CN:upstream": "上游", + "en:zh-CN:incident": "事件", + "en:zh-CN:programme": "节目", + "en:zh-CN:postmortem": "事后复盘", + "en:zh-CN:service mesh": "服务网格", + "en:zh-CN:conversation": "对话", + "en:zh-CN:dependabot": "Dependabot", + "en:zh-CN:cache stampede": "缓存惊群", + "en:zh-CN:defence": "防御", + "en:zh-CN:root cause": "根本原因", + "en:zh-CN:typescript": "TypeScript", + "en:zh-CN:starvation": "饥饿", + "en:zh-CN:check": "检查", + "en:zh-CN:consistent": "一致", + "en:zh-CN:fuzzing": "模糊测试", + "en:zh-CN:backlog": "待办事项", + "en:zh-CN:sponsorship": "赞助", + "en:zh-CN:xss": "跨站脚本", + "en:zh-CN:decentralized": "去中心化", + "en:zh-CN:sla": "服务水平协议", + "en:zh-CN:natural language processing": "自然语言处理", + "en:zh-CN:artifact": "构件", + "en:zh-CN:deployment strategy": "部署策略", + "en:zh-CN:sponsor": "赞助", + "en:zh-CN:sri": "子资源完整性", + "en:zh-CN:retry": "重试", + "en:zh-CN:license": "许可证", + "en:zh-CN:jewellery": "珠宝", + "en:zh-CN:prompt": "提示词", + "en:zh-CN:local storage": "本地存储", + "en:zh-CN:scrum": "Scrum", + "en:zh-CN:gray": "灰色", + "en:zh-CN:analyze": "分析", + "en:zh-CN:cd": "持续部署", + "en:zh-CN:plough": "犁", + "en:zh-CN:gitignore": "Git 忽略文件", + "en:zh-CN:semver": "语义化版本", + "en:zh-CN:cap theorem": "CAP 定理", + "en:zh-CN:rnn": "循环神经网络", + "en:zh-CN:l10n": "本地化", + "en:zh-CN:lora": "LoRA", + "en:zh-CN:favorite": "最喜欢的", + "en:zh-CN:workflow": "工作流程", + "en:zh-CN:ner": "命名实体识别", + "en:zh-CN:rollout": "推出", + "en:zh-CN:softmax": "Softmax", + "en:zh-CN:neural network": "神经网络", + "en:zh-CN:sidecar": "边车", + "en:zh-CN:maintain": "维护", + "en:zh-CN:specialize": "专业化", + "en:zh-CN:hashing": "哈希", + "en:zh-CN:boilerplate": "样板代码", + "en:zh-CN:sql injection": "SQL 注入", + "en:zh-CN:activation function": "激活函数", + "en:zh-CN:vector store": "向量存储", + "en:zh-CN:draft": "草稿", + "en:zh-CN:polyfill": "Polyfill", + "en:zh-CN:metre": "米", + "en:zh-CN:asymmetric": "非对称", + "en:zh-CN:alignment": "对齐", + "en:zh-CN:hallucination": "幻觉", + "en:zh-CN:github copilot": "GitHub Copilot", + "en:zh-CN:expires": "过期", + "en:zh-CN:dns": "域名系统", + "en:zh-CN:bert": "BERT", + "en:zh-CN:relu": "ReLU", + "en:zh-CN:backer": "支持者", + "en:zh-CN:circuit breaker": "断路器", + "en:zh-CN:interpretability": "可理解性", + "en:zh-CN:cancelled": "已取消", + "en:zh-CN:curb": "路边", + "en:zh-CN:honour": "荣誉", + "en:zh-CN:variable": "变量", + "en:zh-CN:transliteration": "音译", + "en:zh-CN:a/b testing": "A/B 测试", + "en:zh-CN:speech recognition": "语音识别", + "en:zh-CN:rollup": "Rollup", + "en:zh-CN:embedding": "嵌入", + "en:zh-CN:base": "BASE", + "en:zh-CN:grey": "灰色", + "en:zh-CN:fact checking": "事实核查", + "en:zh-CN:schedule": "调度", + "en:zh-CN:hyperparameter": "超参数", + "en:zh-CN:travelling": "旅行的", + "en:zh-CN:csrf": "跨站请求伪造", + "en:zh-CN:epic": "史诗", + "en:zh-CN:maintainer": "维护者", + "en:zh-CN:optimizer": "优化器", + "en:zh-CN:analysis": "分析", + "en:zh-CN:gantt": "甘特图", + "en:zh-CN:annihilation": "泯灭", + "en:zh-CN:anthropologic": "人类学", + "en:zh-CN:anopia": "无视症", + "en:zh-CN:anteater": "食蚁兽", + "en:zh-CN:annihilationist": "湮灭主义者", + "en:zh-CN:appealingness": "吸引力" +} \ No newline at end of file