back to home

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

中文版 Apple 官方《Swift 编程语言》

21,214 stars
5,067 forks
1 issues
MarkdownHTMLSwift

AI Architecture Analysis

This repository is indexed by RepoMind. By analyzing SwiftGGTeam/the-swift-programming-language-in-chinese in our AI interface, you can instantly generate complete architecture diagrams, visualize control flows, and perform automated security audits across the entire codebase.

Our Agentic Context Augmented Generation (Agentic CAG) engine loads full source files into context, avoiding the fragmentation of traditional RAG systems. Ask questions about the architecture, dependencies, or specific features to see it in action.

Embed this Badge

Showcase RepoMind's analysis directly in your repository's README.

[![Analyzed by RepoMind](https://img.shields.io/badge/Analyzed%20by-RepoMind-4F46E5?style=for-the-badge)](https://repomind-ai.vercel.app/repo/SwiftGGTeam/the-swift-programming-language-in-chinese)
Preview:Analyzed by RepoMind

Repository Summary (README)

Preview

The Swift Programming Language (Simplified Chinese Version by SwiftGG)

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

  • Latest English version of The Swift Programming Language. Latest commit: 11a2b29
  • Corresponding Simplified Chinese translations (in progress and archived):
    • Swift 6 beta (currently in translation)
    • Swift 5.x and earlier versions (available for reading on GitBook)

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(术语表)

TermSuggest 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子类