Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rack-locale_chooser

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rack-locale_chooser

  • 1.8
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Locale Chooser - A Rack Middleware for Locale Selection

Priority

Cookie Setting > Geolocation > HTTP Accept Language Header > Default

Prerequisites

GeoIP C API Installed: http://www.maxmind.com/app/c GeoIP Ruby Wrapper Installed: http://rubyforge.org/scm/?group_id=947


Install

gem install rack-locale_chooser


Example for Rails Use on some enviroment file:

config.gem 'rack-locale_chooser'

config.middleware.use 'Rack::LocaleChooser', :geodb_path => '/usr/local/share/GeoIP/GeoLiteCity.dat', :default_domain => 'example.com', :host_mappings => { :es => 'es.example.com', :pt_BR => 'br.example.com' }, :country_mappings => { 'BR' => :pt_BR, 'MX' => :es }


Params

host_mappings -> Mapping from locale to host for url rewriting country_mappings -> Mapping from country codes returned by GeoIP to locales default_domain -> default domain for cookie setting geodb_path -> path for GeoIP dat file

FAQs

Package last updated on 25 Jan 2011

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc