= LocalizedCountrySelect
Rails plugin to provide support for localized 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, http://rails-i18n.org) 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 @user.country, :scope => 'countries' %>
Comes with a Rake task rake import:country_select 'de' for importing country names
from Unicode.org's CLDR repository (http://www.unicode.org/cldr/data/charts/summary/root.html)
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 http://github.com/rails/country_select/tree/master/lib/country_select.rb
== Examples
Show the complete country name:
<%= country_select(:user, :country, {}, :include_blank => 'Please choose...') %>
will become:
Show only the country codes:
<%= country_select(:user, :country, {:description => :abbreviated}, :include_blank => 'Please choose...') %>
will become:
for the en locale.
== Other resources
* http://github.com/rails/country_select (Default Rails plugin)
* http://github.com/russ/country_code_select (Stores country code, not name)
Copyright (c) 2008 Karel Minarik (www.karmi.cz), released under the MIT license