Skip to content

heracek/localization-middleware

This branch is up to date with kot-begemot/localization-middleware:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

90df50b · Aug 26, 2012

History

7 Commits
Aug 26, 2012
Aug 26, 2012
Aug 26, 2012
Aug 26, 2012
Aug 26, 2012
Aug 26, 2012
Aug 26, 2012
Aug 26, 2012
Aug 26, 2012
Aug 26, 2012
Aug 26, 2012
Aug 26, 2012
Aug 26, 2012

Repository files navigation

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%