Skip to content

Commit e9d1c3d

Browse files
committed
index.html.js translation done
Signed-off-by: Jonir Rings <[email protected]>
1 parent 590a264 commit e9d1c3d

File tree

1 file changed

+30
-68
lines changed

1 file changed

+30
-68
lines changed

site/index.html.js

Lines changed: 30 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = ({ page, section }) =>
2525
</div>
2626

2727
<div className="marketing-col">
28-
<h3>Describe your data</h3>
28+
<h3>描述你的数据</h3>
2929
<Prism language="graphql">
3030
{`type Project {
3131
name: String
@@ -36,7 +36,7 @@ module.exports = ({ page, section }) =>
3636
</div>
3737

3838
<div className="marketing-col">
39-
<h3>Ask for what you want</h3>
39+
<h3>请求你所要的数据</h3>
4040
<Prism language="graphql">
4141
{`{
4242
project(name: "GraphQL") {
@@ -47,7 +47,7 @@ module.exports = ({ page, section }) =>
4747
</div>
4848

4949
<div className="marketing-col">
50-
<h3>Get predictable results</h3>
50+
<h3>得到可预测的结果</h3>
5151
<Prism language="json">
5252
{`{
5353
"project": {
@@ -60,36 +60,26 @@ module.exports = ({ page, section }) =>
6060

6161
<div className="buttons-unit">
6262
<a className="button" href="/code/">
63-
Get Started
63+
马上开始
6464
</a>
6565
<a className="button" href="/learn/">
66-
Learn More
66+
了解更多
6767
</a>
6868
</div>
6969

7070
</div>
7171
</div>
7272

7373
<section className="lead">
74-
<h1>A query language for your API</h1>
75-
<p>
76-
GraphQL is a query language for APIs and a runtime for fulfilling
77-
those queries with your existing data. GraphQL provides a complete
78-
and understandable description of the data in your API, gives
79-
clients the power to ask for exactly what they need and nothing
80-
more, makes it easier to evolve APIs over time, and enables powerful
81-
developer&nbsp;tools.</p>
74+
<h1>一种用于 API 的查询语言</h1>
75+
<p>GraphQL 既是一种用于 API 的查询语言也是一个满足你数据查询的运行时。 GraphQL 对你的 API 中的数据提供了一套易于理解的完整描述,使得客户端能够准确地获得它需要的数据,而且没有任何冗余,也让 API 更容易地随着时间推移而演进,还能用于构建强大的开发者工具。</p>
8276
</section>
8377

8478
<section className="point1" id="predictable-results">
8579
<div className="prose">
86-
<h2>Ask for what you need,<br />get exactly that</h2>
80+
<h2>请求你所要的数据<br />不多不少</h2>
8781
{/*[Illustration: just a simple query and response?]*/}
88-
<p>
89-
Send a GraphQL query to your API and get exactly what you need,
90-
nothing more and nothing less. GraphQL queries always return
91-
predictable results. Apps using GraphQL are fast and stable because
92-
they control the data they get, not the&nbsp;server.</p>
82+
<p>向你的 API 发出一个 GraphQL 请求就能准确获得你想要的数据,不多不少。 GraphQL 查询总是返回可预测的结果。使用 GraphQL 的应用可以工作得又快又稳,因为控制数据的是应用,而不是服务器。</p>
9383
</div>
9484
<div className="window faux-graphiql" aria-hidden>
9585
<div className="query">
@@ -179,15 +169,9 @@ module.exports = ({ page, section }) =>
179169
<div className="grayWash">
180170
<section className="point2" id="single-request">
181171
<div className="prose">
182-
<h2>Get many resources<br />in a single request</h2>
172+
<h2>获取多个资源<br />只用一个请求</h2>
183173
{/*Illustration: a query 2 or 3 levels deep]*/}
184-
<p>
185-
GraphQL queries access not just the properties of one resource
186-
but also smoothly follow references between them. While typical
187-
REST APIs require loading from multiple URLs, GraphQL APIs get
188-
all the data your app needs in a single request. Apps using
189-
GraphQL can be quick even on slow mobile
190-
network&nbsp;connections.</p>
174+
<p>GraphQL 查询不仅能够获得资源的属性,还能沿着资源间引用进一步查询。典型的 REST API 请求多个资源时得载入多个 URL,而 GraphQL 可以通过一次请求就获取你应用所需的所有数据。这样一来,即使是比较慢的移动网络连接下,使用 GraphQL 的应用也能表现得足够迅速。</p>
191175
</div>
192176
<div className="app-to-server" aria-hidden>
193177
<img src="/img/phone.svg" width="496" height="440" className="phone" />
@@ -225,15 +209,10 @@ module.exports = ({ page, section }) =>
225209

226210
<section className="point3" id="type-system">
227211
<div className="prose">
228-
<h2>Describe what&rsquo;s possible<br />with a type system</h2>
212+
<h2>描述所有的可能<br />类型系统</h2>
229213
{/*Illustration of a type IDL following a query by line]*/}
230214
{/*Under: a server <-> client (Capabilities, Requirements)]?*/}
231-
<p>
232-
GraphQL APIs are organized in terms of types and fields,
233-
not endpoints. Access the full capabilities of your data from a
234-
single endpoint. GraphQL uses types to ensure Apps only ask for
235-
what&rsquo;s possible and provide clear and helpful errors. Apps can
236-
use types to avoid writing manual parsing&nbsp;code.</p>
215+
<p>GraphQL API 基于类型和字段的方式进行组织,而非入口端点。你可以通过一个单一入口端点得到你所有的数据能力。GraphQL 使用类型来保证应用只请求可能的数据,还提供了清晰的辅助性错误信息。应用可以使用类型,而避免编写手动解析代码。</p>
237216
</div>
238217
<div className="window strong-typed-query" aria-hidden>
239218
<div className="query">
@@ -306,14 +285,11 @@ type Species {
306285
<div className="darkWash">
307286
<section className="point4" id="powerful-tools">
308287
<div className="prose">
309-
<h2>Move faster with<br />powerful developer tools</h2>
288+
<h2>快步前进<br />强大的开发者工具</h2>
310289
{/*Illustration of GraphiQL validation error and typeahead, animated?]*/}
311-
<p>
312-
Know exactly what data you can request from your API without
313-
leaving your editor, highlight potential issues before sending a
314-
query, and take advantage of improved code intelligence. GraphQL
315-
makes it easy to build powerful tools like <a href="https://github.com/graphql/graphiql" target="_blank">Graph<em>i</em>QL</a> by
316-
leveraging your API&rsquo;s type system.</p>
290+
<p>不用离开编辑器就能准确知道你可以从 API 中请求的数据,发送查询之前就能高亮潜在问题,高级代码智能提示。利用 API 的类型系统,GraphQL 让你可以更简单地构建如同
291+
<a href="https://github.com/graphql/graphiql" target="_blank">Graph<em>i</em>QL</a>
292+
的强大工具。</p>
317293
</div>
318294
<div className="graphiqlVid" dangerouslySetInnerHTML={{__html: `
319295
<video autoplay loop playsinline>
@@ -326,14 +302,9 @@ type Species {
326302
<div className="grayWash">
327303
<section className="point5" id="without-versions">
328304
<div className="prose">
329-
<h2>Evolve your API<br />without versions</h2>
305+
<h2>API 演进<br />无需划分版本</h2>
330306
{/*Illustration showing more legs added to a graph? Or a type evolving over time?]*/}
331-
<p>
332-
Add new fields and types to your GraphQL API without impacting
333-
existing queries. Aging fields can be deprecated
334-
and hidden from tools. By using a single evolving version,
335-
GraphQL APIs give apps continuous access to new features and
336-
encourage cleaner, more maintainable server&nbsp;code.</p>
307+
<p>给你的 GraphQL API 添加字段和类型而无需影响现有查询。老旧的字段可以废弃,从工具中隐藏。通过使用单一演进版本,GraphQL API 使得应用始终能够使用新的特性,并鼓励使用更加简洁、更好维护的服务端代码。</p>
337308
</div>
338309
<div className="window type-evolution" aria-hidden>
339310
<div id="typeEvolveView">
@@ -435,15 +406,9 @@ type Person {
435406

436407
<section className="point6" id="bring-your-own-code">
437408
<div className="prose">
438-
<h2>Bring your own<br />data and code</h2>
409+
<h2>使用你现有的<br />数据和代码</h2>
439410
{/*Illustration of each field becoming a function?]*/}
440-
<p>
441-
GraphQL creates a uniform API across your entire application
442-
without being limited by a specific storage engine. Write GraphQL
443-
APIs that leverage your existing data and code with GraphQL
444-
engines available in many languages. You provide functions for
445-
each field in the type system, and GraphQL calls them with
446-
optimal&nbsp;concurrency.</p>
411+
<p>GraphQL 让你的整个应用共享一套 API,而不用被限制于特定存储引擎。GraphQL 引擎已经有多种语言实现,通过 GraphQL API 能够更好利用你的现有数据和代码。你只需要为类型系统的字段编写函数,GraphQL 就能通过优化并发的方式来调用它们。</p>
447412
</div>
448413
<div className="window leverage-code" aria-hidden>
449414
<div id="leverageCodeView">
@@ -455,7 +420,7 @@ type Person {
455420
}`}
456421
</Prism>
457422
<Prism>
458-
{`// type Character {
423+
{`// type Character
459424
class Character {
460425
// name: String
461426
getName() {
@@ -474,7 +439,7 @@ class Character {
474439
}`}
475440
</Prism>
476441
<Prism language="python">
477-
{`# type Character {
442+
{`# type Character
478443
class Character:
479444
# name: String
480445
def name(self):
@@ -490,7 +455,7 @@ class Character:
490455
`}
491456
</Prism>
492457
<Prism>
493-
{`// type Character {
458+
{`// type Character
494459
public class Character {
495460
// name: String
496461
public String Name { get; }
@@ -523,18 +488,15 @@ public class Character {
523488

524489
<section className="powered-by" id="whos-using">
525490
<div className="prose">
526-
<h2>Who&rsquo;s using GraphQL?</h2>
527-
<p>
528-
Facebook's mobile apps have been powered by GraphQL since 2012.
529-
A GraphQL spec was open sourced in 2015 and is now available in
530-
many environments and used by teams of all sizes.</p>
491+
<h2>谁在使用 GraphQL?</h2>
492+
<p>Facebook 的移动应用从 2012 年就开始使用 GraphQL。GraphQL 规范于 2015 年开源,现已经在多种环境下可用,并被各种体量的团队所使用。</p>
531493
</div>
532494
<div className="logos">
533495
{/* Waiting for permission from some of the below */}
534496
<a href="https://www.facebook.com/" target="_blank" rel="noopener noreferrer">
535497
<img src="/users/logos/facebook.png" title="Facebook" />
536498
</a>
537-
{/** /}
499+
{/**/}
538500
<a href="https://twitter.com/" target="_blank" rel="noopener noreferrer">
539501
<img src="/users/logos/twitter.png" title="Twitter" className="round" />
540502
</a>
@@ -545,7 +507,7 @@ public class Character {
545507
<a href="https://www.pinterest.com/" target="_blank" rel="noopener noreferrer">
546508
<img src="/users/logos/pinterest.png" title="Pinterest" className="round" />
547509
</a>
548-
{/** /}
510+
{/**/}
549511
<a href="https://www.airbnb.com/" target="_blank" rel="noopener noreferrer">
550512
<img src="/users/logos/airbnb.png" title="Airbnb" className="round" />
551513
</a>
@@ -562,9 +524,9 @@ public class Character {
562524
</div>
563525

564526
<a className="button" href="/users/">
565-
More GraphQL Users
527+
更多 GraphQL 使用者
566528
</a>
567529

568530
</section>
569531

570-
</Site>
532+
</Site>;

0 commit comments

Comments
 (0)