Permalink
Browse files

Clean up README.markdown for proper whitespace indentation, fixes Act…

…ionDispatch::Routing::Translator.i18n('es') line now showing as code
  • Loading branch information...
1 parent 49d2e76 commit b39c18c6c1a747e3203e5836908e31107bb9ffb0 @jaimeiniesta jaimeiniesta committed Nov 17, 2010
Showing with 17 additions and 17 deletions.
  1. +17 −17 README.markdown
View
@@ -1,11 +1,11 @@
-TranslateRoutes
+TranslateRoutes
===============
This branch works with Rails 3.x, you can find branches for Rails [2.1.x](http://github.com/raul/translate_routes/tree/rails2.1), [2.2.x](http://github.com/raul/translate_routes/tree/rails2.2) and [2.3.x](http://github.com/raul/translate_routes/tree/rails2.3)
-This Rails plugin provides a simple way to translate your URLs to any number of languages, even on a fully working application.
+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.
+It works fine with all kind of routing definitions, including RESTful and named routes.
**Your current code will remain untouched**: your current routing code, helpers and links will be translated transparently - even in your tests.
(Un)installing it is a very clean and simple process, so why don't you give it a chance? ;)
@@ -29,11 +29,11 @@ Let's start with a tiny example. Of course you need to define your routes first,
3) Append a line to your routes.rb file to activate the translations. If you loaded the translations file with
your other I18n translations files, the line will be:
- ActionDispatch::Routing::Translator.i18n('es')
-
+ ActionDispatch::Routing::Translator.i18n('es')
+
and if you want to keep the file separated (e.g: config/i18n-routes.yml), the line to append is:
- ActionDispatch::Routing::Translator.translate_from_file('config','i18n-routes.yml')
+ ActionDispatch::Routing::Translator.translate_from_file('config','i18n-routes.yml')
You can see it working by executing `rake routes` on the shell:
@@ -48,17 +48,17 @@ As we can see, a new spanish route has been setted up and a `locale` parameter h
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 request's locale. This way your link
+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 request's locale. This way your link
This means that if you use named routes **you don't need to modify your application links** because the routing helpers are automatically adapted to the current locale.
5) Hey, but what about my tests?
-Of course, your functional and integration testing involves some requests.
+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.
@@ -73,8 +73,8 @@ Feedback, questions and comments will be always welcome at raul@murciano.net
Credits
-------
* Main development:
- * Raul Murciano <http://raul.murciano.net> - code
- * Domestika INTERNET S.L <http://domestika.org> - incredible support, really nice people to work with!
+ * Raul Murciano <http://raul.murciano.net> - code
+ * Domestika INTERNET S.L <http://domestika.org> - incredible support, really nice people to work with!
* Contributors:
* [Aitor Garay-Romero](http://github.com/aitorgr)
@@ -88,13 +88,13 @@ Credits
Rails routing resources
-----------------------
-* David Black's 'Rails Routing' ebook rocks! - 'Ruby for Rails' too, BTW.
+* David Black's 'Rails Routing' ebook rocks! - 'Ruby for Rails' too, BTW.
* Obie Fernandez's 'The Rails Way' - the definitive RoR reference, great work Obie!
* As a part of the impressive Rails Guides set there is an [awesome document about rails routing](http://guides.rails.info/routing_outside_in.html) by Mike Gunderloy:
License
-------
- Copyright (c) 2007 Released under the MIT license (see MIT-LICENSE)
- Raul Murciano <http://raul.murciano.net>
+ Copyright (c) 2007 Released under the MIT license (see MIT-LICENSE)
+ Raul Murciano <http://raul.murciano.net>
Domestika INTERNET S.L. <http://domestika.org>

0 comments on commit b39c18c

Please sign in to comment.