Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

i could tweak the readme forever

  • Loading branch information...
commit 02c3359dd4bc52508221fcc3bffbc3350a809132 1 parent 59f6818
authored May 03, 2009

Showing 1 changed file with 20 additions and 16 deletions. Show diff stats Hide diff stats

  1. 36  README.markdown
36  README.markdown
Source Rendered
@@ -4,11 +4,11 @@ LocaleRouting makes using I18N locale from an url parameter or hostname seamless
4 4
 It taps into the route recognition and generation methods and checks or adds the locale when nessecary.
5 5
 
6 6
 The plugin loads its available locales from Rails default I18N class.  
7  
-For every request, it check the configured part the URL match any of the locale definitions exposed by I18n.available_locales.  
8  
-If a locale string is found, the application I18n.locale is changed and the locale is passed via params[:locale].
  7
+For every request, it check the configured part the URL match any of the locale definitions exposed by `I18n.available_locales`.
  8
+If a locale string is found, the application `I18n.local`e is changed and the locale is passed via `params[:locale]`.
9 9
 
10 10
 Access to mapped URLs is wrapped also, the current I18n.locale is always prepended to the generated URLs parameters.  
11  
-Additionally you can pass a {:locale => "en} option to your link helpers, which will inject the given locale into the output URL.
  11
+Additionally you can pass a `{:locale => "en}` option to your link helpers, which will inject the given locale into the output URL.
12 12
 This parameter defaults to I18n.locale.
13 13
 
14 14
 No routes have to be changed to use this functionality.
@@ -19,32 +19,36 @@ There are several different ways to install this plugin.
19 19
 
20 20
 ### Installing as Rails gem dependency
21 21
 
22  
-To add **locale_routing** as a gem dependecy, add this to your 'config/environment.rb' Rails::Initializer.run do |config| block:
23  
-	config.gem 'perfectline-locale_routing', :lib => 'locale_routing', :source => 'http://gems.github.com'
  22
+To add **locale_routing** as a gem dependecy, add this to your `config/environment.rb` like this:
  23
+  Rails::Initializer.run do |config| block
  24
+  ...
  25
+	  config.gem 'perfectline-locale_routing', :lib => 'locale_routing', :source => 'http://gems.github.com'
  26
+	...
  27
+	end
24 28
 
25  
-To install this gem (and other missing gem dependencies) run 'rake gems:install'.
  29
+To install this gem (and other missing gem dependencies) run `rake gems:install`.
26 30
 
27 31
 ### Installing the gem manually
28 32
 
29  
-This requires you to have at least RubyGems version 1.2 (run 'gem -v' to check your current version).  
30  
-As the 'locale_routing' gem is built by GitHub, you have to add GitHub as a gem source on your environment (if you havent done it already):
  33
+This requires you to have at least RubyGems version 1.2 (run `gem -v` to check your current version).
  34
+As the gem is built by GitHub, you have to add GitHub as a gem source on your environment (if you havent done it already):
31 35
 	sudo gem sources -a http://gems.github.com
32 36
 
33 37
 Install the plugin library:
34 38
 	sudo gem install perfectline-locale_routing
35 39
 
36  
-To include them gem in your application, add this to the bottom of your 'environment.rb' or in an initializer:
  40
+To include them gem in your application, add this to the bottom of your `environment.rb` or in an initializer:
37 41
 	require 'locale_routing'
38 42
  
39 43
 ### Install as a plugin via Git
40 44
 
41  
-Alternatively you can use 'script/plugin' to export the code into your applications 'vendor/plugins' directory.  
  45
+Alternatively you can use `script/plugin` to export the code into your applications `vendor/plugins` directory.
42 46
 	'script/plugin install git://github.com/perfectline/locale_routing.git'
43 47
 
44 48
 ## Configuration
45 49
 
46  
-To enable or disable the locale routing set **Perfectline::LocaleRouting::Config.enabled = true/false** # defaults to true
47  
-To specifiy which part of the URL should be matched for the locale identifier, set **Perfectline::LocaleRouting::Config.match_from = option**
  50
+To enable or disable the locale routing set `Perfectline::LocaleRouting::Config.enabled = true/false # defaults to true`.
  51
+To specifiy which part of the URL should be matched for the locale identifier, set `Perfectline::LocaleRouting::Config.match_from = option`
48 52
 
49 53
 ### Available options for match_from are:
50 54
 *   **:params**  
@@ -61,7 +65,7 @@ To specifiy which part of the URL should be matched for the locale identifier, s
61 65
     Searches for configured matches in the domain name. If a match is found, the configured locale is then checked against I18n.available_locales.  
62 66
     If the configured locale does not exist in available locales, it will fall back to the default locale.
63 67
 
64  
-    Configuring host to locale mappings is done via **Perfectline::LocaleRouting::Config.mapping do |block|**.
  68
+    Configuring host to locale mappings is done via `Perfectline::LocaleRouting::Config.mapping do |block|`.
65 69
     Hash key must be the hostname pattern to be matched and value is the locale string.  
66 70
     Hostname patterns are like simplified regexp patterns with * wildcard support.  
67 71
     Mappings matching is similar to route config - first match found is used, rest is ignored.
@@ -80,11 +84,11 @@ As you can see there are no tests yet either, although they will be created as s
80 84
 So if you do run into issues or have any improvement ideas, feel free to contact the authors.  
81 85
 
82 86
 ## Honorable mentions
83  
-This plugin is heavily inspired by the "routing-filter" plugin by **Sven Fuchs**.
  87
+This plugin is inspired by the "routing-filter" plugin by **Sven Fuchs**.
84 88
 
85 89
 ## Authors:
86  
-Tanel Suurhans - tanel.suurhans_at_perfectline_d0t_ee  
87  
-Tarmo Lehtpuu - tarmo.lehtpuu_at_perfectline_d0t_ee
  90
+**Tanel Suurhans** - tanel.suurhans_at_perfectline_d0t_ee
  91
+**Tarmo Lehtpuu** - tarmo.lehtpuu_at_perfectline_d0t_ee
88 92
 
89 93
 ## License
90 94
 Copyright 2009 by PerfectLine LLC (<http://www.perfectline.co.uk>) and is released under the MIT license.

0 notes on commit 02c3359

Please sign in to comment.
Something went wrong with that request. Please try again.