Skip to content

Commit

Permalink
Merge pull request #1404 from SwiftGGTeam/main
Browse files Browse the repository at this point in the history
修改了 集合类型
  • Loading branch information
chenranj authored Dec 28, 2024
2 parents a976913 + ed524e2 commit 6e96047
Show file tree
Hide file tree
Showing 239 changed files with 172 additions and 777 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
push:
branches:
- main
- release/*
jobs:
deploy:
runs-on: "macos-15"
permissions:
contents: read
deployments: write
name: Deploy to Cloudflare Pages
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Install npm packages
run: npm install
- name: Setup Xcode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "16.0"
- name: Get swift version
run: swift --version
- name: Build
run: xcrun docc convert swift-6.docc --output-path ./docs --transform-for-static-hosting --experimental-enable-custom-templates
- name: Copy Redirects
run: cp swift-6.docc/_redirects ./docs/_redirects
- name: Publish
uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: swift-programming-lang
directory: ./docs
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@
node_modules
package-lock.json
**/.docc-build
docs

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ This repository includes the latest version of TSPL, as well as Simplified Chine

## Building

Clone this repository and run `docc preview swift-6-beta.docc`
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
Expand Down Expand Up @@ -41,7 +41,7 @@ to display a local preview in your browser.
> includes that directory.
>
> If you installed DocC by downloading Xcode,
> run `xcrun docc preview swift-6-beta.docc` instead.
> run `xcrun docc preview swift-6.docc` instead.
3. Replace the content of the original Markdown file with your Chinese translation, following the terminology table below and the [SwiftGG style guide][swiftgg-style-guide]. Submit your translation through a Pull Request. Once verified by SwiftGG members, it will be merged into the current translation branch.

