Skip to content
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

[WIP] Docs i18n #4633

Closed
wants to merge 14 commits into from
Next Next commit
Initial checkpoint.
- side nav picks up the right translation
  - does not link to the right place
- ditto for next/prev links
zpao committed Nov 14, 2015
commit ebc1a24f6085cb926bd4403754fd6a5b59da2e5b
3 changes: 3 additions & 0 deletions docs/Gemfile
Original file line number Diff line number Diff line change
@@ -9,6 +9,9 @@ gem 'jekyll', '~>2.0'
# Auto redirect pages
gem 'jekyll-redirect-from'

# i18n / l10n
gem 'jekyll-multiple-languages'

# JSON
gem 'json'

2 changes: 2 additions & 0 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@ GEM
jekyll-coffeescript (1.0.0)
coffee-script (~> 2.2)
jekyll-gist (1.1.0)
jekyll-multiple-languages (1.0.8)
jekyll-paginate (1.0.0)
jekyll-redirect-from (0.5.0)
jekyll (~> 2.0)
@@ -75,6 +76,7 @@ PLATFORMS

DEPENDENCIES
jekyll (~> 2.0)
jekyll-multiple-languages
jekyll-redirect-from
json
rake
6 changes: 6 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
@@ -36,4 +36,10 @@ sass:
sass_dir: _css
gems:
- jekyll-redirect-from
- jekyll-multiple-languages
react_version: 0.14.2

