Skip to content

Commit

Permalink
【压缩历史翻译 20240508】
Browse files Browse the repository at this point in the history
重构于新版本后,修复 lint 问题

撤回汉化,这可能是...

这可能是git输出判定字串,考虑在调用处再替换文本来汉化

拉取请求文件改变

上游

冲突

暂存区

SSH

教程

安装包图像

登录 - 优化措辞

储存库菜单

行展开按钮 - 修改措辞

创建储存库 - 漏译

拉取请求评论 - 漏译

初始化GitLFS

Git LFS 过滤器更新

登录令牌失效

安装Git提示

推送分支提交

冒号标准化(只是个注释)

措辞优化

空格标准化

短的英文/数字段不加空格

问号标准化

无改动窗口

差异对比窗口

文件改动栏 - 修复括号

储存库页标题栏

差异对比窗口的右键菜单

改动列表 - 修补漏译(详情...)

这里还是决定汉化了默认的标题摘要。
本来是考虑到应该使用英文来提交给开源储存库,不过如果是认真提交的话肯定也会自己写摘要,随便提交一下的话也根本不在意摘要是中文还是英文了,所以最终还是改为默认中文了。

头像功能

找不到编辑器/终端对话框

差异对比设置

设置 - 补充漏译

命令行工具已安装对话框

复刻目的对话框

设置别名对话框

报错文本

大按钮

撤回提交对话框、优化措辞

放弃暂存区对话框

覆盖暂存区对话框

登录页面

无法打开终端对话框

重置到提交对话框

发布储存库对话框

教程储存库

打开拉取请求对话框

拉取请求

重构对话框

合并对话框

无法打开编辑器对话框

删除储存库对话框

创建标签对话框

克隆在线储存库对话框

重新运行检查

PR列表项

标准化翻译(储存库)

标准化翻译(HEAD 指针)

HEAD 已是特定称呼。
例:游离的 HEAD 指针

(这里是否需要不加空格呢?)

文件改动状态 - 优化措辞

高级设置 - 优化措辞...

兼容 Fetch "获取"的旧译法和"更新"这种更易听懂的叫法

设置界面

摘要字数提示 - 修改措辞

Git邮箱未找到提示 - 修复句号重复

分支列表 - 的名字(暂时给提交历史用的)

提交历史

复制按钮的提示

拖动提示

工具栏按钮

进度显示、强制推送框、操作名称

确定放弃所有改动

确定检出提示框

Fetch译为获取更新,这样可以...

这样既可以兼容旧的“获取”叫法,又能看懂在获取什么。

macOS在应用程序文件夹外运行提示

归属错误页

文件改动栏

协作者输入框

文件状态函数

一些文档链接改到中文版

菜单栏等 - “获取”改为“更新”,因为...

因为在 undo-commit.tsx 中也把 Fetch 叫储存库更新,而获取这个词过于宽泛不易理解。

拼写检查

菜单栏 - 优化翻译

菜单栏 - 删除Alt访问键,因为已经有很多快捷键了,碍事

菜单栏 - 优化翻译

右键菜单

无法放弃改动页

一大堆“不再显示”按钮

本地修改被覆盖页

主界面、服务器不可信页

横幅、菜单栏 - 微小的翻译调整

报错页

更新日志页

横幅页(组件) - 优化更新提示语

关于页 - 优化排版

关于页 - 优化措辞

菜单栏

报错重启弹窗

横幅页(组件)- 修补翻译

横幅页(组件)我也想要礼物卡呀

这里东西超级多

关于页 - 优化措辞

开源许可页 - 优化翻译

窗口页(组件)-□x悬停提示

关于页 - 再次优化排版

奇奇怪怪

添加储存库页 - 漏了个按钮

自动完成页(组件)

添加储存库页

对话框默认按钮

开源许可页

关于页 - 优化排版

中文时间日期 - 不加空格了

和系统里的显示方式不搭

欢迎页

中文时间日期

关于页
  • Loading branch information
