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

zh-cn for Scala Tour:Case Classes #1174

Merged
merged 3 commits into from
Feb 8, 2019
Merged

Conversation

declan94
Copy link
Member

Simplified Chinese version of Scala Tour:Case Classes

val message3 = Message("jorge@catalonia.es", "guillaume@quebec.ca", "Com va?")
val messagesAreTheSame = message2 == message3 // true
```
尽管`message2`和`message3`引用不同的对象,但是他们的值是相等的,所以`message2 == message3`为`true`。
Copy link
Member

Choose a reason for hiding this comment

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

引用不同的对象

How about this? 參照到不同的物件

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry but I don't think "參照到不同的物件" conforms to common programming terminologies in Chinese.

Copy link
Member

Choose a reason for hiding this comment

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

Ah, I got it. It's just the different wording.

Choose a reason for hiding this comment

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

「对象」for "object" is mainland China usage, whereas in Taiwan it is usually 「物件」.

@He-Pin
Copy link

He-Pin commented Oct 11, 2018

Are you in any QQ or wechat group?

@declan94
Copy link
Member Author

Are you in any QQ or wechat group?

Not yet

Copy link

@Qi77Qi Qi77Qi left a comment

Choose a reason for hiding this comment

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

没毛病lgtm

message5.recipient // claire@bourgogne.fr
message5.body // "Me zo o komz gant ma amezeg"
```
上述代码`message4`的`recipient`被用作为了`message5`的`sender`,重新指定了`message5`的`recipient`,而`message4`的`body`则是直接拷贝作为`message5`的`body`了。
Copy link
Member

Choose a reason for hiding this comment

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

被用作为了

这里不通顺

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks, have reorganized statement.

@SethTisue
Copy link
Member

@declan94 want to get this across the finish line? looks like there's one review comment from @dongxuwang that you haven't responded to yet

@declan94
Copy link
Member Author

@declan94 want to get this across the finish line? looks like there's one review comment from @dongxuwang that you haven't responded to yet

Thanks, have responded and submitted another commit

@@ -13,3 +13,48 @@ language: zh-cn
next-page: pattern-matching
previous-page: multiple-parameter-lists
---

案例类(Case classes)和普通类差不多,只有几点关键差别,接下来的介绍将会涵盖这些差别。案例类非常适合用于不可变的数据。下一节将会介绍他们在[模式匹配](pattern-matching.html)中的应用。
Copy link
Contributor

Choose a reason for hiding this comment

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

我看 Programming Scala 中文版翻译为样例类。这里翻译为案例类有什么特别的缘由么?如果可能,最好能够统一。

我个人倾向样例类,因为字面上其与pattern match有所关联,而且不必创造新的词。但是,如果多数人共识使用案例类,我觉得也行。

Copy link
Contributor

Choose a reason for hiding this comment

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

我们是处理成case类的

Copy link
Contributor

Choose a reason for hiding this comment

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

case类我觉得也可以,没有任何误解的可能性。

@SethTisue
Copy link
Member

@liufengyun is this ready for merge?

@SethTisue
Copy link
Member

ping @liufengyun

@liufengyun
Copy link
Contributor

Yes, I think it can go in.

@SethTisue SethTisue merged commit 8454496 into scala:master Feb 8, 2019
@SethTisue
Copy link
Member

thank you @declan94 and reviewers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants