Countries And Languages plugin

Plugin details

Rails: Countries and languages in I18n.locale for select_tag or output in 85 languages

Websitehttp://github.com/grosser/countries_and_languages Repositorygit://github.com/grosser/countries_and_languages.git Author Michael Grosser Tags i18n LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install git://github.com/grosser/countries_and_languages.git

Countries and languages in I18n.locale

In currently 85 languages supplied by I18nData.
Languages and countries are stored as iso 639/iso 3166 - 2 letter code.
Methods are available in views.

@user.country == 'de'
@user.language == 'de'

User is from <%=country(@user.country)%> and speaks <%=language(@user.language)%>
User is from Germany and speaks German.
Please select you language <%=f.select_tag(:language,options_for_select(languages))%>
Select box with all 185 localized languages.



If you have special needs like renaming countries or only displaying a subset, have a look at the code and overwrite as necessary.

DEMO can be found in Gettext example application

Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | (0 older versions) | Last edited by: hardway, about 1 year ago