Skip to content
This repository

Rails Tutorial Translation Wiki

This is a page for translators of the Ruby on Rails Tutorial book. Contributors should edit this wiki with any instructions they have found useful when making translations.

For concreteness, throughout this wiki we will use spanish as the target language for translation. You should replace spanish with your language of choice.

System configuration

To get started as a translator of the Ruby on Rails Tutorial book, use GitHub to send a message requesting to be added as a collaborator on the rails_tutorial_translation repository. What you do next depends on whether a translation effort in your language is already underway. You can tell if your target language's translation has already been started by looking for a branch with the language name at the main repository page. (Mouse over the "Switch Branches" link to see a list of the branches.)

Translating to a new language

To translate the Ruby on Rails Tutorial book to a new language, first send a request to be added as a collaborator on the GitHub repository. Then clone the repository, create a new branch, and configure the remote branch before pushing the repository up:

$ git clone git@github.com:mhartl/rails_tutorial_translation.git
$ cd rails_tutorial_translation
$ git checkout -b spanish
$ git config branch.spanish.remote origin
$ git config branch.master.merge refs/heads/spanish
$ git push origin spanish

Next, request a new Heroku instance by sending me a message through GitHub. I will create a Heroku project for your language and add you as a collaborator. After receiving a message that the project is ready, you should configure your local repository as follows:

$ git remote add heroku git@heroku.com:rails-tutorial-spanish.git

You will then be able to deploy your translation using a git push:

$ git push heroku spanish:master

Note: Do not give the Heroku URL to prospective readers. For each language, I will create a custom URL of the form spanish.railstutorial.org intended for distribution.

Contributing to an existing translation

To contribute to an existing translation, first send a request to be added as a collaborator on the GitHub repository. Then clone the repository and track the language's branch:

$ git clone git@github.com:mhartl/rails_tutorial_translation.git
$ cd rails_tutorial_translation
$ git branch --track spanish origin/spanish
$ git checkout spanish

Once you have a tracking branch, send me a message through GitHub requesting to be added as a collaborator on the Heroku project for your language. After receiving a message that you have been added, you should configure your local repository as follows:

$ git remote add heroku git@heroku.com:rails-tutorial-spanish.git

You will then be able to deploy your translation using a git push:

$ git push heroku spanish:master

Running the app

The HTML source of the Ruby on Rails Tutorial is distributed along with a minimal Rails app. To run it, install the necessary gems and then run the server:

$ bundle install
$ rails server

The book will now be running on http://localhost:3000.

Translating the book

The HTML source of the book is in the directory public/book. You should make your edits directly on these HTML files, making commits as you go along:

<make some changes>
$ git add .
$ git commit -m "<describe changes>"

When you want to make your changes available to other translators, push them up to GitHub:

$ git push origin spanish

If you are collaborating with other translators, you should first pull in their changes:

$ git pull --rebase origin spanish
$ git push origin spanish

(The --rebase option makes it possible to abandon the pull if there are too many conflicts.)

Once you are satisfied with a set of changes, deploy them to the public site:

$ git push heroku spanish:master

Your translation will now be available at spanish.railstutorial.org.

Site design

Please feel free to customize the design of the translated site to match your needs. (I do ask that you retain the links to the Rails Tutorial home page, the screencasts, and the print edition.)

License

The HTML source of the Rails Tutorial book is available under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License, which allows translation for noncommercial purposes.

Math

There's no reason to have any math here, but I think it's cool that GitHub lets you. For example, here's the time-independent Schrödinger equation for hydrogen: [ -\frac{\hbar^2}{2m}\nabla^2\psi - \frac{e^2}{2\tau r}\psi = E\psi, ] where ( \tau = 2\pi ). (Why set ( \tau = 2\pi )? Here's why.)

Something went wrong with that request. Please try again.