Skip to content

Commit 85e5dc5

Browse files
authored
Merge pull request #67 from Maples7/translate/about
docs(translate): 完成 About 内容的翻译
2 parents 2e800e3 + 1b2141d commit 85e5dc5

File tree

3 files changed

+43
-59
lines changed

3 files changed

+43
-59
lines changed

about/_open-source.md

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
1-
## Swift.org and Open Source
1+
## Swift.org 与开源
22

3-
On December 3, 2015, the Swift language, supporting libraries, debugger, and package manager were published under the [Apache 2.0 license with a Runtime Library Exception](/LICENSE.txt), and Swift.org was created to host the project. The source code is [hosted on GitHub](http://github.com/apple) where it is easy for anyone to get the code, build it themselves, and even create pull requests to contribute code back to the project. Everyone is welcome, even just to [file a bug report](/contributing/#reporting-bugs). There are excellent [Getting Started](/getting-started/) guides available here on the site as well.
3+
2015 年 12 月 3 日,Swift 语言、支持库、调试器以及包管理器以[包括运行时库例外条款的 Apache 2.0 许可证](/LICENSE.txt) 的形式发布,Swift.org 应运而生来主持该项目。源码[托管在 GitHub](http://github.com/apple),任何人都可以轻松获取代码、自行构建,甚至通过创建拉取请求(pull requests)为项目贡献代码。我们欢迎所有人参与,即使只是[提交一个错误报告](/contributing/#reporting-bugs)。网站上也提供了出色的[入门指南](/getting-started/)
44

5-
The project is governed by a core team of engineers that drive the strategic direction by working with the community, and a collection of code owners responsible for the day-to-day project management. Technical leaders come from the community of contributors and anyone can earn the right to lead an area of Swift. The [Community Overview](/community/) includes detailed information on how the Swift community is managed.
5+
该项目由核心工程师团队管理,他们通过与社区合作来推动战略方向,同时由一批代码所有者负责日常项目管理。技术领导者来自贡献者社区,任何人都有机会通过贡献赢得领导 Swift 某一领域的权利。[社区概览](/community/)中提供了关于 Swift 社区是如何进行管理的详细信息。
66

7+
### 项目
78

8-
### Projects
9+
Swift 语言被整理为一系列项目,每个项目都有自己的代码库。目前的项目列表包括:
910

10-
The Swift language is managed as a collection of projects, each with its own repositories. The current list of projects includes:
11-
12-
* The [Swift compiler](/documentation/swift-compiler/) command line tool
13-
* The [standard library](/documentation/standard-library/) bundled as part of the language
14-
* [Core libraries](/documentation/core-libraries/) that provide higher-level functionality
15-
* The [LLDB debugger](/documentation/lldb/) which includes the Swift REPL
16-
* The [Swift package manager](/documentation/package-manager/) for distributing and building Swift source code
17-
* [Xcode playground support](/documentation/lldb/#xcode-playground-support) to enable playgrounds in Xcode.
11+
* [Swift 编译器](/documentation/swift-compiler/)命令行工具
12+
* 作为语言的一部分打包的[标准库](/documentation/standard-library/)
13+
* 提供更层级功能的[核心库](/documentation/core-libraries/)
14+
* 包含 Swift REPL 的 [LLDB 调试器](/documentation/lldb/)
15+
* 用于分发和构建 Swift 源代码的 [Swift 包管理器](/documentation/package-manager/)
16+
* 用于支持 Xcode 中 Playground 功能的 [Xcode Playground 支持](/documentation/lldb/#xcode-playground-support)

about/_platform-support.md

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,23 @@
1-
## Platform Support
1+
## 平台支持
22

3-
One of the most exciting aspects of developing Swift in the open is knowing that it is now free to be ported across a wide range of platforms, devices, and use cases.
3+
以开源方式开发 Swift 最令人兴奋的方面之一是知道它现在可以自由移植到各种平台、设备和应用场景中。
44

5-
Our goal is to provide source compatibility for Swift across all platforms, even though the actual implementation mechanisms may differ from one platform to the next. The primary example is that the Apple platforms include the Objective-C runtime, which is required to access Apple platform frameworks such as UIKit and AppKit. On other platforms, such as Linux, no Objective-C runtime is present, because it isn't necessary.
5+
我们的目标是为所有平台提供 Swift 的源代码兼容性,即使具体的实现机制可能因平台而异。一个主要例子是,Apple 平台包含 Objective-C 运行时,这是访问 UIKit AppKit 等 Apple 平台框架所必需的。而在其他平台(如 Linux)上,没有 Objective-C 运行时,因为它并非必要。
66

7-
The [Swift core libraries project](/documentation/core-libraries/) aims to
8-
extend the cross-platform capabilities of Swift by providing portable
9-
implementations of fundamental Apple frameworks (such as Foundation)
10-
without dependencies on the Objective-C runtime. Although the core
11-
libraries are in an early stage of development, they will eventually
12-
provide improved source compatibility for Swift code across all
13-
platforms.
7+
[Swift 核心库项目](/documentation/core-libraries/)旨在通过提供基本 Apple 框架(如 Foundation)的可移植实现来扩展 Swift 的跨平台能力,而无需依赖 Objective-C 运行时。尽管核心库目前处于开发的早期阶段,但最终将提升 Swift 代码在各个平台上的源代码兼容性。
148

15-
### Apple Platforms
16-
17-
Open-source Swift can be used on the Mac to target all of the Apple
18-
platforms: iOS, macOS, watchOS, and tvOS. Moreover, binary builds of
19-
open-source Swift integrate with the Xcode developer tools, including
20-
complete support for the Xcode build system, code completion in the
21-
editor, and integrated debugging, allowing anyone to experiment with
22-
the latest Swift developments in a familiar Cocoa and Cocoa Touch
23-
development environment.
9+
### Apple 平台
2410

11+
开源的 Swift 可以在 Mac 上使用,并可以以所有的 Apple 平台作为编译目标:iOS、macOS、watchOS 和 tvOS。此外,开源 Swift 的二进制构建与 Xcode 开发工具进行了集成,包括对 Xcode 构建系统的完整支持、编辑器中的代码补全和集成调试功能,让任何人都可以在熟悉的 Cocoa 和 Cocoa Touch 开发环境中尝试最新的 Swift 功能。
2512

2613
### Linux
2714

28-
Open-source Swift can be used on Linux to build Swift libraries and
29-
applications. The open-source binary builds provide the Swift compiler and standard library, Swift REPL and debugger (LLDB), and the [core libraries](/documentation/core-libraries/), so one can jump right in to Swift development.
30-
15+
开源的 Swift 可以在 Linux 上用于构建 Swift 库和应用程序。开源二进制构建提供了 Swift 编译器和标准库、Swift REPL 和调试器(LLDB),以及[核心库](/documentation/core-libraries/),因此开发者可以立即开始使用 Swift 开发。
3116

3217
### Windows
3318

34-
Open source Swift can be used on Windows to build Swift libraries and applications. The open source binary builds provide C/C++/Swift toolchains, the standard library, and debugger (LLDB), as well as the [core libraries](/documentation/core-libraries/), so one can jump right in to Swift development. SourceKit-LSP is bundled into the releases to enable developers to be quickly productive with the IDE of their choice.
19+
开源的 Swift 可以在 Windows 上用于构建 Swift 库和应用程序。开源二进制构建提供 C/C++/Swift 工具链、标准库和调试器(LLDB),以及[核心库](/documentation/core-libraries/),因此开发者可以立即开始使用 Swift 开发。同时,发布版本中包含 SourceKit-LSP,支持开发者在自己选择的 IDE 中高效工作。
3520

36-
### New Platforms
21+
### 新平台
3722

38-
We can't wait to see the new places we can bring Swift---together. We truly believe that this language that we love can make software safer, faster, and easier to maintain. We'd love your help to bring Swift to even more computing platforms.
23+
我们迫不及待地想与大家一起将 Swift 带到更多新的平台上。我们坚信,这门我们热爱的编程语言能够让软件变得更安全、更快速、更易于维护。我们热切期待你的加入,共同将 Swift 推广到更多计算平台上。

about/index.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,39 @@
11
---
22
layout: page
3-
title: About Swift
3+
title: 关于 Swift
44
---
55

6-
Swift is a general-purpose programming language that's approachable for newcomers and powerful for experts. It is fast, modern, safe, and a joy to write.
6+
Swift 是一种通用编程语言,对新手友好,同时也足够强大,能满足专业需求。它快速、现代、安全,并且编写起来充满乐趣。
77

8-
* Swift is general-purpose and modern. Suitable for everything from systems programming, through mobile and desktop apps, to cloud services.
9-
* Swift is safe. Undefined behavior is the enemy of safety, and it’s best to catch mistakes before software goes into production. Swift makes the obvious path the safest.
10-
* Swift is fast to run and quick to write. It comes with predictable and consistent performance that is on-par with C-based languages without sacrificing developer friendliness.
11-
* Swift is approachable and powerful. From a single-line “Hello, World!” to large-scale apps with hundreds of thousands of lines. Swift scales with your needs.
8+
* Swift 是通用且现代的:适用于从系统编程到移动和桌面应用,再到云服务的各种场景。
9+
* Swift 是安全的:未定义行为是安全的敌人,且最好在软件投入生产前就捕获错误。Swift 让最明显的路径成为最安全的选择。
10+
* Swift 运行快,编写也高效:它提供可预测且一致的性能,与基于 C 的编程语言性能相当,同时没有牺牲对开发的友好性。
11+
* Swift 既简单易学又功能强大:从简单的单行代码的“Hello, World!”到拥有数十万行代码的大型应用,Swift 都能按你的需求扩展。
1212

13-
## Tools
13+
## 工具
1414

15-
Tools are a critical part of the Swift ecosystem. We strive to integrate well within a developer's toolset, to build quickly, to present excellent diagnostics, and to enable interactive development experiences. Tools can make programming so much more powerful, like Swift-based playgrounds do in Xcode, or a web-based REPL can when working with Linux server-side code.
15+
工具是 Swift 生态系统的重要组成部分。我们致力于与开发者的工具集良好集成,快速构建,提供出色的诊断功能,并支持交互式开发体验。工具能够极大地提升编程的能力,比如 Xcode 中基于 Swift 的 Playground,或在处理 Linux 服务端代码时的基于 Web 的 REPL
1616

17-
## Features
17+
## 特性
1818

19-
Swift includes features that make code easier to read and write, while giving the developer the control needed in a true systems programming language. Swift supports inferred types to make code cleaner and less prone to mistakes, and modules eliminate headers and provide namespaces. Memory is managed automatically, and you don’t even need to type semi-colons. Swift also borrows from other languages, for instance named parameters brought forward from Objective-C are expressed in a clean syntax that makes APIs in Swift easy to read and maintain.
19+
Swift 拥有许多特性,使代码更易读易写,同时赋予开发者在真正系统编程语言中所需的控制力。Swift 支持类型推断,让代码更简洁、更不易出错;Swift 的模块消灭了头文件并提供了命名空间;Swift 的内存管理是自动化的;Swift 代码中甚至无需输入分号。此外,Swift 借鉴了其他语言的优势,例如从 Objective-C 引入的命名参数,通过简洁的语法表达,使 Swift 的 API 易于阅读和维护。
2020

21-
The features of Swift are designed to work together to create a language that is powerful, yet fun to use. Some additional features of Swift include:
21+
Swift 的特性相辅相成,打造出一种强大却又有趣的实用编程语言。Swift 的一些其他的特性包括:
2222

23-
* Closures unified with function pointers
24-
* Tuples and multiple return values
25-
* Generics
26-
* Fast and concise iteration over a range or collection
27-
* Structs that support methods, extensions, and protocols
28-
* Functional programming patterns, e.g., map and filter
29-
* Powerful error handling built-in
30-
* Advanced control flow with `do`, `guard`, `defer`, and `repeat` keywords
23+
* 闭包与函数指针的统一
24+
* 元组与多返回值的支持
25+
* 泛型
26+
* 对范围(Range)和集合(Collection)类型快速简洁的遍历
27+
* 支持方法(method)、扩展(extension)和协议(protocol)的结构体(Struct)
28+
* 函数式编程模式,例如 map filter
29+
* 内置强大的错误处理机制
30+
* 使用 `do``guard``defer` `repeat` 关键字实现高级控制流
3131

32-
### Safety
32+
### 安全
3333

34-
Swift was designed from the outset to be safer than C-based languages, and eliminates entire classes of unsafe code. Variables are always initialized before use, arrays and integers are checked for overflow, and memory is managed automatically. Syntax is tuned to make it easy to define your intent — for example, simple three-character keywords define a variable (`var`) or constant (`let`).
34+
Swift 从一开始就设计得比基于 C 的语言更安全,并消除了各种不安全代码的问题。变量在使用前必须初始化,数组和整数会进行溢出检查,内存管理是自动化的。语法经过优化,便于清晰表达意图,例如使用简单的三个字符关键字定义一个变量(`var`)或常量(`let`)。
3535

36-
Another safety feature is that by default Swift objects can never be `nil`, and trying to make or use a `nil` object results in a compile-time error. This makes writing code much cleaner and safer, and prevents a common cause of runtime crashes. However, there are cases where `nil` is appropriate, and for these situations Swift has an innovative feature known as **optionals**. An optional may contain `nil`, but Swift syntax forces you to safely deal with it using ``?`` to indicate to the compiler you understand the behavior and will handle it safely.
36+
另一个安全特性是 Swift 对象(object)在默认情况下不能为 `nil`,尝试创建或使用 `nil` 对象会导致编译时错误。这使代码编写更清晰、更安全,并避免了一种运行时崩溃的常见原因。然而,在某些情况下,`nil` 是合适的,为此 Swift 提供了一项创新特性,称为 **可选值(optionals**。可选值可以包含 `nil` 值,但 Swift 的语法要求你使用 ``?`` 向编译器明确表示你理解这种行为并会安全地处理它,从而强制实现安全的可选值操作。
3737

3838
{% include_relative _platform-support.md %}
3939
{% include_relative _open-source.md %}

0 commit comments

Comments
 (0)