Skip to content
This repository was archived by the owner on Sep 30, 2020. It is now read-only.

Commit ab40669

Browse files
author
Mikhail Pankov
committed
Merge remote-tracking branch 'upstream/master'
2 parents 2434925 + 2b06fd4 commit ab40669

33 files changed

+3895
-53
lines changed

_includes/editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
var req = new XMLHttpRequest();
9292
var data = JSON.stringify({
9393
version: "beta",
94-
optimize: "2",
94+
optimize: "0",
9595
code: program
9696
});
9797

_includes/zh-CN/example.rs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// 这个代码是可以编辑并且能够运行的
2+
fn main() {
3+
// 一个简易计算器
4+
// `+` 或 `-` 意味着加减1
5+
// `*` 或 `/` 意味着乘除2
6+
7+
let program = "+ + * - /";
8+
let mut accumulator = 0;
9+
10+
for token in program.chars() {
11+
match token {
12+
'+' => accumulator += 1,
13+
'-' => accumulator -= 1,
14+
'*' => accumulator *= 2,
15+
'/' => accumulator /= 2,
16+
_ => { /* 忽略其他 */ }
17+
}
18+
}
19+
20+
println!("程序 \"{}\" 的结果是 {}",
21+
program, accumulator);
22+
}

_includes/zh-CN/example.rs.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<pre class='rust'>
2+
<span class='kw'>fn</span> main() {
3+
<span class='comment'>// 一个简易计算器
4+
// `+` 或 `-` 意味着加减1
5+
// `*` 或 `/` 意味着乘除2</span>
6+
7+
<span class='kw'>let</span> program = <span class='string'>"+ + * - /"</span>;
8+
<span class='kw'>let</span> <span class='kw'>mut</span> accumulator = <span class='number'>0</span>;
9+
10+
<span class='kw'>for</span> token in program.chars() {
11+
<span class='kw'>match</span> token {
12+
<span class='string'>'+'</span> => accumulator <span class='op'>+=</span> <span class='number'>1</span>,
13+
<span class='string'>'-'</span> => accumulator <span class='op'>-=</span> <span class='number'>1</span>,
14+
<span class='string'>'*'</span> => accumulator <span class='op'>*=</span> <span class='number'>2</span>,
15+
<span class='string'>'/'</span> => accumulator <span class='op'>/=</span> <span class='number'>2</span>,
16+
_ => { <span class='comment'>/* 忽略其他 */</span> }
17+
}
18+
}
19+
20+
<span class='prelude-val'>println!</span>(<span class='string'>"程序 \"{}\" 的结果是 {}"</span>,
21+
program, accumulator);
22+
}
23+
</pre>

_layouts/basic.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ <h2><a href="/contribute.html">Contribute</a></h2>
3636

3737
{{ content }}
3838

39+
<footer>
40+
<p>Our site in other languages:
41+
<a href="/pt-BR/">Português</a>,
42+
<a href="/ru-RU/">Русский</a>
43+
</p>
44+
</footer>
45+
3946
<script>
4047
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
4148
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

_layouts/zh-CN/basic.html

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<!DOCTYPE html>
2+
<!-- Page last generated {{ site.time }} -->
3+
<html lang="zh-CN">
4+
<head>
5+
<meta charset="utf-8">
6+
<meta http-equiv="X-UA-Compatible" content="IE=edge">
7+
<meta name="viewport" content="width=device-width, initial-scale=1">
8+
<title>{{ page.title }}</title>
9+
<meta name="keywords" content="Rust, Rust程序语言, rustlang, rust-lang, Mozilla Rust">
10+
<meta name="description" content="一种注重高效、安全、并行的系统程序语言。">
11+
12+
<link rel="stylesheet" href="/css/bootstrap.css">
13+
<link rel="stylesheet" href="/css/style.css">
14+
</head>
15+
16+
<body class="container">
17+
<a href="https://github.com/rust-lang/rust">
18+
<img class="ribbon" style="display: none" src="/logos/forkme_zh_cn.png" alt="从GitHub上拷贝源码" width="298" height="298">
19+
</a>
20+
21+
<header>
22+
<ul class="row menu">
23+
<li class="col-xs-12 col-md-2">
24+
<a href="/index.html">
25+
<img class="img-responsive" src="/logos/rust-logo-blk.svg" onerror="this.src='/logos/rust-logo-256x256-blk.png'" height="128" width="128" alt="Rust logo" />
26+
</a>
27+
</li>
28+
<li class="col-xs-12 col-md-10 menu">
29+
<h2><a href="/documentation.html">文档</a></h2>
30+
<h2><a href="/community.html">社区</a></h2>
31+
<h2><a href="/downloads.html">下载</a></h2>
32+
<h2><a href="/contribute.html">贡献</a></h2>
33+
</li>
34+
</ul>
35+
</header>
36+
37+
{{ content }}
38+
39+
<script>
40+
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
41+
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
42+
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
43+
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
44+
45+
ga('create', 'UA-58390457-1', 'auto');
46+
ga('send', 'pageview');
47+
48+
</script>
49+
</body>
50+
</html>

