Created
August 18, 2009 21:04
-
-
Save kossnocorp/169968 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select_tag :language, | |
options_for_select(I18n.available_locales.to_a.map{ |locale| [t('name', :locale => locale), locale] }, | |
I18n.locale.to_sym) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Snippet displays localized language selector. Sample: http://www.picamatic.com/show/2009/08/19/01/32/4780070_106x131.png | |
The structure of the locales should be lika that: | |
en: | |
name: "English" | |
--- | |
ru: | |
name: "Русский" | |
--- | |
hr: | |
name: "Hrvatska" | |
Works in Rails 2.3.x |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment