Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1334: feat: 完成 1334 The Basics⭐️⭐️⭐️⭐️⭐️ #1373

Open
wants to merge 1 commit into
base: swift-6-beta-translation
Choose a base branch
from

Conversation

hdmdhr
Copy link
Collaborator

@hdmdhr hdmdhr commented Aug 24, 2024

原文链接:https://docs.swift.org/swift-book/documentation/the-swift-programming-language/thebasics

也更新了一部分 README 内的对照表

Closes #1334

Copy link
Collaborator

@Shinolr Shinolr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议按照中文习惯保留完整段落,不要换行,换行会插入空格。

Because it's an alias,
the call to `AudioSample.min` actually calls `UInt16.min`,
which provides an initial value of `0` for the `maxAmplitudeFound` variable.
`在这里,AudioSample` 被定义为 `UInt16` 的别名。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

``范围


Conversions between integer and floating-point numeric types must be made explicit:
整数和浮点数值类型之间的转换必须明确:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explicit 和 explicitly 翻译成显式会不会更好?比如:整数和浮点数类型之间的转换必须显式进行。可以考虑一下。文中一共 17 处涉及这两个单词的翻译,不重复提了

you'll trigger a runtime error.
The result is exactly the same as if you write an exclamation point
to force unwrap a normal optional that doesn't contain a value.
如果一个隐式解包的可选值为 `nil`,而你试图访问它的包装值,就会触发运行时错误。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

术语表:wrapped value 被包装值

当 `nil` 表示不可恢复的故障时(如程序员错误或状态损坏),
你可以通过在可选名称的末尾添加感叹号 (`!`) 来访问底层值。
这被称为*强制解包*可选的值。
强制解包一个非 `nil` 值时,结果是其解包值。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

术语表:wrapped value 被包装值

> In the `welcomeMessage` example above, no initial value is provided,
> and so the type of the `welcomeMessage` variable is specified with a type annotation
> rather than being inferred from an initial value.
> 备注: 在实践中很少需要编写类型注解。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文中有几处翻译成了注意,有几处翻译成了备注

and so this second example passes the type-check.
Comparisons like `i == 1` are discussed in <doc:BasicOperators>.
`i == 1` 的比较结果是 `Bool` 类型,因此第二个示例通过了类型检查。
类似 `i == 1` 的比较结果将在<doc:BasicOperators>中讨论。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<>前后空格

@yongfrank yongfrank changed the title feat: 完成 1334 The Basics 1334: feat: 完成 1334 The Basics⭐️⭐️⭐️⭐️⭐️ Sep 22, 2024
@yongfrank yongfrank removed the request for review from brooklyn1999 September 22, 2024 12:43
@yongfrank
Copy link

@hdmdhr 方便的话可以采纳合理的 Review Thx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Under Review
Development

Successfully merging this pull request may close these issues.

LanguageGuide / the-basics.md ⭐️⭐️⭐️⭐️⭐️
3 participants