0.01
No commit activity in last 3 years
No release in over 3 years
Provides a simple helper to get an HTML select list of ISO-639-1 languages. The list of languages is obtained from Wikipedia (http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes).
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Rails – Language Select

Build Status

Provides a simple helper to get an HTML select list of languages using the ISO 639-1 standard.

Uses the two letter alpha codes to identify the language.

Installation

Install as a gem using

gem install language_select

Or put the following in your Gemfile

gem 'language_select'

Example

Simple use supplying model and attribute as parameters:

language_select("user", "language")

Supplying priority languages to be placed at the top of the list:

language_select("user", "language", [ "English", "French", "German" ])

The language is stored using the ISO-639-1 two letter codes.

Getting the Language from ISO codes

class User < ActiveRecord::Base

  def language_name
    ::LanguageSelect::LANGUAGES[language]
  end

end

Tests

bundle
bundle exec rspec

Running with multiple versions of actionpack

bundle exec appraisal

Copyright (c) 2013 Apide ApS, released under the MIT license