# i18n
languages: ["en", "ko-KR"]
default_language: "en"
fill_default_content: true
94 changes: 47 additions & 47 deletions docs/_data/nav_docs.yml
Original file line number Diff line number Diff line change
@@ -1,99 +1,99 @@
- title: Quick Start
- title: docs.titles.quick-start
items:
- id: getting-started
title: Getting Started
title: docs.titles.getting-started
- id: tutorial
title: Tutorial
title: docs.titles.tutorial
- id: thinking-in-react
title: Thinking in React
- title: Community Resources
title: docs.titles.thinking-in-react
- title: docs.titles.community-resources
items:
- id: conferences
title: Conferences
title: docs.titles.conferences
- id: videos
title: Videos
title: docs.titles.videos
- id: complementary-tools
title: Complementary Tools
title: docs.titles.complementary-tools
- id: examples
title: Examples
- title: Guides
title: docs.titles.examples
- title: docs.titles.guides
items:
- id: why-react
title: Why React?
title: docs.titles.why-react
- id: displaying-data
title: Displaying Data
title: docs.titles.displaying-data
subitems:
- id: jsx-in-depth
title: JSX in Depth
title: docs.titles.jsx-in-depth
- id: jsx-spread
title: JSX Spread Attributes
title: docs.titles.jsx-spread
- id: jsx-gotchas
title: JSX Gotchas
title: docs.titles.jsx-gotchas
- id: interactivity-and-dynamic-uis
title: Interactivity and Dynamic UIs
title: docs.titles.interactivity-and-dynamic-uis
- id: multiple-components
title: Multiple Components
title: docs.titles.multiple-components
- id: reusable-components
title: Reusable Components
title: docs.titles.reusable-components
- id: transferring-props
title: Transferring Props
title: docs.titles.transferring-props
- id: forms
title: Forms
title: docs.titles.forms
- id: working-with-the-browser
title: Working With the Browser
title: docs.titles.working-with-the-browser
subitems:
- id: more-about-refs
title: Refs to Components
title: docs.titles.more-about-refs
- id: tooling-integration
title: Tooling Integration
title: docs.titles.tooling-integration
- id: addons
title: Add-Ons
title: docs.titles.addons
subitems:
- id: animation
title: Animation
title: docs.titles.animation
- id: two-way-binding-helpers
title: Two-Way Binding Helpers
title: docs.titles.two-way-binding-helpers
- id: test-utils
title: Test Utilities
title: docs.titles.test-utils
- id: clone-with-props
title: Cloning Elements
title: docs.titles.clone-with-props
- id: create-fragment
title: Keyed Fragments
title: docs.titles.create-fragment
- id: update
title: Immutability Helpers
title: docs.titles.update
- id: pure-render-mixin
title: PureRenderMixin
title: docs.titles.pure-render-mixin
- id: perf
title: Performance Tools
title: docs.titles.perf
- id: advanced-performance
title: Advanced Performance
title: docs.titles.advanced-performance
- id: context
title: Context
- title: Reference
title: docs.titles.context
- title: docs.titles.reference
items:
- id: top-level-api
title: Top-Level API
title: docs.titles.top-level-api
- id: component-api
title: Component API
title: docs.titles.component-api
- id: component-specs
title: Component Specs and Lifecycle
title: docs.titles.component-specs
- id: tags-and-attributes
title: Supported Tags and Attributes
title: docs.titles.tags-and-attributes
- id: events
title: Event System
title: docs.titles.events
- id: dom-differences
title: DOM Differences
title: docs.titles.dom-differences
- id: special-non-dom-attributes
title: Special Non-DOM Attributes
title: docs.titles.special-non-dom-attributes
- id: reconciliation
title: Reconciliation
title: docs.titles.reconciliation
- id: glossary
title: React (Virtual) DOM Terminology
- title: Flux
title: docs.titles.glossary
- title: docs.titles.flux
items:
- id: flux-overview
title: Flux Overview
title: docs.titles.flux-overview
href: https://facebook.github.io/flux/docs/overview.html
- id: flux-todo-list
title: Flux TodoMVC Tutorial
title: docs.titles.flux-todo-list
href: https://facebook.github.io/flux/docs/todo-list.html
40 changes: 21 additions & 19 deletions docs/_data/nav_tips.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,40 @@
- title: Tips
- title: tips.titles.tips
items:
- id: introduction
title: Introduction
title: tips.titles.introduction
- id: inline-styles
title: Inline Styles
title: tips.titles.inline-styles
- id: if-else-in-JSX
title: If-Else in JSX
title: tips.titles.if-else-in-JSX
- id: self-closing-tag
title: Self-Closing Tag
title: tips.titles.self-closing-tag
- id: maximum-number-of-jsx-root-nodes
title: Maximum Number of JSX Root Nodes
title: tips.titles.maximum-number-of-jsx-root-nodes
- id: style-props-value-px
title: Shorthand for Specifying Pixel Values in style props
title: tips.titles.style-props-value-px
- id: children-props-type
title: Type of the Children props
title: tips.titles.children-props-type
- id: controlled-input-null-value
title: Value of null for Controlled Input
title: tips.titles.controlled-input-null-value
- id: componentWillReceiveProps-not-triggered-after-mounting
title: componentWillReceiveProps Not Triggered After Mounting
title: tips.titles.componentWillReceiveProps-not-triggered-after-mounting
- id: props-in-getInitialState-as-anti-pattern
title: Props in getInitialState Is an Anti-Pattern
title: tips.titles.props-in-getInitialState-as-anti-pattern
- id: dom-event-listeners
title: DOM Event Listeners in a Component
title: tips.titles.dom-event-listeners
- id: initial-ajax
title: Load Initial Data via AJAX
title: tips.titles.initial-ajax
- id: false-in-jsx
title: False in JSX
title: tips.titles.false-in-jsx
- id: communicate-between-components
title: Communicate Between Components
title: tips.titles.communicate-between-components
- id: expose-component-functions
title: Expose Component Functions
title: tips.titles.expose-component-functions
- id: references-to-components
title: tips.titles.references-to-components
- id: children-undefined
title: this.props.children undefined
title: tips.titles.children-undefined
- id: use-react-with-other-libraries
title: Use React with Other Libraries
title: tips.titles.use-react-with-other-libraries
- id: dangerously-set-inner-html
title: Dangerously Set innerHTML
title: tips.titles.dangerously-set-inner-html
82 changes: 82 additions & 0 deletions docs/_i18n/en.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
global:
next: Next
previous: Previous

docs:
titles:
quick-start: Quick Start
getting-started: Getting Started
tutorial: Tutorial
thinking-in-react: Thinking in React

community-resources: Community Resources
conferences: Conferences
videos: Videos
complementary-tools: Complementary Tools
examples: Examples

guides: Guides
why-react: Why React?
displaying-data: Displaying Data
jsx-in-depth: JSX in Depth
jsx-spread: JSX Spread Attributes
jsx-gotchas: JSX Gotchas
interactivity-and-dynamic-uis: Interactivity and Dynamic UIs
multiple-components: Multiple Components
reusable-components: Reusable Components
transferring-props: Transferring Props
forms: Forms
working-with-the-browser: Working With the Browser
more-about-refs: Refs to Components
tooling-integration: Tooling Integration
addons: Add-Ons
animation: Animation
two-way-binding-helpers: Two-Way Binding Helpers
test-utils: Test Utilities
clone-with-props: Cloning Elements
create-fragment: Keyed Fragments
update: Immutability Helpers
pure-render-mixin: PureRenderMixin
perf: Performance Tools
advanced-performance: Advanced Performance
context: Context

reference: Reference
top-level-api: Top-Level API
component-api: Component API
component-specs: Component Specs and Lifecycle
tags-and-attributes: Supported Tags and Attributes
events: Event System
dom-differences: DOM Differences
special-non-dom-attributes: Special Non-DOM Attributes
reconciliation: Reconciliation
glossary: React (Virtual) DOM Terminology

flux: Flux
flux-overview: Flux Overview
flux-todo-list: Flux TodoMVC Tutorial


tips:
titles:
tips: Tips

introduction: Introduction
inline-styles: Inline Styles
if-else-in-JSX: If-Else in JSX
self-closing-tag: Self-Closing Tag
maximum-number-of-jsx-root-nodes: Maximum Number of JSX Root Nodes
style-props-value-px: Shorthand for Specifying Pixel Values in style props
children-props-type: Type of the Children props
controlled-input-null-value: Value of null for Controlled Input
componentWillReceiveProps-not-triggered-after-mounting: componentWillReceiveProps Not Triggered After Mounting
props-in-getInitialState-as-anti-pattern: Props in getInitialState Is an Anti-Pattern
dom-event-listeners: DOM Event Listeners in a Component
initial-ajax: Load Initial Data via AJAX
false-in-jsx: False in JSX
communicate-between-components: Communicate Between Components
expose-component-functions: Expose Component Functions
references-to-components: References to Components
children-undefined: this.props.children undefined
use-react-with-other-libraries: Use React with Other Libraries
dangerously-set-inner-html: Dangerously Set innerHTML
Empty file added docs/_i18n/ja-JP.yml
Empty file.
7 changes: 7 additions & 0 deletions docs/_i18n/ko-KR.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
global:
next: 다음
previous: 이전

docs:
titles:
why-react: 왜 React인가?
Empty file added docs/_i18n/zh-CN.yml
Empty file.
10 changes: 5 additions & 5 deletions docs/_includes/nav_docs.html
Original file line number Diff line number Diff line change
@@ -2,16 +2,16 @@
<!-- Docs Nav -->
{% for section in site.data.nav_docs %}
<div class="nav-docs-section">
<h3>{{ section.title }}</h3>
<h3>{% t section.title %}</h3>
<ul>
{% for item in section.items %}
<li>
{{ item | sidebar_item_link}}
{% sidebaritem item %}{% t item.title %}{% endsidebaritem %}
{% if item.subitems %}
<ul>
{% for subitem in item.subitems %}
<li>
{{ subitem | sidebar_item_link}}
{% sidebaritem subitem %}{% t subitem.title %}{% endsidebaritem %}
</li>
{% endfor %}
</ul>
@@ -25,11 +25,11 @@ <h3>{{ section.title }}</h3>
<!-- Tips Nav -->
{% for section in site.data.nav_tips %}
<div class="nav-docs-section">
<h3>{{ section.title }}</h3>
<h3>{% t section.title %}</h3>
<ul>
{% for item in section.items %}
<li>
<a href="/react/tips/{{ item.id }}.html"{% if page.id == item.id %} class="active"{% endif %}>{{ item.title }}</a>
<a href="/react/tips/{{ item.id }}.html"{% if page.id == item.id %} class="active"{% endif %}>{%t item.title %}</a>
</li>
{% endfor %}
</ul>
5 changes: 3 additions & 2 deletions docs/_layouts/docs.html
Original file line number Diff line number Diff line change
@@ -17,11 +17,12 @@ <h1>

<div class="docs-prevnext">
{% if page.prev %}
<a class="docs-prev" href="/react/docs/{{ page.prev }}">&larr; Prev</a>
<a class="docs-prev" href="/react/{{ page.prev }}">&larr; {% t global.previous %}</a>
{% endif %}
{% if page.next %}
<a class="docs-next" href="/react/docs/{{ page.next }}">Next &rarr;</a>
<a class="docs-next" href="/react/{{ page.next }}">{% t global.next %} &rarr;</a>
{% endif %}
</div>

</div>
</section>
Loading