Skip to content

Instantly share code, notes, and snippets.

@onomojo
onomojo / i18n-country-import.rb
Created March 20, 2012 00:00
Generate yml for country locales
require 'rubygems'
require 'open-uri'
# Rake task for importing country names from Unicode.org's CLDR repository
# (http://www.unicode.org/cldr/data/charts/summary/root.html).
#
# It parses a HTML file from Unicode.org for given locale and saves the
# Rails' I18n hash in the plugin +locale+ directory
#
# Don't forget to restart the application when you add new locale to load it into Rails!