zetaloop committed May 8, 2024
1 parent ccdaa77 commit c8767de
Show file tree
Hide file tree
Showing 173 changed files with 1,441 additions and 1,808 deletions.
24 changes: 12 additions & 12 deletions app/src/crash/crash-app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ export class CrashApp extends React.Component<ICrashAppProps, ICrashAppState> {
private renderTitle() {
const message =
this.state.type === 'launch'
? 'GitHub Desktop failed to launch'
: 'GitHub Desktop encountered an error'
? 'GitHub Desktop 启动失败'
: 'GitHub Desktop 遇到问题'

return (
<header>
Expand All @@ -151,19 +151,19 @@ export class CrashApp extends React.Component<ICrashAppProps, ICrashAppState> {
if (this.state.type === 'launch') {
return (
<p>
GitHub Desktop encountered a catastrophic error that prevents it from
launching. This has been reported to the team, but if you encounter
this repeatedly please report this issue to the GitHub Desktop{' '}
<LinkButton uri={issuesUri}>issue tracker</LinkButton>.
GitHub Desktop
遇到了一个灾难性的错误,导致无法启动。此问题已报告给开发团队。但如果您反复遇到这个错误,请在{' '}
<LinkButton uri={issuesUri}>GitHub Desktop 的问题跟踪器</LinkButton>{' '}
中报告此问题。
</p>
)
} else {
return (
<p>
GitHub Desktop has encountered an unrecoverable error and will need to
restart. This has been reported to the team, but if you encounter this
repeatedly please report this issue to the GitHub Desktop{' '}
<LinkButton uri={issuesUri}>issue tracker</LinkButton>.
GitHub Desktop
遇到了一个无法恢复的错误,需要重新启动。此问题已报告给开发团队。但如果您反复遇到这个错误,请在{' '}
<LinkButton uri={issuesUri}>GitHub Desktop 的问题跟踪器</LinkButton>{' '}
中报告此问题。
</p>
)
}
Expand All @@ -188,9 +188,9 @@ export class CrashApp extends React.Component<ICrashAppProps, ICrashAppState> {
// We don't support restarting in dev mode since we can't
// control the life time of the dev server.
if (__DEV__) {
quitText = __DARWIN__ ? 'Quit' : 'Exit'
quitText = __DARWIN__ ? '退出' : '退出'
} else {
quitText = __DARWIN__ ? 'Quit and Restart' : 'Exit and restart'
quitText = __DARWIN__ ? '退出并重启软件' : '退出并重启软件'
}

return (
Expand Down
4 changes: 2 additions & 2 deletions app/src/lib/editors/launch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ export async function launchExternalEditor(
const editorPath = editor.path
const exists = await pathExists(editorPath)
if (!exists) {
const label = __DARWIN__ ? 'Settings' : 'Options'
const label = __DARWIN__ ? '设置' : '设置'
throw new ExternalEditorError(
`Could not find executable for '${editor.editor}' at path '${editor.path}'. Please open ${label} and select an available editor.`,
`找不到编辑器 '${editor.editor}' 的可执行文件 '${editor.path}'。请打开${label}并选择一个可用的编辑器。`,
{ openPreferences: true }
)
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/lib/editors/lookup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ export async function findEditorOrDefault(
if (name) {
const match = editors.find(p => p.editor === name) || null
if (!match) {
const menuItemName = __DARWIN__ ? 'Settings' : 'Options'
const message = `The editor '${name}' could not be found. Please open ${menuItemName} and choose an available editor.`
const menuItemName = __DARWIN__ ? '设置' : '设置'
const message = `找不到编辑器 '${name}'。请打开${menuItemName}并选择一个可用的编辑器。`

throw new ExternalEditorError(message, { openPreferences: true })
}
Expand Down
4 changes: 2 additions & 2 deletions app/src/lib/format-date.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ const getDateFormatter = mem(Intl.DateTimeFormat, {
*/
export const formatDate = (date: Date, options: Intl.DateTimeFormatOptions) =>
isNaN(date.valueOf())
? 'Invalid date'
: getDateFormatter('en-US', options).format(date)
? '无效日期'
: getDateFormatter('zh-CN', options).format(date)
8 changes: 6 additions & 2 deletions app/src/lib/format-duration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@ export const formatLongPreciseDuration = (ms: number) => {
if (parts.length > 0 || ms >= unit.ms || unit.shortUnit === 's') {
const qty = Math.floor(ms / unit.ms)
ms -= qty * unit.ms
parts.push(`${qty} ${unit.longUnit}${qty === 1 ? '' : 's'}`)
parts.push(`${qty} ${unit.longUnit}`)
}
}

return parts.join(' ')
return parts
.join('')
.replace(/hour/g, '小时')
.replace(/minute/g, '分钟')
.replace(/second/g, '秒')
}
2 changes: 1 addition & 1 deletion app/src/lib/format-relative.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const getRelativeFormatter = mem(
)

export function formatRelative(ms: number) {
const formatter = getRelativeFormatter('en-US', { numeric: 'auto' })
const formatter = getRelativeFormatter('zh-CN', { numeric: 'auto' })

const sign = ms < 0 ? -1 : 1

Expand Down
6 changes: 3 additions & 3 deletions app/src/lib/git/checkout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ export async function checkoutBranch(
const opts = await getCheckoutOpts(
repository,
account,
`Checking out branch ${branch.name}`,
`正在检出分支 ${branch.name}`,
branch.name,
progressCallback,
`Switching to ${__DARWIN__ ? 'Branch' : 'branch'}`
`切换到该${__DARWIN__ ? '分支' : '分支'}`
)

const baseArgs = getCheckoutArgs(progressCallback)
Expand Down Expand Up @@ -155,7 +155,7 @@ export async function checkoutCommit(
commit: CommitOneLine,
progressCallback?: ProgressCallback
): Promise<true> {
const title = `Checking out ${__DARWIN__ ? 'Commit' : 'commit'}`
const title = `正在检出${__DARWIN__ ? '分支' : '分支'}`
const opts = await getCheckoutOpts(
repository,
account,
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/git/clone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export async function clone(
if (progressCallback) {
args.push('--progress')

const title = `Cloning into ${path}`
const title = `正在克隆到 ${path}`
const kind = 'clone'

opts = await executionOptionsWithProgress(
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/git/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export async function fetch(
}

if (progressCallback) {
const title = `Fetching ${remote.name}`
const title = `正在获取 ${remote.name}`
const kind = 'fetch'

opts = await executionOptionsWithProgress(
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/git/pull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export async function pull(
}

if (progressCallback) {
const title = `Pulling ${remote.name}`
const title = `正在拉取 ${remote.name}`
const kind = 'pull'

opts = await executionOptionsWithProgress(
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/git/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ export async function push(

if (progressCallback) {
args.push('--progress')
const title = `Pushing to ${remote.name}`
const title = `正在推送到 ${remote.name}`
const kind = 'push'

opts = await executionOptionsWithProgress(
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/progress/checkout.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { GitProgressParser } from './git'

const steps = [{ title: 'Checking out files', weight: 1 }]
const steps = [{ title: '正在检出文件', weight: 1 }]

/**
* A class that parses output from `git checkout --progress` and provides
Expand Down
8 changes: 4 additions & 4 deletions app/src/lib/progress/clone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { GitProgressParser } from './git'
* of the individual progress reporting steps in a clone operation
*/
const steps = [
{ title: 'remote: Compressing objects', weight: 0.1 },
{ title: 'Receiving objects', weight: 0.6 },
{ title: 'Resolving deltas', weight: 0.1 },
{ title: 'Checking out files', weight: 0.2 },
{ title: '远程端:正在压缩对象', weight: 0.1 },
{ title: '正在接收对象', weight: 0.6 },
{ title: '正在解析增量', weight: 0.1 },
{ title: '正在检出文件', weight: 0.2 },
]

/**
Expand Down
10 changes: 5 additions & 5 deletions app/src/lib/progress/lfs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class GitLFSProgressParser {
total: totalEstimated,
percent: 0,
done: false,
text: `${verb} ${fileName} (${finishedFiles} out of an estimated ${fileCount} completed, ${transferProgress})`,
text: `${verb} ${fileName} (${fileCount}个,已完成${finishedFiles}个,${transferProgress})`,
}

return {
Expand All @@ -116,13 +116,13 @@ export class GitLFSProgressParser {
private directionToHumanFacingVerb(direction: string): string {
switch (direction) {
case 'download':
return 'Downloading'
return '正在下载'
case 'upload':
return 'Uploading'
return '正在上传'
case 'checkout':
return 'Checking out'
return '正在检出'
default:
return 'Downloading'
return '正在下载'
}
}
}
8 changes: 4 additions & 4 deletions app/src/lib/progress/pull.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import { GitProgressParser } from './git'
* delta updates are fairly quick though.
*/
const steps = [
{ title: 'remote: Compressing objects', weight: 0.1 },
{ title: 'Receiving objects', weight: 0.7 },
{ title: 'Resolving deltas', weight: 0.15 },
{ title: 'Checking out files', weight: 0.15 },
{ title: '远程端:正在压缩对象', weight: 0.1 },
{ title: '正在接收对象', weight: 0.7 },
{ title: '正在解析增量', weight: 0.15 },
{ title: '正在检出文件', weight: 0.15 },
]

/**
Expand Down
6 changes: 3 additions & 3 deletions app/src/lib/progress/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { GitProgressParser } from './git'
* of the individual progress reporting steps in a push operation
*/
const steps = [
{ title: 'Compressing objects', weight: 0.2 },
{ title: 'Writing objects', weight: 0.7 },
{ title: 'remote: Resolving deltas', weight: 0.1 },
{ title: '正在压缩对象', weight: 0.2 },
{ title: '正在发送对象', weight: 0.7 },
{ title: '远程端:正在解析增量', weight: 0.1 },
]

/**
Expand Down
2 changes: 1 addition & 1 deletion app/src/lib/shells/darwin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { parseEnumValue } from '../enum'
import { FoundShell } from './shared'

export enum Shell {
Terminal = 'Terminal',
Terminal = '终端',
Hyper = 'Hyper',
iTerm2 = 'iTerm2',
PowerShellCore = 'PowerShell Core',
Expand Down
10 changes: 5 additions & 5 deletions app/src/lib/shells/linux.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ import { pathExists } from '../../ui/lib/path-exists'
import { FoundShell } from './shared'

export enum Shell {
Gnome = 'GNOME Terminal',
Mate = 'MATE Terminal',
Gnome = 'GNOME 终端',
Mate = 'MATE 终端',
Tilix = 'Tilix',
Terminator = 'Terminator',
Urxvt = 'URxvt',
Konsole = 'Konsole',
Xterm = 'XTerm',
Terminology = 'Terminology',
Deepin = 'Deepin Terminal',
Elementary = 'Elementary Terminal',
XFCE = 'XFCE Terminal',
Deepin = '深度终端',
Elementary = 'Elementary 终端',
XFCE = 'XFCE 终端',
Alacritty = 'Alacritty',
Kitty = 'Kitty',
}
Expand Down
16 changes: 5 additions & 11 deletions app/src/lib/shells/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ export function parse(label: string): Shell {
return Linux.parse(label)
}

throw new Error(
`Platform not currently supported for resolving shells: ${process.platform}`
)
throw new Error(`平台目前不支持解析终端: ${process.platform}`)
}

/** Get the shells available for the user. */
Expand All @@ -67,9 +65,7 @@ export async function getAvailableShells(): Promise<
return shellCache
}

return Promise.reject(
`Platform not currently supported for resolving shells: ${process.platform}`
)
return Promise.reject(`平台目前不支持解析终端: ${process.platform}`)
}

/** Find the given shell or the default if the given shell can't be found. */
Expand All @@ -94,9 +90,9 @@ export async function launchShell(
// platform-specific build targets.
const exists = await pathExists(shell.path)
if (!exists) {
const label = __DARWIN__ ? 'Settings' : 'Options'
const label = __DARWIN__ ? '设置' : '设置'
throw new ShellError(
`Could not find executable for '${shell.shell}' at path '${shell.path}'. Please open ${label} and select an available shell.`
`找不到终端 '${shell.shell}' 的可执行文件 '${shell.path}'。请打开${label}并选择一个可用的终端。`
)
}

Expand All @@ -114,9 +110,7 @@ export async function launchShell(
addErrorTracing(shell.shell, cp, onError)
return Promise.resolve()
} else {
return Promise.reject(
`Platform not currently supported for launching shells: ${process.platform}`
)
return Promise.reject(`平台目前不支持解析终端: ${process.platform}`)
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/src/lib/shells/win32.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ import { pathExists } from '../../ui/lib/path-exists'
import { FoundShell } from './shared'

export enum Shell {
Cmd = 'Command Prompt',
Cmd = '命令提示符',
PowerShell = 'PowerShell',
PowerShellCore = 'PowerShell Core',
Hyper = 'Hyper',
GitBash = 'Git Bash',
Cygwin = 'Cygwin',
WSL = 'WSL',
WindowTerminal = 'Windows Terminal',
WindowTerminal = '终端', // 应用名显示为终端
FluentTerminal = 'Fluent Terminal',
Alacritty = 'Alacritty',
}
Expand Down
23 changes: 15 additions & 8 deletions app/src/lib/status.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,26 +19,33 @@ import { ManualConflictResolution } from '../models/manual-conflict-resolution'
*
* Used in file lists.
*/
export function mapStatus(status: AppFileStatus): string {
export function mapStatus(status: AppFileStatus, cn: boolean = false): string {
// 拿UI文字来作为工作逻辑去找图标??太抽象了,只能这么改了
switch (status.kind) {
case AppFileStatusKind.New:
case AppFileStatusKind.Untracked:
return 'New'
return cn ? '新增' : 'New'
case AppFileStatusKind.Modified:
return 'Modified'
return cn ? '修改' : 'Modified'
case AppFileStatusKind.Deleted:
return 'Deleted'
return cn ? '删除' : 'Deleted'
case AppFileStatusKind.Renamed:
return 'Renamed'
return cn ? '重命名' : 'Renamed'
case AppFileStatusKind.Conflicted:
if (isConflictWithMarkers(status)) {
const conflictsCount = status.conflictMarkerCount
return conflictsCount > 0 ? 'Conflicted' : 'Resolved'
return conflictsCount > 0
? cn
? '冲突'
: 'Conflicted'
: cn
? '已解决冲突'
: 'Resolved'
}

return 'Conflicted'
return cn ? '冲突' : 'Conflicted'
case AppFileStatusKind.Copied:
return 'Copied'
return cn ? '复制' : 'Copied'
default:
return assertNever(status, `Unknown file status ${status}`)
}
Expand Down
Loading

0 comments on commit c8767de

Please sign in to comment.