Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Rails plugin for localized "country_select" helper with Rake task for downloading locales from's CLDR

branch: master

This branch is 0 commits ahead and 0 commits behind master

Fetching latest commit…

Cannot retrieve the latest commit at this time



Rails plugin to provide support for localized <select> menu with country names and for storing country information as country code (eg. 'es'), not name (eg. 'Spain'), in the database.

Uses the Rails internationalization framework (I18n, for translating the names of countries. Requires Rails 2.2 (released November 21st, 2008) or later versions. Country names are loaded from hashes in plugin directory, according to I18n.locale value.

You can easily translate country codes in your application like this:

<%= I18n.t, :scope => 'countries' %>

Comes with a Rake task rake import:country_select 'de' for importing country names from's CLDR repository ( Don't forget to restart the application when you add new locale.

ActionView helper code is adapted from Rails' default country_select plugin (previously in core). See


<%= localized_country_select(:user, :country, [], :include_blank => 'Please choose...') %>

will become:

<select name="user[country]" id="user_country">
<option value="">Please choose...</option>
<option disabled="disabled" value="">-------------</option>
<option value="AF">Afghanistan</option>
<option value="ZW">Zimbabwe</option>

for the en locale.

Other resources

Copyright © 2008 Karel Minarik (, released under the MIT license

Something went wrong with that request. Please try again.