Expand All @@ -59,13 +59,13 @@ We extend our heartfelt thanks to all our contributors. You can find the [list o

## 构建

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

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

## 当前状态

- The Swift Programming Language 的最新英文版本。[最新提交: 11a2b29][11a2b29]
- The Swift Programming Language 的最新英文版本。[最新提交: fe0121d][https://github.com/swiftlang/swift-book/commit/fe0121d1f2d86d6139c2b424d45a7889b82ff5e2]
- 对应的简体中文翻译 (进行中和已归档):
- Swift 6 beta (当前正在翻译)
- Swift 5.x 及更早版本 (可在 [GitBook][legacy-documentations] 上阅读)
Expand All @@ -83,7 +83,7 @@ We extend our heartfelt thanks to all our contributors. You can find the [list o
> 确保您的 shell 的 `PATH` 环境变量包含该目录。
>
> 如果您通过下载 Xcode 安装了 DocC,
> 请运行 `xcrun docc preview swift-6-beta.docc`
> 请运行 `xcrun docc preview swift-6.docc`
3. 按照下面的术语表和 [SwiftGG 排版指南][swiftgg-style-guide] 将原始 Markdown 文件的内容替换为您的中文翻译。通过 Pull Request 提交您的翻译。经 SwiftGG 成员验证后,将合并到当前的翻译分支。

Expand Down
File renamed without changes
6 changes: 0 additions & 6 deletions TSPL.docc/GuidedTour/AboutSwift.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ Swift continues to evolve with thoughtful new features and powerful capabilities
The goals for Swift are ambitious.
We can’t wait to see what you create with it.

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/GuidedTour/Compatibility.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@ that's divided into multiple frameworks,
you can migrate your code to a newer language version
one framework at a time.

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/GuidedTour/GuidedTour.md
Original file line number Diff line number Diff line change
Expand Up @@ -2449,12 +2449,6 @@ anyCommonElements([1, 2, 3], [3])
Writing `<T: Equatable>`
is the same as writing `<T> ... where T: Equatable`.

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/AccessControl.md
Original file line number Diff line number Diff line change
Expand Up @@ -1508,12 +1508,6 @@ but a public type alias can't alias an internal, file-private, or private type.
```
-->

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/AdvancedOperators.md
Original file line number Diff line number Diff line change
Expand Up @@ -1561,12 +1561,6 @@ see <doc:Attributes#resultBuilder>.
TODO: generic operators
-->

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/AutomaticReferenceCounting.md
Original file line number Diff line number Diff line change
Expand Up @@ -1512,12 +1512,6 @@ paragraph = nil
For more information about capture lists,
see <doc:Expressions#Capture-Lists>.

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/BasicOperators.md
Original file line number Diff line number Diff line change
Expand Up @@ -1231,12 +1231,6 @@ but the overall intention is clearer to the reader.
Readability is always preferred over brevity;
use parentheses where they help to make your intentions clear.

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/ClassesAndStructures.md
Original file line number Diff line number Diff line change
Expand Up @@ -710,12 +710,6 @@ see [Manual Memory Management](https://developer.apple.com/documentation/swift/s
QUESTION: what's the deal with tuples and reference types / value types?
-->

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/Closures.md
Original file line number Diff line number Diff line change
Expand Up @@ -1333,12 +1333,6 @@ As a result,
the value of the `customerProvider` argument
must be allowed to escape the function's scope.

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/CollectionTypes.md
Original file line number Diff line number Diff line change
Expand Up @@ -1469,12 +1469,6 @@ Swift's `Dictionary` type doesn't have a defined ordering.
To iterate over the keys or values of a dictionary in a specific order,
use the `sorted()` method on its `keys` or `values` property.

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
10 changes: 2 additions & 8 deletions TSPL.docc/LanguageGuide/Concurrency.md
Original file line number Diff line number Diff line change
Expand Up @@ -759,10 +759,10 @@ The code above makes several changes from the previous version:
[`Task.isCancelled` instance]: https://developer.apple.com/documentation/swift/task/iscancelled-swift.property

For work that needs immediate notification of cancellation,
use the [`Task.withTaskCancellationHandler(operation:onCancel:)`][] method.
use the [`Task.withTaskCancellationHandler(operation:onCancel:isolation:)`][] method.
For example:

[`Task.withTaskCancellationHandler(operation:onCancel:)`]: https://developer.apple.com/documentation/swift/withtaskcancellationhandler(operation:oncancel:)
[`Task.withTaskCancellationHandler(operation:onCancel:isolation:)`]: https://developer.apple.com/documentation/swift/withtaskcancellationhandler(operation:oncancel:isolation:)

```swift
let task = await Task.withTaskCancellationHandler {
Expand Down Expand Up @@ -1431,12 +1431,6 @@ preventing the type from being sendable.
but maybe link to them?
-->

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/ControlFlow.md
Original file line number Diff line number Diff line change
Expand Up @@ -2259,12 +2259,6 @@ when the check contains only fallback code.
You can use it with if-let, and other Boolean conditions, using a comma
-->

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).

<!--
This source file is part of the Swift.org open source project

Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/Deinitialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,12 +242,6 @@ and so it's deallocated in order to free up its memory.
Just before this happens, its deinitializer is called automatically,
and its coins are returned to the bank.

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/Enumerations.md
Original file line number Diff line number Diff line change
Expand Up @@ -830,12 +830,6 @@ by evaluating the expression on the left-hand side,
evaluating the expression on the right-hand side,
and then adding them or multiplying them.

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/ErrorHandling.md
Original file line number Diff line number Diff line change
Expand Up @@ -982,12 +982,6 @@ even when no error handling code is involved.
For more information,
see <doc:ControlFlow#Deferred-Actions>.

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/Extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -682,12 +682,6 @@ and prints an appropriate description.
> can be written in shorthand form inside the `switch` statement,
> such as `.negative` rather than `Int.Kind.negative`.
> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/Functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -1304,12 +1304,6 @@ print("zero!")
```
-->

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/Generics.md
Original file line number Diff line number Diff line change
Expand Up @@ -1964,12 +1964,6 @@ is a sequence of integers.
TODO: Describe how Optional<Wrapped> works
-->

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/Inheritance.md
Original file line number Diff line number Diff line change
Expand Up @@ -607,12 +607,6 @@ Any attempt to subclass a final class is reported as a compile-time error.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-->

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/Initialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -2954,12 +2954,6 @@ print(board.squareIsBlackAt(row: 7, column: 7))
```
-->

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
6 changes: 0 additions & 6 deletions TSPL.docc/LanguageGuide/Macros.md
Original file line number Diff line number Diff line change
Expand Up @@ -765,12 +765,6 @@ in no particular order:
- `TokenSyntax`
-->

> Beta Software:
>
> This documentation contains preliminary information about an API or technology in development. This information is subject to change, and software implemented according to this documentation should be tested with final operating system software.
>
> Learn more about using [Apple's beta software](https://developer.apple.com/support/beta-software/).
<!--
This source file is part of the Swift.org open source project
Expand Down
Loading

0 comments on commit 6e96047

Please sign in to comment.