Skip to content

Add three Chinese translation of tour #1118

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

Merged
merged 5 commits into from
Aug 13, 2018
Merged

Add three Chinese translation of tour #1118

merged 5 commits into from
Aug 13, 2018

Conversation

coalchan
Copy link
Contributor

@coalchan coalchan commented Aug 1, 2018

No description provided.

Copy link
Contributor

@xingyif xingyif left a comment

Choose a reason for hiding this comment

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

It helps if it's checked/ changed after translating in a translator. There are many sentences that don't sound like that would be how people would normally say it in day-to-day life.


这是一种简单的、零设置的方法来实践Scala的代码片段。

这篇文档中的大部分代码示例集成了ScalaFiddle,所以你可以直接点击“Run"按钮来实践。
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be translated better.
Try 这篇文档中的大部分代码都可以用ScalaFiddle来运行,直接点击“Run"按钮便可以运行

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I agree

```
你可以使用`println`来输出表达式的结果。

{% scalafiddle %}
Copy link
Contributor

Choose a reason for hiding this comment

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

btw this is super cool 😃

```
{% endscalafiddle %}

### 常量
Copy link
Contributor

Choose a reason for hiding this comment

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

This means constant. Is there a word that is closer to Value?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

从字面上说,可能“值”更合适,但是从意思上讲的话,“常量”可能更适合。

你可以使用`val`关键字来给表达式的结果命名。

```tut
val x = 1 + 1
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait, why are those not integrated with ScalaFiddle?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it's not in the English version, too.

println(x) // 2
```

对于结果比如这里的`x`的命名,被称为常量。引用一个常量不会再次计算。
Copy link
Contributor

Choose a reason for hiding this comment

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

again, 常量 is constant, doesn't sound like value to me


这样的做法在实践中有利于使得表达明确无误。

## 私有成员和Getter/Setter语法
Copy link
Contributor

Choose a reason for hiding this comment

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

私有成员 sounds like a human being

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's also a common translation.


## Scala类型层次结构 ##

[`Any`](http://www.scala-lang.org/api/2.12.1/scala/Any.html)是所有类型的超类型,也称为顶级类
Copy link
Contributor

@xingyif xingyif Aug 4, 2018

Choose a reason for hiding this comment

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

Many terms that are technical (and I am not sure if they even have any corresponding Mandarin terms in the previous files), which might be better to keep the technical terms in English.

val x: Long = 987654321
val y: Float = x // 9.8765434E8 (note that some precision is lost in this case)

val face: Char = '☺'
Copy link
Contributor

Choose a reason for hiding this comment

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

😃

val number: Int = face // 9786
```

转换是单向,且不是编译期的。
Copy link
Contributor

Choose a reason for hiding this comment

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

This will not compile definitely can't be translated into 且不是编译期的

## Nothing和Null
`Nothing`是所有类型的子类型,也称为底部类型。没有一个值是`Nothing`类型的。它的用途之一是给出非正常终止的信号,如抛出异常、程序退出或者一个无限循环(可以理解为它是一个不对值进行定义的表达式的类型,或者是一个不能正常返回的方法)。

`Null`是所有引用类型的子类型(即`AnyRef`的任意子类型)。它有一个单例值由关键字`null`所定义。`Null`主要用于和其他JVM语言的互操作性,但是几乎不应该在Scala代码中使用。我们将在后面的章节中介绍`null`的替代方案。
Copy link
Contributor

Choose a reason for hiding this comment

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

``Null主要用于和其他JVM语言的互操作性 doesn't sound right

@xingyif
Copy link
Contributor

xingyif commented Aug 4, 2018

BTW, I found a good website for the tech terms: https://people.ubuntu.com/~happyaron/l10n/%E8%BD%AF%E4%BB%B6%E5%B7%A5%E7%A8%8B%E4%B8%AD%E8%8B%B1%E5%AF%B9%E7%85%A7%E6%9C%AF%E8%AF%AD%E8%A1%A8-old.html

@coalchan
Copy link
Contributor Author

Thanks for you advice. About terms of scala, I've collected some recently. I'll do better in the translation of the later articles.

@xingyif
Copy link
Contributor

xingyif commented Aug 12, 2018

@coalchan thanks, you're doing well! keep up the good work :) 🥇
@SethTisue this pr looks good to me

@coalchan
Copy link
Contributor Author

@xingyif 刚开始翻译容易直译,目前已经翻译好几篇了,貌似渐入佳境了 😆

@SethTisue SethTisue merged commit 1af86f6 into scala:master Aug 13, 2018
@SethTisue
Copy link
Member

SethTisue commented Aug 13, 2018

thank you, @coalchan and @xingyif!

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.

3 participants