README.markdown

TranslateRoutes

This Rails plugin provides a simple way to translate your URLs to any number of languages, even on a fully working application.

It works fine with all kind of routing definitions, including RESTful and named routes.Your code will remain untouched: your current routing code, helpers and links will be translated transparently.
(Un)installing it is a very clean and simple process, so why don't you give it a chance? ;)

Quick start

Let's start with a tiny example. Of course you need to define your routes first, e.g:

As we can see, a new spanish route has been setted up and a locale parameter has been added to the routes.

4) Include this filter in your ApplicationController:

before_filter :set_locale_from_url

Now your application recognizes the different routes and sets the I18n.locale value on your controllers,
but what about the routes generation? As you can see on the previous rake routes execution, the
contact_es_es_path and contact_en_us_path routing helpers have been generated and are
available in your controllers and views. Additionally, a contact_path helper has been generated, which
generates the routes according to the current I18n.locale value.

This way you don't need to modify your application links because they adapt automatically to the current locale.

5) Hey, but what about my tests?

Of course, your functional and integration testing involves some requests.
The plugin includes some code to add a default locale parameter so they can remain untouched.
Append it to your test_helper and it will be applied.

Documentation

You can find additional options and documentation on the translate_routes wiki, and a sample application that you
can use as reference.