Socket
Book a DemoInstallSign in
Socket

i18n-env-config

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

i18n-env-config

0.0.1
bundlerRubygems
Version published
Maintainers
1
Created
Source

I18n::Env::Config

Build Status

Set I18n.locale based on the environment variables that control the locale.

This is for Desktop applications only. For web application see http_accept_languge or http-accept.

Usage

require "i18n"
require "i18n/env/config"

I18n.config = I18n::Env::Config.new

Now I18n.locale will be derived from the user's environment.

Environment Variables

The following environment variables are searched, in order:

  • LANGUAGE
  • LC_ALL
  • LC_MESSAGES
  • LANG

(Just like gettext).

If an exact match is not found, the list is reevaluated using the locale's parent(s). E.g., if en_US is not found, we see if en is available.

Installation

Add this line to your application's Gemfile:

gem "i18n-env-config"

And then execute:

$ bundle

Or install it yourself as:

$ gem install i18n-env-config

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 18 Sep 2016

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.