Skip to content

Commit b1bd21c

Browse files
McF4rMcF4r
authored andcommitted
chinese version
1 parent 4068db4 commit b1bd21c

Some content is hidden

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

64 files changed

+1497
-1
lines changed

.DS_Store

6 KB
Binary file not shown.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Japanese translation by _Koji Shimada_ & _Masayoshi Takahashi_
2020
Russian translation by [_Alexander Nikolaev_](https://github.com/startaper)
2121
Ukrainian translation by [_Andrii Palchik_](https://github.com/andriipalchik)
2222
Macedonian translation by [_Violeta Pavleska_](https://github.com/violeta-p)
23+
Chinese translation by [Ye Junzhe](https://github.com/McF4r)
2324

2425
Suggestions to improve translations are welcome.
2526
If you submit a pull request updating a translation please

collector.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ def initialize(app, options_hash={}, &block)
155155
Collector.new('translations/ru/try_ruby_*.md', 'source/try_ruby_ru.json').collect
156156
Collector.new('translations/ua/try_ruby_*.md', 'source/try_ruby_ua.json').collect
157157
Collector.new('translations/mk/try_ruby_*.md', 'source/try_ruby_mk.json').collect
158-
158+
Collector.new('translations/cn/try_ruby_*.md', 'source/try_ruby_cn.json').collect
159+
159160
# TODO: add any new translations here
160161

161162
true

source/about.html.markdown

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Japanese translation by _Koji Shimada_ & _Masayoshi Takahashi_
5050
Russian translation by _Alexander Nikolaev_
5151
Ukrainian translation by _Andrii Palchik_
5252
Macedonian translation by _Violeta Pavleska_
53+
Chinese translation by _Ye Junzhe_
5354

5455
### Privacy
5556

source/layouts/_navbar.html.erb

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@
118118
>
119119
Македонски
120120
</button>
121+
<button
122+
class="dropdown-item"
123+
data-change-lang="cn"
124+
aria-controls="tryruby-content"
125+
>
126+
中文
127+
</button
121128
</div>
122129
</li>
123130
</ul>

source/try_ruby_cn.json

Lines changed: 56 additions & 0 deletions
Large diffs are not rendered by default.

translations/cn/.DS_Store

6 KB
Binary file not shown.

translations/cn/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
## Copyright (C)
2+
Try Ruby version 1 Chinese version, 2022 _Ye Junzhe_
3+
4+
## The MIT License
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

translations/cn/try_ruby_10.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
lang: CN
3+
title: 有30分钟无事可做? 来尝试一下Ruby吧!
4+
answer:
5+
class: stretcher chapmark
6+
ok:
7+
error:
8+
---
9+
10+
Ruby是一门来自日本,并在软件开发领域引起了革命的编程语言。
11+
12+
Ruby的美在于其语法简洁的同时保证了语言的强大。
13+
14+
你可以在编辑器中输入Ruby代码,用这些按钮来使用网站。
15+
16+
- __Run__ &rarr; 在编辑器中执行代码
17+
- __Copy__ &rarr; 将示例代码粘贴至编辑器
18+
- __Next__ &rarr; 前往下一节课
19+
- __Back__ &rarr; 回到上一节课
20+
21+
<div class="foxes">点击 <strong>Next</strong> 开始学习.</div>

translations/cn/try_ruby_100.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
lang: CN
3+
title: 停下,你在狂吠!
4+
answer: ^\d{1,}$
5+
ok: 只有字符串才能被逆置!
6+
error:
7+
---
8+
9+
你不可以逆置数字40,我猜你可以抱着你的显示器并把它对着镜子,但逆置一个数字听起来就不合理。
10+
11+
Ruby报错了。Ruby在告诉你并不存在逆置数字的方法。
12+
13+
但如果先把数字转换成字符呢:
14+
=
15+
40.to_s.reverse

0 commit comments

Comments
 (0)