No commit activity in last 3 years
No release in over 3 years
Middleware that plays the connection between the url and I18n.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

localization-middleware¶ ↑

The gem that allows to manipulate I18n.locale via url.

Usage¶ ↑

  • First install the gem

    With Bundle

    #Gemfile
    gem "padrino-localization"
    
    #irb
    bundle install
    

    or with gem

    gem install padrino-localization
    
  • Now it should be added to middleware(Padrino example)

    Padrino.use(Localization::Middleware, __DEFINE_HERE_LOCALES__)
    
    # config/apps.rb
    Padrino.use(Localization::Middleware, %w(en ru))
    
  • And that’s it. You now can access your application via /page_path, /en/page_path or /ru/page_path

(in case you specified only tow locales: russian ang english). If no locale was defined, then the I18n.default_locale will be used.

Copyright © 2012 kot-begemot. See LICENSE.txt for further details.