-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Conversation
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.
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.
_zh-cn/tour/basics.md
Outdated
|
||
这是一种简单的、零设置的方法来实践Scala的代码片段。 | ||
|
||
这篇文档中的大部分代码示例集成了ScalaFiddle,所以你可以直接点击“Run"按钮来实践。 |
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 can be translated better.
Try 这篇文档中的大部分代码都可以用ScalaFiddle来运行,直接点击“Run"按钮便可以运行
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.
I agree
``` | ||
你可以使用`println`来输出表达式的结果。 | ||
|
||
{% scalafiddle %} |
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.
btw this is super cool 😃
_zh-cn/tour/basics.md
Outdated
``` | ||
{% endscalafiddle %} | ||
|
||
### 常量 |
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 means constant
. Is there a word that is closer to Value
?
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.
从字面上说,可能“值”更合适,但是从意思上讲的话,“常量”可能更适合。
你可以使用`val`关键字来给表达式的结果命名。 | ||
|
||
```tut | ||
val x = 1 + 1 |
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.
Wait, why are those not integrated with ScalaFiddle?
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.
Because it's not in the English version, too.
_zh-cn/tour/basics.md
Outdated
println(x) // 2 | ||
``` | ||
|
||
对于结果比如这里的`x`的命名,被称为常量。引用一个常量不会再次计算。 |
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.
again, 常量 is constant, doesn't sound like value to me
|
||
这样的做法在实践中有利于使得表达明确无误。 | ||
|
||
## 私有成员和Getter/Setter语法 |
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.
私有成员 sounds like a human being
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.
It's also a common translation.
|
||
## Scala类型层次结构 ## | ||
|
||
[`Any`](http://www.scala-lang.org/api/2.12.1/scala/Any.html)是所有类型的超类型,也称为顶级类 |
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.
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 = '☺' |
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.
😃
_zh-cn/tour/unified-types.md
Outdated
val number: Int = face // 9786 | ||
``` | ||
|
||
转换是单向,且不是编译期的。 |
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 will not compile
definitely can't be translated into 且不是编译期的
_zh-cn/tour/unified-types.md
Outdated
## Nothing和Null | ||
`Nothing`是所有类型的子类型,也称为底部类型。没有一个值是`Nothing`类型的。它的用途之一是给出非正常终止的信号,如抛出异常、程序退出或者一个无限循环(可以理解为它是一个不对值进行定义的表达式的类型,或者是一个不能正常返回的方法)。 | ||
|
||
`Null`是所有引用类型的子类型(即`AnyRef`的任意子类型)。它有一个单例值由关键字`null`所定义。`Null`主要用于和其他JVM语言的互操作性,但是几乎不应该在Scala代码中使用。我们将在后面的章节中介绍`null`的替代方案。 |
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.
``Null主要用于和其他JVM语言的互操作性
doesn't sound right
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 |
Thanks for you advice. About terms of scala, I've collected some recently. I'll do better in the translation of the later articles. |
@coalchan thanks, you're doing well! keep up the good work :) 🥇 |
@xingyif 刚开始翻译容易直译,目前已经翻译好几篇了,貌似渐入佳境了 😆 |
No description provided.