the-swift-programming-language-in-chinese README

The project's README from github.com/SwiftGGTeam/the-swift-programming-language-in-chinese. As one markdown file: README.md.

The Swift Programming Language (Simplified Chinese Version by SwiftGG)

🚀 MiniMax Token Plan 惊喜上线!新增语音、音乐、视频和图片生成权益。邀请好友享双重好礼,助力开发体验! 好友立享 8.8折 专属优惠 + Builder 权益,你赢返利 + 社区特权! 👉 立即参与


English Version | 中文版本

English Version

This repository contains the source for The Swift Programming Language (sometimes abbreviated as TSPL), which is published on docs.swift.org and built using Swift-DocC.

This repository includes the latest version of TSPL, as well as Simplified Chinese translations corresponding to different Swift versions.

Building

Clone this repository and run docc preview swift-6.docc in this repository's root directory.

After running DocC, open the link that docc outputs to display a local preview in your browser.

Current Status

How to Contribute

  1. Fork this repository to your account. Claim a translation task labeled as Swift x translation in the issues. Create a branch in your forked repository corresponding to the issue, setting the source branch to the current Swift version being translated (e.g., swift-6-beta-translation).

  2. Install the docc command-line tool by either downloading the toolchain from Swift.org or installing Xcode.

Note:

If you installed DocC by downloading a toolchain from Swift.org, docc is located in usr/bin/, relative to the installation path of the toolchain. Make sure your shell's PATH environment variable includes that directory.

If you installed DocC by downloading Xcode, run xcrun docc preview swift-6.docc instead.

  1. Replace the content of the original Markdown file with your Chinese translation, following the terminology table below and the SwiftGG style guide. Submit your translation through a Pull Request. Once verified by SwiftGG members, it will be merged into the current translation branch.

Contributors

We extend our heartfelt thanks to all our contributors. You can find the list of contributors here.

中文版本

本仓库包含 The Swift Programming Language (缩写为 TSPL) 的源代码, 该文档发布在 docs.swift.org 上, 并使用 Swift-DocC 构建。

本仓库包括 TSPL 的最新版本,以及对应不同 Swift 版本的简体中文翻译。

构建

克隆此仓库并在仓库根目录运行 docc preview swift-6.docc。

运行 DocC 后,打开 docc 输出的链接,即可在浏览器中显示本地预览。

当前状态

如何贡献

  1. 首先,将此仓库 fork 到您的账户。在 issues 中认领标记为 Swift x translation 的翻译任务。在您 fork 的仓库中创建与 issue 对应的分支,将源分支设置为当前正在翻译的 Swift 版本 (例如,swift-6-beta-translation)。

  2. 通过从 Swift.org 下载 toolchain 或安装 Xcode 来安装 docc 命令行工具。

注意:

如果您通过从 Swift.org 下载 toolchain 安装了 DocC, docc 位于 toolchain 安装路径下的 usr/bin/ 目录中。 确保您的 shell 的 PATH 环境变量包含该目录。

如果您通过下载 Xcode 安装了 DocC, 请运行 xcrun docc preview swift-6.docc。

  1. 按照下面的术语表和 SwiftGG 排版指南 将原始 Markdown 文件的内容替换为您的中文翻译。通过 Pull Request 提交您的翻译。经 SwiftGG 成员验证后,将合并到当前的翻译分支。

参与成员

我们衷心感谢所有的参与成员。您可以在这里找到参与成员列表。

Terminology Table(术语表)

Term Suggest Transition
alias 别名
array 数组
argument 实参
assertion 断言
associated type 关联类型
associated value 关联值
attribute 特性或者属性,根据上下文
automatic reference counting 自动引用计数
availability-condition 可用性条件
base class 基类
binary operator 二元运算符
boxed protocol type 封装协议类型
branch statement 分支语句
Class Hierarchy 类层次结构
closure 闭包
collection 集合
computed property 计算属性
conditional compilation 条件编译
conform protocol 遵循协议
control transfer statement 控制传递语句
convenience initializer 便利构造器
convention 约定
decompose 分解
deinitialization 析构过程
deinitializer 析构器
designated initializer 指定构造器
dictionary 字典
downcast 向下转型
enumeration 枚举
expression 表达式
extension 扩展
fallback (value) 后备值 ?? 回退值
fallthrough 贯穿
first-class 一等
function 函数
generic 泛型
getter 不翻译
implicitly unwrapped optional 隐式解包可选值
inheritance 继承
initialization 构造过程
initializer 构造器
iterate 迭代
labeled statement 具名语句
list 列表
literal (value) 字面量
metatype type 元类型
method 方法
nest 嵌套
nil-coalescing 不译
note 注意
opaque type 不透明类型
operator 运算符
optional 可选
optional binding 可选绑定
optional chaining 可选链
override 重写
parameter 形参
playground 不翻译
projected value 被呈现值
property 属性
property wrapper 属性包装器
protocol 协议
protocol composition type 复合协议类型
result builder 结果构造器
range 区间
raw value 原始值
runtime 运行时
scope 作用域
setter 不翻译
statement 语句
stored property 存储属性
string interpolation 字符串插值
structure 结构体
subscript 下标
ternary operator 三元运算符
tuple 元组
type alias 类型别名
type annotation 类型注解
type identifier 类型标识符
type property 类型属性
type inference 类型推断
type casting 类型转换
unary operator 一元运算符
unwrapped 解包
variadic parameters 可变参数
wrapped 包装
wrapped value 被包装值
superclass 父类
subclass 子类

the-swift-programming-language-in-chinese (SwiftGGTeam/the-swift-programming-language-in-chinese)

Searching Database…

这是什么?Apple 官方 Swift 书籍《The Swift Programming Language》(TSPL)的简体中文翻译版,由 SwiftGG 社区维护。
那这里只有中文内容,还是英文原书也在里面?都在——这个仓库既保存了 TSPL 最新英文版的源文件,也包含对应不同 Swift 版本的简体中文翻译。
我在本地怎么构建和预览这本书?克隆仓库,在其根目录运行 docc preview swift-6.docc,然后打开 DocC 打印出来的链接,书就会以本地预览的形式出现在你的浏览器里。
在这之前我需要装什么才能跑起来?需要 docc 这个命令行工具:可以从 Swift.org 工具链下载(把它的 usr/bin 加到 PATH 里),或者直接安装 Xcode,改用 xcrun docc preview swift-6.docc 来预览。
中文版跟上最新的 Swift 了吗?还没有完全跟上——Swift 6 beta 的翻译仍在进行中;Swift 5.x 及更早版本的中文版已经完成。
不想自己搭建的话,我在哪里可以在线阅读?英文版发布在 docs.swift.org 上,Swift 5.x 及更早版本的已完成中文翻译可以在 GitBook 上阅读。
翻译具体是怎么做出来的?志愿者 fork 仓库,认领带有 'Swift x translation' 标签的 issue,翻译对应的 Markdown 文件,然后提交 pull request——每篇翻译都要经过 SwiftGG 成员审核后才会合并。
译者这么多,团队是怎么保持术语统一的?大家共用一张术语表,为关键术语固定了推荐的中文译法(比如 closure 译作 闭包,optional 译作 可选),另外贡献者还必须遵守 SwiftGG 的风格指南。
为什么 README 开头有 MiniMax 的广告?那是赞助位:这个仓库目前在推广 MiniMax Token Plan,提供折扣和开发者福利。它只是广告,和书的内容没有任何关系。
Size
107.5 MB
Stars
21.2K
Updated
CommitApr 08
Age
12y
Commits · 90 Days