<commit_before>=== Last update March 17 2013

---

= Prefix Routes with Locale

Small gem to detect the locale from prefix, ensuring that is added to any route.
Set the locale based on prefix.

= Install

Put this line in your Gemfile:
  gem 'prefix-routes-with-url', github: 'Fire-Dragon-DoL/prefix-routes-with-locale'

You can optionally add this if you want locale set through http:
  gem 'http_accept_language', github: 'DouweM/http_accept_language', branch: 'no-middleware-no-crash'  
  
Then bundle:
  $ bundle  
  
= Usage

Remember to set I18n.available_locales in an initializer, to ensure you have an array of available locales.
Disable http_accept_language usage even when installed, if you want, in application.rb or initializer.
Disable the auto set locale, if you want to handle it by yourself, in application.rb or initializer .

Currently the locale is set with this priority in mind (higher to lower):
  url prefix > session[:locale] > http_accept_language > I18n.default_locale

To disable http_accept_language
  config.prefix_routes_with_locale.use_http_locale_accept_language = false

To disable locale auto setting:
  config.prefix_routes_with_locale.auto_set_locale = false
  
Finally in your routes.rb pass the routes you want to be prefixed to prefix_routes_with_url method:
  prefix_routes_with_url do
    resources :news
    namespace :admin do
      resources :users
    end
    get 'pages#home'
  end

You can ensure that every time a url doesn't have the prefix, it will be added automatically.
Just ensure to run this method **out** of `prefix_routes_with_url`, after *any* route:
  YourApp::Application.routes.draw do
    prefix_routes_with_url do
      resources :news
      namespace :admin do
        resources :users
      end
      get 'pages#home'
    end
    ensure_url_has_locale
  end

= TODO

* Add some tests
* Add some documentation

= Licensing
This gem is under MIT license, see LICENSE.txt file.

= Authors
* [<NAME>](https://github.com/Fire-Dragon-DoL)<commit_msg>Other readme changes<commit_after>### Last update March 17 2013

---

## Prefix Routes with Locale

Small gem to detect the locale from prefix, ensuring that is added to any route.
Set the locale based on prefix.

## Install

Put this line in your Gemfile:
  gem 'prefix-routes-with-url', github: 'Fire-Dragon-DoL/prefix-routes-with-locale'

You can optionally add this if you want locale set through http:
  gem 'http_accept_language', github: 'DouweM/http_accept_language', branch: 'no-middleware-no-crash'  
  
Then bundle:
  $ bundle  
  
= Usage

Remember to set I18n.available_locales in an initializer, to ensure you have an array of available locales.
Disable http_accept_language usage even when installed, if you want, in application.rb or initializer.
Disable the auto set locale, if you want to handle it by yourself, in application.rb or initializer .

Currently the locale is set with this priority in mind (higher to lower):
  url prefix > session[:locale] > http_accept_language > I18n.default_locale

To disable http_accept_language
  config.prefix_routes_with_locale.use_http_locale_accept_language = false

To disable locale auto setting:
  config.prefix_routes_with_locale.auto_set_locale = false
  
Finally in your routes.rb pass the routes you want to be prefixed to prefix_routes_with_url method:
  prefix_routes_with_url do
    resources :news
    namespace :admin do
      resources :users
    end
    get 'pages#home'
  end

You can ensure that every time a url doesn't have the prefix, it will be added automatically.
Just ensure to run this method **out** of `prefix_routes_with_url`, after *any* route:
  YourApp::Application.routes.draw do
    prefix_routes_with_url do
      resources :news
      namespace :admin do
        resources :users
      end
      get 'pages#home'
    end
    ensure_url_has_locale
  end

## TODO

* Add some tests
* Add some documentation

## Licensing
This gem is under MIT license, see LICENSE.txt file.

## Authors
* [<NAME>](https://github.com/Fire-Dragon-DoL)
{'fraction_non_alphanumeric': 0.06519583539910759, 'fraction_numerical': 0.00495785820525533, 'mean_word_length': 3.975339087546239, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1615849', 'n_tokens_mistral': 1204, 'n_tokens_neox': 1182, 'n_words': 467}