Skip to content

fix: 时间元素翻译后残留 "on"("opened on Jul 15" → "打开于 on 7月15日") #773

Description

@duzheshunziming

问题/建议

transTimeElement 中使用了正则 /^on/^ 锚点只匹配字符串开头;
on 位于 opened on ... 的中间,因此无法被匹配移除。
建议改为按单词边界匹配,例如 /\bon\s+/gi

Image

步骤

  1. 在 Via 浏览器中安装并启用「GitHub 中文化插件」。
  2. 打开任意一个 GitHub 仓库的 Issue 页面(例如 https://github.com/maboloshi/github-chinese/issues )。
  3. 查看标题下方的时间信息,原文形如 opened on Jul 15
  4. 观察翻译结果。

预期

时间信息中的英文 on 应被移除或翻译,例如:
opened on Jul 15打开于 7月15日

实际

opened on Jul 15打开于 on 7月15日
多出了一个英文 on,导致中文里出现「于 on」这种重复表达。

附件

Image

浏览器名称

Others

浏览器版本

Via版本7.2.1

脚本管理器名称

Others

脚本管理器版本

Via版本7.2.1

插件版本

1.9.4.4-2026-08-04

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions