// ==UserScript==
// @name 汉化gitlab.com汉化
// @namespace Violentmonkey Scripts
// @description 汉化 gitlab.com 界面的部分菜单及内容
// @match https://gitlab.com/
// @match https://gitlab.com/*
// @grant none
// @version 2.1
// @author sec
// @license MIT
// @namespace https://t.me/KingRan_qun
// ==/UserScript==
(function() {
'use strict';
const i18n = new Map([
['What\'s new', '最新消息'],
['Please verify your email address to access all of GitHub\'s features.', '请验证您的电子邮件地址以便开启所有 GitHub 功能。'],
['your company\'s GitHub organization to link it.', '贵公司和GitHub的组织联系起来。'],
['Frequently visited', '经常访问'],
['Free Trial of GitLab.com Ultimate', '免费试用GitLab.com高级版'],
['Try all GitLab has to offer for 30 days. No credit card required.', '在30天内试用GitLab所有功能。不需要信用卡。'],
['Start your free trial', '开始免费试用'],
['Explore projects', '探索项目'],
['Explore topics', '探索主题'],
['New project', '新建项目'],
['Updated 1 months ago', '更新于 1个月前'],
['Updated 2 months ago', '更新于 2个月前'],
['Updated 3 months ago', '更新于 3个月前'],
['Updated 4 months ago', '更新于 4个月前'],
['Updated 5 months ago', '更新于 5个月前'],
['Updated 6 months ago', '更新于 6个月前'],
['Updated 7 months ago', '更新于 7个月前'],
['Updated 8 months ago', '更新于 8个月前'],
['Updated 9 months ago', '更新于 9个月前'],
['Updated 10 months ago', '更新于 10个月前'],
['Updated 11 months ago', '更新于 11个月前'],
['Filter by name', '按名称过滤'],
['Edit profile', '编辑个人资料'],
['Start an Ultimate trial', '开始试用高级版'],
['View all projects', '查看所有项目'],
['Switch to', '切换到'],
['Groups you visit often will appear here', '你经常访问的群组将出现在这里'],
['Packages and registries', '打包和注册'],
['Issues', '议题'],
['Your project is no longer receiving GitLab Ultimate benefits as of 2022-07-01. As notified in-app previously, public open source projects on the Free tier can apply to the GitLab for Open Source Program to receive GitLab Ultimate benefits. Please refer to the', '您的项目从2022-07-01起不再享受GitLab高级版优惠。正如之前在应用中所通知的,处于免费层级的公共开源项目可以申请GitLab开源计划以获得GitLab 高级版的好处。'],
['Project Storage', '项目储存'],
['for more details.', '了解更多细节'],
['Enable in settings', '在设置中启用'],
['Auto DevOps', '自动开发流程'],
['It will automatically build, test, and deploy your application based on a predefined CI/CD configuration.', '它将根据预定的CI/CD配置,自动构建、测试和部署你的应用程序。'],
['Learn more in the', '了解更多'],
['Auto DevOps documentation', '自动开发文档'],
['This directory', '此目录'],
['New file', '新建文件'],
['Upload file', '上传文件'],
['New directory', '新建目录'],
['New tag', '新建标签'],
['Download source code', '下载源代码'],
['Quickly and easily edit multiple files in your project.', '快速、轻松地编辑你项目中的多个文件。'],
['Launch a ready-to-code development environment for your project.', '为你的项目启动一个随时可以编码的开发环境。'],
['Open in your IDE', '在你的IDE中打开'],
['Clone with SSH', '用SSH克隆'],
['Clone with HTTPS', '用HTTPS克隆'],
['Add LICENSE', '添加 许可证'],
['Add CHANGELOG', '添加 更新日志'],
['Add CONTRIBUTING', '添加 贡献'],
['Add Kubernetes cluster', '添加Kubernetes集群'],
['Set up CI/CD', '建立CI/CD'],
['Configure Integrations', '配置集成'],
['Copy commit SHA', '复制提交 SHA'],
['Project ID', '项目ID'],
['authored', '更新于'],
['Getting started', '开始工作'],
['To make it easy for you to get started with GitLab, here\'s a list of recommended next steps.', '为了方便你开始使用GitLab,这里列出了推荐的下一步行动。'],
['Already a pro?', '已经是专业人员了吗?'],
['Use the template at the bottom', '使用底部的模板'],
['Add your files', '添加你的文件'],
['Create 或 upload files', '创建或上传文件'],
['Just edit this README.md and make it your own. Want to make it easy?', '只要编辑这个README.md并使之成为你自己的。想让它变得简单吗?'],
['Add files using the command line ', '使用命令行添加文件 '],
['or push an existing Git repository with the following command:', '或用以下命令推送现有的 Git 仓库。'],
['Integrate with your tools', '与你的工具集成'],
['Set up project integrations', '设置项目集成'],
['Collaborate with your team', '与你的团队合作'],
['Invite team members and collaborators', '邀请团队成员和合作者'],
['Create a new merge request', '创建一个新的合并请求'],
['Automatically close issues from merge requests', '自动关闭来自合并请求的问题'],
['Enable merge request approvals', '启用合并请求批准'],
['Automatically merge when pipeline succeeds', '当传送成功时自动合并'],
['Test and Deploy', '测试和部署'],
['Use the built-in continuous integration in GitLab.', '使用GitLab中内置的持续集成。'],
['Get started with GitLab CI/CD', '开始使用GitLab CI/CD'],
['Analyze your code for known vulnerabilities with Static Application Security Testing', '利用静态应用安全测试分析你的代码是否存在已知的漏洞。'],
['Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy', '使用自动部署到Kubernetes、亚马逊云 EC2或亚马逊云 ECS。'],
['Use pull-based deployments for improved Kubernetes management', '使用基于拉取的部署来改进Kubernetes管理'],
['Set up protected environments', '设置受保护的环境'],
['Editing this README', '编辑本README'],
['When you\'re ready to make this README your own, just edit this file and use the handy template below', '当你准备把这个README变成你自己的,只需编辑这个文件并使用下面这个方便的模板'],
['for this template.', '提供这个模板。'],
['编辑本README', '编辑本README'],
['git 分支 -M main', 'git branch -M main'],
['(or feel free to structure it however you want - this is just a starting point!)', '或者随心所欲地构造它--这只是一个起点!'],
['. Thank you to', '。 感谢'],
['Suggestions for a good README', '对一个好的README的建议'],
['Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.', '每个项目都是不同的,所以要考虑这些部分中哪些适用于你的项目。模板中使用的部分是对大多数开源项目的建议。还要记住,虽然README可能太长、太详细,但太长总比太短好。如果你认为你的README太长了,可以考虑利用另一种形式的文档,而不是删减信息。'],
['Choose a self-explaining name for your project.', '为你的项目选择自我说明的名字。'],
['Description', '描述'],
['Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.', '让人们知道你的项目具体能做什么。提供背景,并添加一个链接到访问者可能不熟悉的任何参考资料。也可以在这里添加一个特点清单或背景小节。如果你的项目有替代方案,这是一个列举区别因素的好地方。'],
['Badges', '徽章'],
['On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.', '在一些README上,你可能会看到传达元数据的小图片,例如项目的所有测试是否都通过。你可以用盾牌来给你的README添加一些。许多服务也有添加徽章的说明。'],
['Visuals', '视觉效果'],
['Depending on what you are making, it can be a good idea to include screenshots or even a video ', '根据你制作的内容,包括屏幕截图甚至视频'],
['(you\'ll frequently see GIFs rather than actual videos)', '(你经常会看到GIF而不是实际的视频)'],
['. Tools like ttygif can help, but check out Asciinema for a more sophisticated method.', '可能是个好主意。像ttygif这样的工具可以提供帮助,但也可以查看Asciinema的更复杂的方法。'],
['Installation', '安装'],
['Usage', '使用方法'],
['Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.', '告诉人们他们可以到哪里去寻求帮助。它可以是问题跟踪器、聊天室、电子邮件地址等的任何组合。'],
['Roadmap', '路线图'],
['Contributing', '贡献者'],
['If you have ideas for releases in the future, it is a good idea to list them in the README.', '如果你对未来的发布有想法,在README中列出它们是个好主意。'],
['Authors and acknowledgment', '作者和鸣谢'],
['Show your appreciation to those who have contributed to the project.', '对那些为项目做出贡献的人表示感谢。'],
['License', '开源许可证'],
['For open source projects, say how it is licensed.', '对于开放源码项目,说说它的许可方式。'],
['Project status', '项目状况'],
['If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.', '如果你对你的项目已经没有精力或时间了,在README的顶部写上说明,开发已经放缓或完全停止。有人可能会选择分支你的项目,或自愿介入成为维护者或所有者,让你的项目继续进行下去。你也可以明确提出维护者的要求。'],
['State if you are open to contributions and what your requirements are for accepting them.', '说明你是否接受捐款,以及你接受捐款的要求是什么。'],
['For people who want to make changes to your project, it\'s helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.', '对于那些想对你的项目进行修改的人来说,有一些关于如何开始的文件是很有帮助的。也许有一个他们应该运行的脚本或一些他们需要设置的环境变量。让这些步骤变得明确。这些说明也可能对你未来的自己有用。'],
['You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.', '你也可以记录命令来提示代码或运行测试。这些步骤有助于确保高的代码质量,并减少修改时无意中破坏某些东西的可能性。如果需要外部设置,例如在浏览器中启动Selenium服务器进行测试,那么拥有运行测试的说明就特别有帮助。'],
['Use examples liberally, and show the expected output if you can. It\'s helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.', '大量使用例子,如果可以的话,显示预览输出。把你能展示的最小的使用例子放在里面.如果它们太长而不能合理地包括在README中,可以提供更复杂的例子的链接,这很有帮助。'],
['Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.', '在一个特定的生态系统中,可能有一种常见的安装方式,例如使用Yarn、NuGet或Homebrew。然而,考虑到阅读你的README的人可能是个新手,希望得到更多的指导。列出具体步骤有助于消除歧义,让人们尽快使用你的项目。如果它只在特定的环境下运行,如特定的编程语言版本或操作系统,或有必须手动安装的依赖,也可以添加一个要求小节。'],
['Initial commit', '初次提交'],
['Add new file', '添加新的文件'],
['Set a status', '设定一个状态'],
['What\'s your status?', '你的状态是什么?'],
['Set yourself as busy', '将自己设定为忙碌'],
['Displays that you are busy or not able to respond', '显示你很忙或无法回应'],
['Clear status after', '..时间后清除状态'],
['Remove status', '删除状态'],
['30 minutes', '30分钟'],
['3 hours', '3小时'],
['8 hours', '8小时'],
['1 day', '1天'],
['3 day', '3天'],
['7 day', '7天'],
['30 day', '30天'],
['Invite your colleagues', '邀请你的同事'],
['Submit your first Merge Request', '提交你的第一个合并请求'],
['checklist items completed', '已完成的核对表项目'],
['Using Kubernetes Clusters', '使用Kubernetes群集'],
['Get to know the help resources you have access to', '了解你可以获得的帮助资源'],
['What\'s included in your GitLab Ultimate trial', 'GitLab高级版试用包括哪些内容?'],
['Set up your profile and set your status', '建立你的个人资料并设置你的状态'],
['Create or import your code into your Project', '创建或导入你的代码到你的项目中'],
['Create/import issues ', '创建/导入问题(票据)'],
['to collaborate on ideas and plan work', ',以协作讨论想法和计划工作'],
['created', '创建于'],
['trial access', '试用权'],
['To do', '要做的事'],
['Subscribe to RSS feed', '订阅RSS信息'],
['Subscribe to calendar', '订阅日程表'],
['Select project to create issue', '选择项目来创建问题'],
['Clear recent searches', '清除最近的搜索'],
['Recent searches', '近期搜索'],
['assignee:', '受托人'],
['checklist item completed', '已完成的检查表项目'],
['Try all GitLab has to offer for 30天s. No credit card required.', '在30天内试用GitLab的所有功能。不需要信用卡。'],
['To-Do', '待办事项'],
['Updated', '更新于'],
['Updated', '更新于'],
['Updated', '更新于'],
['Updated', '更新于'],
['Updated', '更新于'],
['Updated', '更新于'],
['Updated', '更新于'],
['Updated', '更新于'],
['Personal', '个人'],
['Name', '名字'],
['Last commit', '上次提交'],
['Last update', '上次更新'],
['Upload New File', '上传新文件'],
['History', '历史'],
['Find file', '查找文件'],
['Web IDE', '网页开发'],
['Download', '下载'],
['Clone', '复刻'],
['Repository', '存储 库'],
['Updated', '更新于'],
['minute ago', '分钟前'],
['minutes ago', '分钟前'],
['hour ago', '小时前'],
['hours ago', '小时前'],
['day ago', '天前'],
['days ago', '天前'],
['week ago', '周前'],
['weeks ago', '周前'],
['month ago', '个月 前'],
['months ago', '个月 前'],
['year ago', '年前'],
['years ago', '年前'],
['Files', '文件'],
['Commits', '提交'],
['Branches', '分支'],
['Tags', '标签'],
['Contributors', '贡献'],
['Graph', '图表'],
['Compare', '比较'],
['Locked Files', '锁定的文件'],
['Learn GitLab', '学习 GitLab'],
['Project information', '项目信息'],
['Menu', '菜单'],
['Merge requests', '合并请求'],
['Security & Compliance', '安全性与合规性'],
['Deployments', '部署'],
['Packages & Registries', '程序包和注册表'],
['Infrastructure', '基础设施'],
['Monitor', '监控'],
['Analytics', '分析'],
['Wiki', '维基'],
['Snippets', '片段'],
['Collapse sidebar', '折叠侧边栏'],
['Edit', '编辑'],
['Lock', '锁定'],
['Replace', '替换'],
['Delete', '删除'],
['Copy file contents', '复制文件内容'],
['Open raw', '打开直链'],
['Monitor vulnerabilities in your project', '监控项目中的漏洞'],
['Manage and track vulnerabilities identified in your project. Vulnerabilities are shown here when security testing is configured.', '管理和跟踪项目中发现的漏洞。配置安全测试时,此处会显示漏洞。'],
['Configure security testing', '配置安全测试'],
['Learn more', '了解更多信息'],
['Feature Flags', '功能标志'],
['Releases', '发行版'],
['Package Registry', '软件包注册表'],
['Container Registry', '容器注册表'],
['Infrastructure Registry', '基础结构注册表'],
['Kubernetes clusters', 'Kubernetes集群'],
['Terraform', '地球化'],
['Metrics', '指标'],
['Error Tracking', '错误跟踪'],
['Alerts', '警报'],
['Incidents', '事件'],
['On-call Schedules', '待命时间表'],
['Escalation Policies', '升级策略'],
['No deployed environments', '未部署环境'],
['Check out the CI/CD documentation on deploying to an environment', '创建新项目'],
['Create new project', '查看有关部署到环境的 CI/CD 文档'],
['Learn about environments', '了解环境'],
['Get started with error tracking', '错误跟踪入门'],
['Monitor your errors by integrating with Sentry.', '通过与 Sentry 集成来监控您的错误。'],
['Enable error tracking', '启用错误跟踪'],
['Value stream', '变量传输'],
['Value Stream Analytics', '变量传输分析'],
['Code review', '代码审查'],
['Insights', '见解'],
['Issue', '问题'],
['Merge request', '合并请求'],
['General', '常规'],
['Webhooks', '网络钩子'],
['Pages', '页面'],
['Usage Quotas', '使用配额'],
['All', '全部'],
['Push events', '推送事件'],
['Merge events', '合并事件'],
['Issue events', '问题事件'],
['Comments', '评论'],
['Designs', '设计'],
['Team', '团队'],
['Upload New File', '上传新文件'],
['Project members', '项目成员'],
['You can invite a new member to', '您可以邀请新成员加入'],
['or invite another group.', '邀请其他群组。'],
['Members', '成员'],
['Open source', '开源'],
['Business', '商业'],
['Pricing', '定价'],
['Support', '支持'],
['Sign in', '登录'],
['Sign up', '注册'],
['This repository', '当前仓库'],
['Search', '搜索'],
['Pull Requests', '拉取请求'],
['Pull requests', '拉取请求'],
['Issues', '问题'],
['Gist', '代码片段'],
['Your dashboard', '返回首页'],
['Your dashboards', '你的仪表盘'],
['You have no unread notifications', '您没有未读通知'],
['You have unread notifications', '您有未读通知'],
['Create new…', '新建…'],
['View profile and more', '查看更多信息'],
['New repository', '新建仓库'],
['New organization', '新建组织'],
['Import repository', '导入仓库'],
['New gist', '新建代码片段'],
['New issue', '新建问题'],
['Signed in as', '您好'],
['Explore', '探索'],
['Integrations', '集成'],
['Help', '帮助'],
['Settings', '设置'],
['Sign out', '退出'],
['Showcases', '展柜'],
['Trending', '趋势'],
['Stars', '已赞'],
['Previous', '上一页'],
['Next', '下一页'],
['Period:', '最近:'],
['Filter activity', '选择时间'],
['Confirm password to continue', '确认密码后才能继续操作'],
['Password', '密码'],
['(Forgot password)', '(忘记密码)'],
['Confirm password', '继续'],
['Terms', '条款'],
['Privacy', '隐私'],
['Security', '安全'],
['Contact', '联系'],
['Status', '状态'],
['Training', '培训'],
['Shop', '商店'],
['Blog', '博客'],
['About', '关于'],
['Download', '下载'],
['Permalink', '永久链接'],
['Blame', '责任'],
['This project', '此项目'],
['New merge request', '新建合并请求'],
['New snippet', '新建代码段'],
['Invite members', '邀请成员'],
['New project/repository', '新建项目/存储库'],
['New group', '新建群组'],
['New snippet', '新建代码段'],
['Assigned to you', '分配给您'],
['Review requests for you', '为您审核请求'],
['Community forum', '社区论坛'],
['Keyboard shortcuts', '键盘快捷键'],
['Submit feedback', '提交反馈'],
['Contribute to GitLab', '为 GitLab 做贡献'],
['Switch to GitLab Next', '切换到 GitLab Next'],
['Set status', '设置状态'],
['Start an Ultimate trial', '开始高级版试用'],
['Edit profile', '编辑个人资料'],
['Preferences', '偏好'],
['Projects', '项目'],
['Groups', '群组'],
['Snippets', '片段'],
['Activity', '活动'],
['Environments', '环境'],
['Operations', '操作'],
['Security', '安全'],
['Your projects', '您的项目'],
['Starred projects', '已加星标的项目'],
['Explore projects', '探索项目'],
['Explore topics', '探索主题'],
['Pending deletion', '待删除'],
['Create new project', '创建新项目'],
['Labels', '标签'],
['Members', '成员'],
['List', '列表'],
['Boards', '版主申请'],
['Service Desk', '服务台'],
['Milestones', '重要事件'],
['Iterations', '迭代'],
['Requirements', '需求'],
['Pipelines', '自动运行'],
['Editor', '编辑 器'],
['Jobs', '工作'],
['Schedules', '附表'],
['Test Cases', '测试用例'],
['Security dashboard', '安全仪表板'],
['Vulnerability report', '漏洞报告'],
['On-demand scans', '按需扫描'],
['Dependency list', '依赖关系列表'],
['License compliance', '许可证合规性'],
['Policies', '政策'],
['Audit events', '审核事件'],
['Configuration', '配置'],
['Your profile', '您的主页'],
['Your stars', '点赞的项目'],
['Your gists', '您的代码片段'],
// "Followers', '粉丝'],
['Follow', '关注'],
['Unfollow', '取消关注'],
['Watch', '关注'],
['Unwatch', '取消关注'],
['Star', '点赞'],
['Unstar', '取消点赞'],
['Fork', '复刻'],
// 邮箱验证提示
['Configure email settings', '修改电子邮件设置'],
['Your email was verified.', '您的邮件地址验证成功!'],
['Jan', '1月'],
['Feb', '2月'],
['Mar', '3月'],
['Apr', '4月'],
['May', '5月'],
['Jun', '6月'],
['Jul', '7月'],
['Aug', '8月'],
['Sep', '9月'],
['Oct', '10月'],
['Nov', '11月'],
['Dec', '12月'],
['All', '全部'],
['Public', '公共'],
['Private', '私有'],
['Sources', '源码'],
['Forks', '复刻'],
['View', '查看'],
['starred', '赞了'],
['forked', '复刻了'],
['opened issue', '新建问题'],
['close issue', '关闭问题'],
['added', '添加了'],
['pushed to', '推送了'],
['closed issue', '关闭了问题'],
['merged pull request', '合并了拉取请求'],
['commented on issue', '提交了评论'],
['More', '更多'],
['Overview', '概述'],
['Repositories', '仓库'],
['Projects" :"项目'],
['Stars', '已点赞'],
['Followers', '粉丝'],
['Following', '关注'],
['Joined on', '注册于'],
['Change your avatar', '修改头像'],
['Starred', '赞了'],
['Organizations', '组织'],
['Contributions', '贡献'],
['Public contributions', '贡献'],
['Public activity', '动态'],
['Edit profile', '修改设置'],
['Popular repositories', '流行的仓库'],
['Pinned repositories', '固定的仓库'],
['commits', '次提交'],
['Pull Request', '拉取请求'],
['Pull Requests', '拉取请求'],
['Issue reported', '问题报告'],
['Issues reported', '问题报告'],
['forked', '收藏了'],
['forked from', '收藏至'],
['created repository', '创建了仓库'],
['opened pull request', '发起了拉取请求'],
['commented on pull request', '评论了拉取请求'],
['opened issue', '新建问题'],
['close issue', '关闭问题'],
['added', '添加了'],
['pushed to', '推送了'],
['closed issue', '关闭了问题'],
['merged pull request', '合并了拉取请求'],
['commented on issue', '提交了评论'],
['All', '全部'],
['Public', '公共'],
['Private', '私有'],
['Sources', '源码'],
['Forks', '复刻'],
['Mirrors', '镜像'],
['New', '新建'],
['Personal settings', '个人设置'],
['Profile', '基本信息'],
['Account', '帐户设置'],
['Emails', '邮箱设置'],
['Notifications', '通知设置'],
['Billing', '财务信息'],
['SSH and GPG keys', 'SSH 和 GPG keys'],
['Security', '安全信息'],
['OAuth applications', '授权应用'],
['Personal access tokens', '访问令牌'],
['Repositories', '仓库管理'],
['Organizations', '组织管理'],
['Saved replies', '快捷回复'],
['Public profile', '基本资料'],
['Profile picture', '我的头像'],
['Upload new picture', '上传新图片'],
['You can also drag and drop a picture from your computer.', '您也可以直接拖拽照片镜像上传.'],
['Name', '昵称'],
['Public email', '公共邮箱'],
['Don’t show my email address', '不显示我的邮箱'],
['You can add or remove verified email addresses in your', '您可以添加或删除邮件地址在您的'],
['personal email settings', '邮箱设置'],
['URL', '网站'],
['Company', '公司'],
['You can', '您可以'],
['other users and organizations to link to them.', '其他用户和组织链接到他们。'],
['Location', '地址'],
['Update profile', '更新资料'],
['Profile updated successfully', '资料更新成功。'],
['Contributions', '贡献'],
['Change password', '修改密码'],
['Old password', '旧的密码'],
['New password', '新的密码'],
['Confirm new password', '再次输入新的密码'],
['Update password', '更新'],
['I forgot my password', '我忘记我的密码了'],
['Looking for two-factor authentication? You can find it in', '使用双重认证?您可以去'],
['Change username', '修改用户名'],
['Delete account', '删除帐户'],
['Delete your account', '确认删除'],
['Your', '您的'],
['Primary', '主帐户'],
['Private', '私有'],
['Public', '公开'],
['How you receive notifications', '通知设置'],
['Automatic watching', '自动关注'],
['Automatically watch repositories', '自动关注仓库'],
['Participating', '参与话题'],
['@mention', '@用户名'],
['Watching', '关注仓库'],
['Save', '保存'],
['verified', '验证'],
['Billing overview', '财务信息'],
['Plan', '方案'],
['Free', '免费'],
['Change plan', '修改方案'],
['per month for', '每月 -'],
['Purchase more', '购买更多'],
['Billing cycle', '结算周期'],
['Bandwidth', '带宽'],
['Storage', '存储'],
['Payment', '支付方式'],
['Add payment method', '添加支付方式'],
['Coupon', '优惠券'],
// Security 菜单
['Two-factor authentication', '双重认证'],
['Status:', '状态:'],
['Off', '未开启'],
['Location:', '地址'],
['Signed in:', '登陆于'],
['Last accessed on', '最后访问时间'],
['Revoke', '注销'],
['Security history', '操作记录'],
['This is a security log of important events involving your account.', '这是您帐户的操作日志'],
// Applications 菜单
['Authorized applications', '已授权的应用'],
['Developer applications', '开发者应用'],
['Revoke all', '注销全部'],
['Sort', '排序'],
['Sort by', '排序方式'],
['Alphabetical', '字母排序'],
['Recently used', '最近使用'],
['Least recently used', '最少使用'],
['choose an image', '选择图片'],
['Code', '代码'],
['Pulse', '统计'],
['Graphs', '图表'],
['Projects', '项目'],
// 仓库描述编辑
['Save', '保存'],
['Cancel', '取消'],
// 关注通知设置
['Notifications', '通知类型'],
['Not watching', '取消关注'],
['Watching', '关注'],
['Ignoring', '忽略'],
['Be notified when participating or @mentioned.', '仅参与交谈或@我时通知我.'],
['Be notified of all conversations.', '所有交谈都通知我.'],
['Never be notified.', '忽略任何通知.'],
['commit', '次提交'],
['commits', '次提交'],
['branch', '分支'],
['branches', '分支'],
['release', '次发布'],
['releases', '次发布'],
['contributor', '个贡献者'],
['contributors', '个贡献者'],
['Copied!', '复制成功!'],
['New pull request', '发起拉取请求'],
['Create new file', '新建文件'],
['Upload files', '上传文件'],
['Find file', '查找文件'],
['Copy path', '复制路径'],
['Clone or download', '克隆或下载'],
['Download ZIP', '下载 ZIP'],
['History', '历史记录'],
['Use SSH', '使用 SSH'],
['Use HTTPS', '使用 HTTPS'],
['Open in Desktop', '从桌面版打开'],
['Clone with SSH', '通过 SSH 克隆'],
['Clone with HTTPS', '通过 HTTPS 克隆'],
['Use an SSH key and passphrase from account.', '使用 SSH 密钥和密码访问。'],
['Use Git or checkout with SVN using the web URL.', '使用 git 或 svn 检出该仓库。'],
['Branch:', '分支:'],
['Switch branches/tags', '选择分支或标签'],
['Branches', '分支'],
['Tags', '标签'],
['Nothing to show', '暂无'],
['File uploading is now available', '现在可以上传文件了'],
['You can now drag and drop files into your repositories.', '您可以直接拖拽文件到该仓库界面进行上传。'],
['Learn more', '查看详情'],
['Dismiss', '我知道了'],
['Watchers', '关注者'],
['Stargazers', '点赞的人'],
['All', '全部'],
['You know', '您关注的'],
['opened this', '打开这个'],
['Issue', '问题'],
['added a commit that closed this issue', '在提交时关闭了这个问题'],
['closed this in', '关闭于'],
['added the', '添加了'],
['added', '添加'],
['and removed', '并移除了'],
['label', '标签'],
['labels', '标签'],
['self-assigned this', '自己受理了该问题'],
['edited', '编辑的'],
['added this to the', '添加到'],
['milestone', '里程碑'],
['closed this', '关闭了'],
['reopened this', '重新打开了'],
['This was referenced', '这是引用'],
['Comment', '提交'],
['Filters', '筛选'],
['Open issues and pull requests', '开放的问题或拉取请求'],
['Your issues', '您提出的问题'],
['Your pull requests', '您的拉取请求'],
['Everything assigned to you', '任何关于您的'],
['Everything mentioning you', '提及您的'],
['View advanced search syntax', '查看高级搜索语法'],
['Labels', '标签'],
['None yet', '暂无'],
['Milestones', '里程碑'],
['No milestone', '无里程碑'],
['Author', '作者'],
['Assignee', '受理人'],
['Assignees', '受理人'],
['No one—', '无人 - '],
['assign yourself', ' 受理自己'],
['No one assigned', '无人受理'],
['Sort', '排序'],
['Filter by author', '筛选用户'],
['Filter users', '筛选用户名'],
['Filter by label', '筛选标签'],
['Filter labels', '筛选标签'],
['Unlabeled', '无标签'],
['Filter by milestone', '筛选里程碑'],
['Filter milestones', '筛选里程碑'],
['Issues with no milestone', '无里程碑'],
['Filter by who’s assigned', '筛选代理人'],
['Assigned to nobody', '无代理人'],
['Sort by', '排序'],
['Newest', '最新的'],
['Oldest', '最老的'],
['Most commented', '最多评论'],
['Least commented', '最少评论'],
['Recently updated', '最近更新'],
['Least recently updated', '最早更新'],
['View all issues in this milestone', '查看这个里程碑的所有问题'],
['Create new page', '创建新页面'],
['Write', '编辑'],
['Preview', '预览'],
['Edit mode:', '编辑模式:'],
['Edit Message', '提交信息'],
['Save Page', '保存页面'],
// settings 页面
['Webhooks & services', 'Web钩子 & 服务'],
['Deploy keys', '部署密钥'],
['Options', '基本选项'],
['Repository name', '仓库名'],
['Rename', '重命名'],
['Features', '特性'],
['Source', '源'],
['branch.', '分支。'],
['Select source', '选择源'],
['Newer', '新的'],
['Older', '旧的'],
['Overview', '概述'],
['Yours', '您的'],
['Active', '活跃的'],
['Stale', '陈旧的'],
['All branches', '所有分支'],
['Search branches…', '搜索分支…'],
['Releases', '发布'],
['Pre-release', '预发布'],
['Downloads', '下载'],
['Notes', '说明'],
['There aren’t any releases here', '没有任何发布内容'],
['Create a new release', '创建一个发布'],
['Releases are powered by', '发布是通过在仓库中标记'],
['tagging specific points of history', '特定历史版本'],
['in a repository. They’re great for marking release points like', ',用于发布的版本类似'],
['Latest release', '最新发布'],
['Read release notes', '阅读发布说明'],
['released this', '发布它'],
['tagged this', '标注'],
['Contributors', '贡献者'],
['Traffic', '流量'],
['Commits', '提交'],
['Code frequency', '频率'],
['Punch card', '时刻'],
['Network', '网络'],
['Members', '成员'],
['Additions', '添加数量'],
['Deletions', '删除数量'],
['Repositories', '仓库'],
['Developers', '开发者'],
['Trending:', '趋势:'],
['Adjust time span', '调整的时间跨度'],
['today', '今天'],
['this week', '本周'],
['this month', '本月'],
['All languages', '所有语言'],
['Unknown languages', '未知语言'],
['Other:', '其他:'],
['Languages', '语言'],
['Sort', '排序'],
['Sort by', '排序方式'],
['Newest', '最新的'],
['Oldest', '最老的'],
['Most commented', '最多评论'],
['Least commented', '最少评论'],
['Recently updated', '最近更新'],
['Least recently updated', '最早更新'],
['Most reactions', '最多回应'],
['Repositories', '仓库'],
['Code', '代码'],
['Users', '用户'],
['Languages', '语言'],
['Advanced search', '高级搜索'],
['Cheat sheet', '搜索技巧'],
['You could try an', '您可以试一试'],
['advanced search', '高级搜索'],
['Sort:', '排序:'],
['Sort options', '排序选项'],
['Best match', '最佳匹配'],
['Most stars', '最多赞'],
['Fewest stars', '最少赞'],
['Most forks', '最多复刻'],
['Fewest forks', '最少复刻'],
['Recently updated', '最近更新'],
['Least recently updated', '最早更新'],
['Sort:', '排序:'],
['Sort options', '排序选项'],
['Recently created', '最近创建的'],
['Least recently created', '最早创建的'],
['Recently updated', '最近更新的'],
['Least recently updated', '最早更新的'],
['Filter:', '筛选:'],
['Filter options', '筛选选项'],
['Public & Secret', '公共 & 私有'],
['Public only', '仅公共'],
['Secret only', '仅私有'],
['forked from', '复刻自'],
['Created', '创建于'],
['View', '查看'],
['Newer', '新的'],
['Older', '旧的'],
// View 代码 页面
['Edit', '编辑'],
['Delete', '删除'],
['Star', '点赞'],
['Unstar', '取消点赞'],
['User actions', '用户操作'],
['Report abuse', '举报该用户'],
['Code', '代码'],
['Revisions', '修订'],
['Stars', '被赞'],
['Forks', '复刻'],
])
replaceText(document.body)
// |
// ₘₙⁿ
// ▏n
// █▏ 、⺍ 所以,不要停下來啊(指加入词条
// █▏ ⺰ʷʷィ
// █◣▄██◣
// ◥██████▋
// ◥████ █▎
// ███▉ █▎
// ◢████◣⌠ₘ℩
// ██◥█◣\≫
// ██ ◥█◣
// █▉ █▊
// █▊ █▊
// █▊ █▋
// █▏ █▙
// █
const bodyObserver = new MutationObserver(mutations => {
mutations.forEach(mutation => {
mutation.addedNodes.forEach(addedNode => replaceText(addedNode))
})
})
bodyObserver.observe(document.body, { childList: true, subtree: true })
function replaceText(node) {
nodeForEach(node).forEach(htmlnode => {
i18n.forEach((value, index) => {
// includes可直接使用 === 以提高匹配精度
const textReg = new RegExp(index, 'g')
if (htmlnode instanceof Text && htmlnode.nodeValue.includes(index))
htmlnode.nodeValue = htmlnode.nodeValue.replace(textReg, value)
else if (htmlnode instanceof HTMLInputElement && htmlnode.value.includes(index))
htmlnode.value = htmlnode.value.replace(textReg, value)
})
})
}
function nodeForEach(node) {
const list = []
if (node.childNodes.length === 0) list.push(node)
else {
node.childNodes.forEach(child => {
if (child.childNodes.length === 0) list.push(child)
else list.push(...nodeForEach(child))
})
}
return list
}
})();