-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
1330: languageguide-propertiesmd⭐️⭐️⭐️⭐️⭐️ #1360
base: swift-6-beta-translation
Are you sure you want to change the base?
1330: languageguide-propertiesmd⭐️⭐️⭐️⭐️⭐️ #1360
Conversation
@4dmoonlight @bh3236 有空请帮忙 Review Thx! |
whereas computed properties calculate (rather than store) a value. | ||
Computed properties are provided by classes, structures, and enumerations. | ||
Stored properties are provided only by classes and structures. | ||
*属性*将值与特定的类、结构或枚举关联。存储属性将常量和变量值作为实例的一部分进行存储,而计算属性则计算(而不是存储)一个值。计算属性由类、结构和枚举提供。存储属性仅由类和结构提供。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
属性 -> 属性
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中文 改成加粗
@@ -102,38 +77,31 @@ rangeOfThreeItems.firstValue = 6 | |||
let length: Int | |||
} | |||
-> var rangeOfThreeItems = FixedLengthRange(firstValue: 0, length: 3) | |||
// the range represents integer values 0, 1, and 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
”<!-- “
中的注释不翻译
``` | ||
|
||
<!-- | ||
- test: `storedProperties-err` | ||
|
||
```swifttest | ||
-> let rangeOfFourItems = FixedLengthRange(firstValue: 0, length: 4) | ||
// this range represents integer values 0, 1, 2, and 3 | ||
// 该区间表示整数 0,1,2,3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
This behavior is due to structures being *value types*. | ||
When an instance of a value type is marked as a constant, | ||
so are all of its properties. | ||
这种行为是由于结构体属于*值类型*。当值类型的实例被声明为常量的时候,它的所有属性也就成了常量。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加粗 同上
whereas computed properties calculate (rather than store) a value. | ||
Computed properties are provided by classes, structures, and enumerations. | ||
Stored properties are provided only by classes and structures. | ||
*属性*将值与特定的类、结构或枚举关联。存储属性将常量和变量值作为实例的一部分进行存储,而计算属性则计算(而不是存储)一个值。计算属性由类、结构和枚举提供。存储属性仅由类和结构提供。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
结构改为结构体
complete 1330-language guide-properties