Skip to content

Commit 0530527

Browse files
committed
Merge pull request #450 from eed3si9n/topic/merge-280
Adds Chinese translation (Subsumes #280)
2 parents a4b18c8 + 89de7d6 commit 0530527

File tree

71 files changed

+5218
-26
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+5218
-26
lines changed

_layouts/guides-thanks.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
layout: index
3+
---
4+
5+
<div class="container">
6+
<div class="row">
7+
<div class="span10">
8+
{{ content }}
9+
</div>
10+
11+
</div>
12+
</div>

overviews/collections/arrays.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 10
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
[Array](http://www.scala-lang.org/api/{{ site.scala-version }}/scala/Array.html) is a special kind of collection in Scala. On the one hand, Scala arrays correspond one-to-one to Java arrays. That is, a Scala array `Array[Int]` is represented as a Java `int[]`, an `Array[Double]` is represented as a Java `double[]` and a `Array[String]` is represented as a Java `String[]`. But at the same time, Scala arrays offer much more than their Java analogues. First, Scala arrays can be _generic_. That is, you can have an `Array[T]`, where `T` is a type parameter or abstract type. Second, Scala arrays are compatible with Scala sequences - you can pass an `Array[T]` where a `Seq[T]` is required. Finally, Scala arrays also support all sequence operations. Here's an example of this in action:

overviews/collections/concrete-immutable-collection-classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 8
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
Scala provides many concrete immutable collection classes for you to choose from. They differ in the traits they implement (maps, sets, sequences), whether they can be infinite, and the speed of various operations. Here are some of the most common immutable collection types used in Scala.

overviews/collections/concrete-mutable-collection-classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 9
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
You've now seen the most commonly used immutable collection classes that Scala provides in its standard library. Take a look now at the mutable collection classes.

overviews/collections/conversions-between-java-and-scala-collections.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 17
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
Like Scala, Java also has a rich collections library. There are many similarities between the two. For instance, both libraries know iterators, iterables, sets, maps, and sequences. But there are also important differences. In particular, the Scala libraries put much more emphasis on immutable collections, and provide many more operations that transform a collection into a new one.

overviews/collections/creating-collections-from-scratch.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 16
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
You have syntax `List(1, 2, 3)` to create a list of three integers and `Map('A' -> 1, 'C' -> 2)` to create a map with two bindings. This is actually a universal feature of Scala collections. You can take any collection name and follow it by a list of elements in parentheses. The result will be a new collection with the given elements. Here are some more examples:

overviews/collections/equality.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 13
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
The collection libraries have a uniform approach to equality and hashing. The idea is, first, to divide collections into sets, maps, and sequences. Collections in different categories are always unequal. For instance, `Set(1, 2, 3)` is unequal to `List(1, 2, 3)` even though they contain the same elements. On the other hand, within the same category, collections are equal if and only if they have the same elements (for sequences: the same elements in the same order). For example, `List(1, 2, 3) == Vector(1, 2, 3)`, and `HashSet(1, 2) == TreeSet(2, 1)`.

overviews/collections/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ disqus: true
66

77
partof: collections
88
num: 1
9-
languages: [ja, pt-br]
9+
languages: [ja, zh-cn, pt-br]
1010
---
1111

1212
**Martin Odersky, and Lex Spoon**
13-
13+
1414
In the eyes of many, the new collections framework is the most significant
1515
change in the Scala 2.8 release. Scala had collections before (and in fact the new
1616
framework is largely compatible with them). But it's only 2.8 that

overviews/collections/iterators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 15
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
An iterator is not a collection, but rather a way to access the elements of a collection one by one. The two basic operations on an iterator `it` are `next` and `hasNext`. A call to `it.next()` will return the next element of the iterator and advance the state of the iterator. Calling `next` again on the same iterator will then yield the element one beyond the one returned previously. If there are no more elements to return, a call to `next` will throw a `NoSuchElementException`. You can find out whether there are more elements to return using [Iterator](http://www.scala-lang.org/api/{{ site.scala-version }}/scala/collection/Iterator.html)'s `hasNext` method.

overviews/collections/maps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 7
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
A [Map](http://www.scala-lang.org/api/current/scala/collection/Map.html) is an [Iterable](http://www.scala-lang.org/api/current/scala/collection/Iterable.html) consisting of pairs of keys and values (also named _mappings_ or _associations_). Scala's [Predef](http://www.scala-lang.org/api/current/scala/Predef$.html) class offers an implicit conversion that lets you write `key -> value` as an alternate syntax for the pair `(key, value)`. For instance `Map("x" -> 24, "y" -> 25, "z" -> 26)` means exactly the same as `Map(("x", 24), ("y", 25), ("z", 26))`, but reads better.

overviews/collections/migrating-from-scala-27.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ disqus: true
77
partof: collections
88
num: 18
99
outof: 18
10-
languages: [ja]
10+
languages: [ja, zh-cn]
1111
---
1212

1313
Porting your existing Scala applications to use the new collections should be almost automatic. There are only a couple of possible issues to take care of.

overviews/collections/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 2
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
Scala collections systematically distinguish between mutable and

overviews/collections/performance-characteristics.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 12
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
The previous explanations have made it clear that different collection types have different performance characteristics. That's often the primary reason for picking one collection type over another. You can see the performance characteristics of some common operations on collections summarized in the following two tables.

overviews/collections/seqs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 5
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
The [Seq](http://www.scala-lang.org/api/current/scala/collection/Seq.html) trait represents sequences. A sequence is a kind of iterable that has a `length` and whose elements have fixed index positions, starting from `0`.

overviews/collections/sets.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 6
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
`Set`s are `Iterable`s that contain no duplicate elements. The operations on sets are summarized in the following table for general sets and in the table after that for mutable sets. They fall into the following categories:

overviews/collections/strings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 11
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
Like arrays, strings are not directly sequences, but they can be converted to them, and they also support all sequence operations on strings. Here are some examples of operations you can invoke on strings.

overviews/collections/trait-iterable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 4
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
The next trait from the top in the collections hierarchy is `Iterable`. All methods in this trait are defined in terms of an an abstract method, `iterator`, which yields the collection's elements one by one. The `foreach` method from trait `Traversable` is implemented in `Iterable` in terms of `iterator`. Here is the actual implementation:

overviews/collections/trait-traversable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 3
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
At the top of the collection hierarchy is trait `Traversable`. Its only abstract operation is `foreach`:

overviews/collections/views.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ disqus: true
66

77
partof: collections
88
num: 14
9-
languages: [ja]
9+
languages: [ja, zh-cn]
1010
---
1111

1212
Collections have quite a few methods that construct new collections. Examples are `map`, `filter` or `++`. We call such methods transformers because they take at least one collection as their receiver object and produce another collection as their result.

overviews/core/_posts/2010-11-30-actors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: overview
33
title: The Scala Actors API
44
overview: actors
5-
languages: [es]
5+
languages: [zh-cn, es]
66
---
77

88
**Philipp Haller and Stephen Tu**

overviews/core/_posts/2010-12-15-architecture-of-scala-collections.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
layout: overview
33
title: The Architecture of Scala Collections
44
overview: architecture-of-scala-collections
5+
languages: [zh-cn]
56
---
67

78
**Martin Odersky and Lex Spoon**

overviews/core/_posts/2012-09-20-futures.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Futures and Promises
44
label-color: success
55
label-text: New in 2.10
66
overview: futures
7-
languages: [ja]
7+
languages: [ja, zh-cn]
88
---
99

1010
**By: Philipp Haller, Aleksandar Prokopec, Heather Miller, Viktor Klang, Roland Kuhn, and Vojin Jovanovic**

overviews/core/_posts/2012-09-20-implicit-classes.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
---
22
layout: overview
33
title: Implicit Classes
4+
overview: implicit-classes
45
label-color: success
56
label-text: Available
7+
languages: [zh-cn]
68
---
79

810
**Josh Suereth**

overviews/core/_posts/2012-09-21-string-interpolation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ disqus: true
55
label-color: success
66
label-text: New in 2.10
77
overview: string-interpolation
8-
languages: [es, ja]
8+
languages: [es, ja, zh-cn]
99
---
1010

1111
**Josh Suereth**

overviews/core/_posts/2012-11-03-value-classes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: Value Classes and Universal Traits
44
label-color: success
55
label-text: New in 2.10
66
overview: value-classes
7-
languages: [ja]
7+
languages: [ja, zh-cn]
88
---
99

1010
**Mark Harrah**

overviews/core/_posts/2012-11-08-actors-migration-guide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ layout: overview
33
title: The Scala Actors Migration Guide
44
label-color: success
55
label-text: New in 2.10
6+
overview: actors-migration-guide
7+
languages: [zh-cn]
68
---
79

810
**Vojin Jovanovic and Philipp Haller**

overviews/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: guides-index
33
title: Guides and Overviews
4-
languages: [es, ja]
4+
languages: [ja, zh-cn, es]
55
---
66

77
<div class="page-header-index">

overviews/parallel-collections/architecture.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ title: Architecture of the Parallel Collections Library
55
disqus: true
66

77
partof: parallel-collections
8+
languages: [ja, zh-cn, es]
89
num: 5
910
---
1011

overviews/parallel-collections/concrete-parallel-collections.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ title: Concrete Parallel Collection Classes
55
disqus: true
66

77
partof: parallel-collections
8+
languages: [ja, zh-cn, es]
89
num: 2
910
---
1011

overviews/parallel-collections/configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ title: Configuring Parallel Collections
55
disqus: true
66

77
partof: parallel-collections
8+
languages: [ja, zh-cn, es]
89
num: 7
910
---
1011

overviews/parallel-collections/conversions.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ title: Parallel Collection Conversions
55
disqus: true
66

77
partof: parallel-collections
8+
languages: [ja, zh-cn, es]
89
num: 3
910
---
1011

overviews/parallel-collections/ctries.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ title: Concurrent Tries
55
disqus: true
66

77
partof: parallel-collections
8+
languages: [ja, zh-cn, es]
89
num: 4
910
---
1011

overviews/parallel-collections/custom-parallel-collections.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ title: Creating Custom Parallel Collections
55
disqus: true
66

77
partof: parallel-collections
8+
languages: [ja, zh-cn, es]
89
num: 6
910
---
1011

overviews/parallel-collections/overview.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ title: Overview
55
disqus: true
66

77
partof: parallel-collections
8+
languages: [ja, zh-cn, es]
89
num: 1
910
---
1011

overviews/parallel-collections/performance.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ disqus: true
77
partof: parallel-collections
88
num: 8
99
outof: 8
10-
languages: [ja, es]
10+
languages: [ja, zh-cn, es]
1111
---
1212

1313
## Performance on the JVM

pt-br/overviews/collections/introduction.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ partof: collections
99
num: 1
1010

1111
about: Este documento foi traduzido por <a href="http://douglasjose.com">Douglas José</a>. Licensed by Douglas José under a CC-BY-SA 3.0 license.
12-
languages: [ja, pt-br]
12+
language: pt-br
1313
---
1414

1515
**Martin Odersky, and Lex Spoon**

0 commit comments

Comments
 (0)