Last active
July 26, 2016 16:47
-
-
Save javier/380f134583ae88253a85e36ce7f94191 to your computer and use it in GitHub Desktop.
seed to load country codes and names
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
#put this file on your locales directory where you have your yaml files | |
{ :es => { | |
:countries => { | |
:AC => "Isla de la Ascensión", | |
:AD => "Andorra", | |
:AE => "Emiratos Árabes Unidos", | |
:AF => "Afganistán", | |
:AG => "Antigua y Barbuda", | |
:AI => "Anguila", | |
:AL => "Albania", | |
:AM => "Armenia", | |
:AN => "Antillas Neerlandesas", | |
:AO => "Angola", | |
:AQ => "Antártida", | |
:AR => "Argentina", | |
:AS => "Samoa Americana", | |
:AT => "Austria", | |
:AU => "Australia", | |
:AW => "Aruba", | |
:AX => "Islas Åland", | |
:AZ => "Azerbaiyán", | |
:BA => "Bosnia-Herzegovina", | |
:BB => "Barbados", | |
:BD => "Bangladesh", | |
:BE => "Bélgica", | |
:BF => "Burkina Faso", | |
:BG => "Bulgaria", | |
:BH => "BahréinR042", | |
:BI => "Burundi", | |
:BJ => "Benín", | |
:BL => "San Bartolomé", | |
:BM => "Bermudas", | |
:BN => "Brunéi", | |
:BO => "Bolivia", | |
:BR => "Brasil", | |
:BS => "Bahamas", | |
:BT => "Bután", | |
:BV => "Isla Bouvet", | |
:BW => "Botsuana", | |
:BY => "Bielorrusia", | |
:BZ => "Belice", | |
:CA => "Canadá", | |
:CC => "Islas Cocos", | |
:CD => "República Democrática del Congo", | |
:CD => "Congo [República Democrática del Congo]", | |
:CF => "República Centroafricana", | |
:CG => "Congo - Brazzaville", | |
:CG => "Congo [República]", | |
:CH => "Suiza", | |
:CI => "Costa de Marfil", | |
:CI => "Costa de Marfil", | |
:CK => "Islas Cook", | |
:CL => "Chile", | |
:CM => "Camerún", | |
:CN => "China", | |
:CO => "Colombia", | |
:CP => "Isla Clipperton", | |
:CR => "Costa Rica", | |
:CS => "Serbia y Montenegro", | |
:CU => "Cuba", | |
:CV => "Cabo Verde", | |
:CX => "Isla Christmas", | |
:CY => "Chipre", | |
:CZ => "República Checa", | |
:DE => "Alemania", | |
:DG => "Diego García", | |
:DJ => "Yibuti", | |
:DK => "Dinamarca", | |
:DM => "Dominica", | |
:DO => "República Dominicana", | |
:DZ => "Argelia", | |
:EA => "Ceuta y Melilla", | |
:EC => "Ecuador", | |
:EE => "Estonia", | |
:EG => "Egipto", | |
:EH => "Sáhara Occidental", | |
:ER => "Eritrea", | |
:ES => "España", | |
:ET => "Etiopía", | |
:EU => "Unión Europea", | |
:FI => "Finlandia", | |
:FJ => "Fiyi", | |
:FK => "Islas Malvinas", | |
:FK => "Islas Malvinas [Islas Falkland]", | |
:FM => "Micronesia", | |
:FO => "Islas Feroe", | |
:FR => "Francia", | |
:FX => "Francia metropolitanad", | |
:GA => "Gabón", | |
:GB => "Reino Unido", | |
:GD => "Granada", | |
:GE => "Georgia", | |
:GF => "Guayana Francesa", | |
:GG => "Guernsey", | |
:GH => "Ghana", | |
:GI => "Gibraltar", | |
:GL => "Groenlandia", | |
:GM => "Gambia", | |
:GN => "Guinea", | |
:GP => "Guadalupe", | |
:GQ => "Guinea Ecuatorial", | |
:GR => "Grecia", | |
:GS => "Islas Georgia del Sur y Sandwich del Sur", | |
:GT => "Guatemala", | |
:GU => "Guam", | |
:GW => "Guinea-Bissau", | |
:GY => "Guyana", | |
:HK => "Región Administrativa Especial de Hong Kong de la República Popular ChinaR039", | |
:HK => "Hong Kong", | |
:HM => "Islas Heard y McDonald", | |
:HN => "Honduras", | |
:HR => "Croacia", | |
:HT => "Haití", | |
:HU => "Hungría", | |
:IC => "Islas Canarias", | |
:ID => "Indonesia", | |
:IE => "Irlanda", | |
:IL => "Israel", | |
:IM => "Isla de Man", | |
:IN => "India", | |
:IO => "Territorio Británico del Océano ÍndicoR042", | |
:IQ => "Iraq", | |
:IR => "Irán", | |
:IS => "Islandia", | |
:IT => "Italia", | |
:JE => "Jersey", | |
:JM => "Jamaica", | |
:JO => "Jordania", | |
:JP => "Japón", | |
:KE => "Kenia", | |
:KG => "KirguistánR042", | |
:KH => "Camboya", | |
:KI => "Kiribati", | |
:KM => "Comoras", | |
:KN => "San Cristóbal y Nieves", | |
:KP => "Corea del Norte", | |
:KR => "Corea del Sur", | |
:KW => "Kuwait", | |
:KY => "Islas Caimán", | |
:KZ => "Kazajistán", | |
:LA => "Laos", | |
:LB => "Líbano", | |
:LC => "Santa Lucía", | |
:LI => "Liechtenstein", | |
:LK => "Sri Lanka", | |
:LR => "Liberia", | |
:LS => "Lesoto", | |
:LT => "Lituania", | |
:LU => "Luxemburgo", | |
:LV => "Letonia", | |
:LY => "Libia", | |
:MA => "Marruecos", | |
:MC => "Mónaco", | |
:MD => "MoldaviaR039", | |
:ME => "Montenegro", | |
:MF => "San Martín", | |
:MG => "Madagascar", | |
:MH => "Islas Marshall", | |
:MK => "Macedonia", | |
:MK => "Macedonia [ERYM]", | |
:ML => "Mali", | |
:MM => "Myanmar [Birmania]", | |
:MN => "Mongolia", | |
:MO => "Región Administrativa Especial de Macao de la República Popular China", | |
:MO => "Macao", | |
:MP => "Islas Marianas del Norte", | |
:MQ => "Martinica", | |
:MR => "Mauritania", | |
:MS => "Montserrat", | |
:MT => "Malta", | |
:MU => "Mauricio", | |
:MV => "Maldivas", | |
:MW => "Malaui", | |
:MX => "México", | |
:MY => "Malasia", | |
:MZ => "Mozambique", | |
:NA => "Namibia", | |
:NC => "Nueva Caledonia", | |
:NE => "Níger", | |
:NF => "Isla Norfolk", | |
:NG => "Nigeria", | |
:NI => "Nicaragua", | |
:NL => "Países Bajos", | |
:NO => "Noruega", | |
:NP => "Nepal", | |
:NR => "Nauru", | |
:NU => "Isla Niue", | |
:NZ => "Nueva Zelanda", | |
:OM => "Omán", | |
:PA => "Panamá", | |
:PE => "Perú", | |
:PF => "Polinesia Francesa", | |
:PG => "Papúa Nueva Guinea", | |
:PH => "Filipinas", | |
:PK => "Pakistán", | |
:PL => "Polonia", | |
:PM => "San Pedro y Miquelón", | |
:PN => "Pitcairn", | |
:PR => "Puerto Rico", | |
:PS => "Territorios Palestinos", | |
:PT => "Portugal", | |
:PW => "Palau", | |
:PY => "Paraguay", | |
:QA => "Qatar", | |
:QO => "Territorios alejados de Oceanía", | |
:RE => "Reunión", | |
:RO => "Rumanía", | |
:RS => "Serbia", | |
:RU => "Rusia", | |
:RW => "Ruanda", | |
:SA => "Arabia Saudí", | |
:SB => "Islas Salomón", | |
:SC => "Seychelles", | |
:SD => "Sudán", | |
:SE => "Suecia", | |
:SG => "Singapur", | |
:SH => "Santa Elena", | |
:SI => "Eslovenia", | |
:SJ => "Svalbard y Jan Mayen", | |
:SK => "Eslovaquia", | |
:SL => "Sierra Leona", | |
:SM => "San Marino", | |
:SN => "Senegal", | |
:SO => "Somalia", | |
:SR => "SurinamR042", | |
:ST => "Santo Tomé y Príncipe", | |
:SV => "El Salvador", | |
:SY => "Siria", | |
:SZ => "Suazilandia", | |
:TA => "Tristán da Cunha", | |
:TC => "Islas Turcas y Caicos", | |
:TD => "Chad", | |
:TF => "Territorios Australes Franceses", | |
:TG => "Togo", | |
:TH => "Tailandia", | |
:TJ => "Tayikistán", | |
:TK => "Tokelau", | |
:TL => "Timor Oriental", | |
:TL => "Timor Oriental", | |
:TM => "Turkmenistán", | |
:TN => "Túnez", | |
:TO => "Tonga", | |
:TR => "Turquía", | |
:TT => "Trinidad y Tobago", | |
:TV => "Tuvalu", | |
:TW => "Taiwán", | |
:TZ => "Tanzania", | |
:UA => "Ucrania", | |
:UG => "Uganda", | |
:UM => "Islas menores alejadas de los Estados Unidos", | |
:US => "Estados Unidos", | |
:UY => "Uruguay", | |
:UZ => "Uzbekistán", | |
:VA => "Ciudad del Vaticano", | |
:VC => "San Vicente y las Granadinas", | |
:VE => "Venezuela", | |
:VG => "Islas Vírgenes Británicas", | |
:VI => "Islas Vírgenes de los Estados Unidos", | |
:VN => "Vietnam", | |
:VU => "Vanuatu", | |
:WF => "Wallis y Futuna", | |
:WS => "Samoa", | |
:YE => "Yemen", | |
:YT => "Mayotte", | |
:ZA => "Sudáfrica", | |
:ZM => "Zambia", | |
:ZW => "Zimbabue", | |
:ZZ => "Región desconocida o no válida", | |
} | |
} | |
} |
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
def init_country | |
I18n.translate(:countries, :locale => I18n.default_locale).each do |code, name| | |
country = Country.find_or_initialize_by_code code.to_s.upcase | |
country.name = name | |
country.save | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment