Home

Awesome

Edge Rails Guide Translation: Traditional Chinese READ ONLINE

Build Status

Translation is based on the master branch of rails/rails.

Install

DO THIS If you want to work on Rails Guides Translation. If you just want to fix translation error. See Fix Bugs in Translation.

curl:

ruby -e "$(curl -sSL https://rawgithub.com/docrails-tw/guides/master/install.rb)"

wget:

ruby <(wget --no-check-certificate https://rawgithub.com/docrails-tw/guides/master/install.rb -O -)

What does above script do?

Clone 3 repos under a same folder (it will gently ask you where you would like to put these repos).

mkdir ~/docs/rails-guides-translations
cd ~/docs/rails-guides-translations
git clone git@github.com:rails/rails.git
git clone git@github.com:docrails-tw/guides.git
git clone https://github.com/docrails-tw/docrails-tw.github.io
cd guides
cp BASE_PATH.example BASE_PATH

If you use a different base location, you will need to change the location in BASE_PATH file. Defaults to ~/docs/rails-guides-translations

Fix bugs in translation

Clone this repo, use a topic branch. Fix the translation error in source/zh-TW, then send a Pull Request. Or open an issue then someone may fix it.

If the error is not a translation error and latest guide: http://edgeguides.rubyonrails.org haven't fixed it. Then you could clone the rails/rails repo. Fix it then send a Pull Request to rails/rails. Make sure you've read the Contributing to the Rails Documentation first. TL;DR. Word wrap to 80 chars and add [ci skip] in commit message for documentation changes. Please consult the translation terms while updating the text.

Workflow for Translator

YOU NEED TO RUN THE INSTALL SCRIPT FIRST.

After installation, now you have rails, guides, docrails-tw.github.io repos. rails is to get the latest source documents. docrails-tw.github.io is for hosting static html & css. guides is where you work on translation.

English guides live in guides/source/.

Traditional Chinese guides live in guides/source/zh-TW.

1. Start a new Translation

UPDATE BOTH English and Traditional Chinese guides first. Then start to translate.

rake guides:update_guide [name_of_the_guide]

or you could update all guides at once:

rake guides:update_guides but DO NOT check out the guides that you're not editing in version control.

Please add the terms you used to translation terms.

When your translation is finished, generate, preview locally then send a Pull Request.

2. Update an obsolete translation

UPDATE the english guide first, see the English diff, adds up missing translation or updates.

rake guides:update_guide [name_of_the_guide]

or you could update all guides at once:

rake guides:update_guides but DO NOT checks out the guides that you're not editing in version control.

Please consult the translation terms for uniform translation.

When your translation is finished, generate, preview locally then send a Pull Request.

Generate HTML

rake guides:generate

By default it will lazy generate, only generates what changes. pass ALL=1 to make it generate everything. Pass GUIDES_LANGUAGE=zh-TW to generate guides of zh-TW locale. Pass RAILS_VERSION to specify latest commit sha-1 (defaults to local).

Preview

After generation, just open it:

open output/zh-TW/index.html

Aliases

Put in your startup file (.bash_profile or ...):

alias deploy_to_pages="rake guides:deploy"
alias gen="rake guides:generate GUIDES_LANGUAGE=zh-TW"
alias genall="rake guides:generate ALL=1 GUIDES_LANGUAGE=zh-TW"
alias update_guide="rake guides:update_guide"
alias update_all_guides="rake guides:update_guides"

Before you make a Pull Request

Generate and preview on local. Make sure everything is okay. Chinese text and English text MUST has a space between each other.

Travis-CI

Travis-CI will run this command:

GUIDES_LANGUAGE=zh-TW rake

Make sure no errors occur before you open a Pull Request :D.

Translation Terms

I compiled a translation terms list during translation process. If you have any suggestions or find anything wrong, feel free to open an issue.

Deploy

When your Pull Request got merged on master. It's time to deploy!

rake guides:deploy

This will copy all *.html from output/zh-TW to docrails-tw.github.io.

Contribute

Always fork and makes a topic branch!

License

CC-BY-SA

This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

The code are under MIT license, copied with minor modifications from rails/rails.