_layouts/zh-CN/default.html

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
layout: basic
3+
---
4+
5+
<div class="content">
6+
{{ content }}
7+
</div>

css/style.css

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -605,3 +605,14 @@ ul.laundry-list {
605605
text-align: center;
606606
padding-top: 50px;
607607
}
608+
609+
footer {
610+
border-top: 2px solid #dedede;
611+
margin: 1.2em auto 0 auto;
612+
padding-top: 0.6em; /* half to accomodate p tag margin */
613+
}
614+
615+
footer a {
616+
display: inline-block;
617+
font-weight: bold;
618+
}

en-US/contribute-translations.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
layout: default
3+
title: Translating rust-lang.org to other languages to adapt internationalization
4+
---
5+
6+
# Rust is universal
7+
8+
Some docs on contributing translations!

en-US/contribute.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ This guide focuses on a few avenues for the new contributor:
3636
* [Language, compiler and the standard
3737
library](contribute-compiler.html). Language design, feature
3838
implementation, performance improvement.
39+
* [Internationalization](contribute-translations.html). Help spread the
40+
Rust love by translating our site to every language.
3941

4042
If you need additional guidance ask on [#rust-internals] or
4143
[internals.rust-lang.org].

en-US/downloads.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,15 @@ <h2 id="nightly">Nightly&nbsp; ({{ site.nightly }})</h2>
166166
</div>
167167
</div>
168168

169+
<hr/>
170+
171+
<div class="row">
172+
<div class="col-md-12">
173+
<p>If you installed using the shell script, run this to uninstall:</p>
174+
<pre><code>curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --uninstall</code></pre>
175+
</div>
176+
</div>
177+
169178
<hr/>
170179

171180
<div class="row">

en-US/user-groups.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ even better, open a pull request against
9898

9999
[Wellington Rust Meetup](https://www.meetup.com/Wellington-Rust-Meetup/), Wellington.
100100

101+
## Norway
102+
103+
[Rust Oslo](https://www.meetup.com/Rust-Oslo/), Oslo.
104+
101105
## Phillipines
102106

103107
[Rust Philippines](http://www.rustph.tech), Manila.

logos/forkme_zh_cn.png

41.4 KB
Loading

ru-RU/community.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
---
1+
---
22
layout: ru-RU/default
33
title: Сообщество Rust &middot; Язык Программирования Rust
44
---
@@ -40,9 +40,9 @@ title: Сообщество Rust &middot; Язык Программирован
4040

4141
## Новости
4242

43-
[This Week in Rust][twir] собирает в одном месте последние
43+
[This Week in Rust][twir] собирает в одном месте последние
4444
новости, предстоящие встречи и недельную статистику изменений в Rust
45-
и его библиотеках. [Блог Rust][rust_blog] - место, где
45+
и его библиотеках. [Блог Rust][rust_blog] - место, где
4646
команда Rust сообщает о важных изменениях. Также практически каждое событие
4747
в Rust обсуждается на неофициальном сабреддите, [/r/rust][reddit].
4848

@@ -56,7 +56,7 @@ title: Сообщество Rust &middot; Язык Программирован
5656

5757
## IRC каналы
5858

59-
Сообщество Rust поддерживает несколько дружелюбных,
59+
Сообщество Rust поддерживает несколько дружелюбных,
6060
густонаселенных [IRC] каналов в IRC-сети Mozilla, irc.mozilla.org.
6161

6262
[#rust][rust_irc] - канал общих обсуждений Rust, и

ru-RU/downloads.html

Lines changed: 46 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
---
2-
layout: ru-RU/untranslated
3-
title: Downloads &middot; The Rust Programming Language
2+
layout: ru-RU/basic
3+
title: Загрузки &middot; Язык программирования Rust
44
---
5-
<h1>Downloads</h1>
5+
<h1>Загрузки</h1>
66

77
<hr>
88

@@ -11,11 +11,10 @@ <h1>Downloads</h1>
1111
<h2 id="stable">{{ site.stable }}&nbsp;</h2>
1212
<h3>{{ site.stable_date }}</h3>
1313
<p>
14-
The
1514
<a href="http://blog.rust-lang.org{{ site.stable_blog }}">
16-
current stable release of Rust
17-
</a>
18-
, updated every six weeks and backwards-compatible.
15+
Текущая стабильная версия Rust
16+
</a>
17+
, обновляется каждые шесть недель и обратно совместима
1918
</p>
2019
</div>
2120
<div class="col-md-8">
@@ -51,7 +50,7 @@ <h3>{{ site.stable_date }}</h3>
5150

5251
<div class="row">
5352
<div class="col-md-10 col-md-offset-1">
54-
<p>An easy way to install the stable binaries for Linux and Mac is to run this in your shell:</p>
53+
<p>Простой способ установить бинарную стабильную версию для Linux и Mac — выполнить эту команду в командной строке:</p>
5554
<pre><code>curl -sSf https://static.rust-lang.org/rustup.sh | sh</code></pre>
5655
</div>
5756
</div>
@@ -62,10 +61,10 @@ <h3>{{ site.stable_date }}</h3>
6261
<div class="col-md-4 side-header">
6362
<h2 id="beta">Beta&nbsp; ({{ site.beta }})</h2>
6463
<p>
65-
A preview of the upcoming stable release, intended for testing by
66-
crate authors. Updated every six weeks and as needed.
64+
Предварительная версия будущих стабильных выпусков, предназначена для
65+
тестирования авторами библиотек. Обновляется каждые шесть недель или по мере необходимости.
6766
</p>
68-
<p><em>Scheduled for stable release<br/>{{ site.beta_date }}</em>.<p>
67+
<p><em>Стабильный релиз намечен на<br/>{{ site.beta_date }}</em>.<p>
6968
</div>
7069
<div class="col-md-8">
7170
<table class="table-features table-installers"><tbody>
@@ -101,7 +100,7 @@ <h2 id="beta">Beta&nbsp; ({{ site.beta }})</h2>
101100

102101
<div class="row">
103102
<div class="col-md-10 col-md-offset-1">
104-
<p>An easy way to install the beta binaries for Linux and Mac is to run this in your shell:</p>
103+
<p>Простой способ установить бинарную бета версию для Linux и Mac — выполнить эту команду в командной строке:</p>
105104
<pre><code>curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=beta</code></pre>
106105
</div>
107106
</div>
@@ -112,10 +111,10 @@ <h2 id="beta">Beta&nbsp; ({{ site.beta }})</h2>
112111
<div class="col-md-4 side-header">
113112
<h2 id="nightly">Nightly&nbsp; ({{ site.nightly }})</h2>
114113
<p>
115-
The current development branch.
116-
It includes
117-
<a href="https://doc.rust-lang.org/book/nightly-rust.html">unstable features</a>
118-
that are not available in the betas or stable releases.
114+
Текущая ветка разработки.
115+
Включает
116+
<a href="https://doc.rust-lang.org/book/nightly-rust.html">нестабильные возможности</a>
117+
которые недоступны в бетах и стабильных релизах.
119118
</p>
120119
</div>
121120
<div class="col-md-8">
@@ -152,7 +151,7 @@ <h2 id="nightly">Nightly&nbsp; ({{ site.nightly }})</h2>
152151

153152
<div class="row">
154153
<div class="col-md-10 col-md-offset-1">
155-
<p>An easy way to install the nightly binaries for Linux and Mac is to run this in your shell:</p>
154+
<p>Простой способ установить бинарную nightly версию для Linux и Mac — выполнить эту команду в командной строке:</p>
156155
<pre><code>curl -sSf https://static.rust-lang.org/rustup.sh | sh -s -- --channel=nightly</code></pre>
157156
</div>
158157
</div>
@@ -162,7 +161,7 @@ <h2 id="nightly">Nightly&nbsp; ({{ site.nightly }})</h2>
162161
<div class="row">
163162
<div class="col-md-12">
164163
<p>
165-
Discover other downloads in <a href="https://static.rust-lang.org/dist/index.html">the archives.</a>
164+
Вы можете просмотреть другие варианты <a href="https://static.rust-lang.org/dist/index.html">в архиве.</a>
166165
</p>
167166
</div>
168167
</div>
@@ -171,35 +170,34 @@ <h2 id="nightly">Nightly&nbsp; ({{ site.nightly }})</h2>
171170

172171
<div class="row">
173172
<div class="col-md-12">
174-
<a id="win-foot"></a>
175-
<p>
176-
<em></em>
177-
There are two prominent
178-
<a href="https://en.wikipedia.org/wiki/Application_binary_interface">ABIs</a>
179-
in use on Windows: the native (MSVC) ABI used by
180-
<a href="https://www.visualstudio.com">Visual Studio</a>,
181-
and the GNU ABI used by the
182-
<a href="https://gcc.gnu.org/">GCC toolchain</a>.
183-
Which version of Rust you need depends largely on what C/C++ libraries you want to interoperate with:
184-
for interop with software produced by Visual Studio use the MSVC build of Rust; for interop with
185-
GNU software built using the
186-
<a href="https://msys2.github.io/">MinGW/MSYS2 toolchain</a>
187-
use the GNU build.
188-
</p>
189-
<p>
190-
MSVC builds of Rust additionally require the Microsoft Visual
191-
C++ build tools for Visual Studio 2013 or later.
192-
The easiest way to acquire the build tools is by installing
193-
<a href="http://landinghub.visualstudio.com/visual-cpp-build-tools">
194-
Microsoft Visual C++ Build Tools 2015</a>
195-
which provides just the Visual C++ build tools.
196-
Alternately, you can <a href="https://www.visualstudio.com/downloads/">install</a>
197-
Visual Studio 2015 or Visual Studio 2013 and during install select the "C++ tools".
198-
No additional software installation is necessary for basic use of the GNU build.
199-
</p>
200-
<p>
201-
Rust's support for the GNU ABI is more mature, and is recommended for typical
202-
uses.
203-
</p>
173+
<a id="win-foot"></a>
174+
<p>
175+
<em></em>
176+
На Windows существует два известных
177+
<a href="https://en.wikipedia.org/wiki/Application_binary_interface">ABI</a>
178+
: нативный (MSVC) ABI, который используется в
179+
<a href="https://www.visualstudio.com">Visual Studio</a>,
180+
и GNU ABI, который используется в
181+
<a href="https://gcc.gnu.org/">наборе инструментов GCC</a>.
182+
То, какая версия Rust вам нужна зависит в основном от того, с какими C/C++ библиотеками вы собираетесь взаимодействовать:
183+
для взаимодействия с ПО созданным с помощью Visual Studio используйте MSVC версию Rust;
184+
для ПО GNU, которое было собрано с помощью
185+
<a href="https://msys2.github.io/">MinGW/MSYS2</a>
186+
используйте GNU версию.
187+
</p>
188+
<p>
189+
Версия Rust для MSVC дополнительно требует инструменты сборки Microsoft Visual
190+
C++ для Visual Studio 2013 и выше.
191+
Простейший способ получить их — установить
192+
<a href="http://landinghub.visualstudio.com/visual-cpp-build-tools">
193+
Microsoft Visual C++ Build Tools 2015</a>
194+
,который предоставит вам только иструменты для сборки Visual C++.
195+
Альтернативно, вы можете <a href="https://www.visualstudio.com/downloads/">установить</a>
196+
Visual Studio 2015 или Visual Studio 2013, и, во время установки, поставить галочку на "C++ tools".
197+
Для GNU версии никакого дополнительного ПО не требуется.
198+
</p>
199+
<p>
200+
Поддержка GNU ABI более проработана и рекомендуется для обычных пользователей.
201+
</p>
204202
</div>
205203
</div>

0 commit comments

Comments
 (0)