localized_country_select 0.0.1 → 0.9.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -11,21 +11,34 @@ You can easily translate country codes in your application like this:
11
11
 
12
12
  <%= I18n.t @user.country, :scope => 'countries' %>
13
13
 
14
- Comes with a Rake task <tt>rake import:country_select 'de'</tt> for importing country names
14
+ Comes with a Rake task <tt>rake import:country_select LOCALE=de</tt> for importing country names
15
15
  from Unicode.org's CLDR repository (http://www.unicode.org/cldr/data/charts/summary/root.html)
16
16
  Don't forget to restart the application when you add new locale.
17
17
 
18
18
  ActionView helper code is adapted from Rails' default +country_select+ plugin (previously in core).
19
19
  See http://github.com/rails/country_select/tree/master/lib/country_select.rb
20
20
 
21
- == Examples
21
+ == Rails 3
22
22
 
23
- Show the complete country name:
23
+ In your Gemfile add:
24
24
 
25
- <%= country_select(:user, :country, {}, :include_blank => 'Please choose...') %>
25
+ gem 'localized_country_select', '>= 0.9.2'
26
+
27
+ == Rails 2.3
28
+
29
+ No longer supported, but you can still use old version of gem.
30
+ In environment.rb add
31
+
32
+ config.gem 'localized_country_select, , :version => '0.0.1'
33
+
34
+ == Example
35
+
36
+ Show full country names:
37
+
38
+ <%= localized_country_select(:user, :country, [], {:include_blank => 'Please choose...')} %>
26
39
 
27
40
  will become:
28
-
41
+
29
42
  <select name="user[country]" id="user_country">
30
43
  <option value="">Please choose...</option>
31
44
  <option disabled="disabled" value="">-------------</option>
@@ -35,12 +48,12 @@ will become:
35
48
  </select>
36
49
 
37
50
 
38
- Show only the country codes:
51
+ Show only country codes:
39
52
 
40
- <%= country_select(:user, :country, {:description => :abbreviated}, :include_blank => 'Please choose...') %>
53
+ <%= localized_country_select(:user, :country, [], {:include_blank => 'Please choose...', :description => :abbreviated)}
41
54
 
42
55
  will become:
43
-
56
+
44
57
  <select name="user[country]" id="user_country">
45
58
  <option value="">Please choose...</option>
46
59
  <option disabled="disabled" value="">-------------</option>
@@ -48,8 +61,15 @@ will become:
48
61
  ...
49
62
  <option value="ZW">ZW</option>
50
63
  </select>
64
+
65
+
51
66
  for the <tt>en</tt> locale.
52
67
 
68
+
69
+ == Formtastic and SimpleForm
70
+
71
+ Gem supports (via alias_method) both formtastic and simple_form :country input
72
+
53
73
  == Other resources
54
74
 
55
75
  * http://github.com/rails/country_select (Default Rails plugin)
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'rake'
2
2
  require 'rake/testtask'
3
- require 'rake/rdoctask'
3
+ require 'rake/task'
4
4
 
5
5
  load File.join(File.dirname(__FILE__), 'lib', 'tasks', 'localized_country_select_tasks.rake')
6
6
 
@@ -14,28 +14,11 @@ Rake::TestTask.new(:test) do |t|
14
14
  t.verbose = true
15
15
  end
16
16
 
17
- desc 'Generate documentation for the localized_country_select plugin.'
18
- Rake::RDocTask.new(:rdoc) do |rdoc|
19
- rdoc.rdoc_dir = 'rdoc'
20
- rdoc.title = 'LocalizedCountrySelect'
21
- rdoc.options << '--line-numbers' << '--inline-source'
22
- rdoc.rdoc_files.include('README.rdoc')
23
- rdoc.rdoc_files.include('lib/**/*.rb')
24
- end
25
-
26
- #
27
- # Jeweler
28
- #
29
- begin
30
- require 'jeweler'
31
- Jeweler::Tasks.new do |gemspec|
32
- gemspec.name = "localized_country_select"
33
- gemspec.summary = "Localized country select list"
34
- gemspec.description = "Where are you from ?"
35
- gemspec.email = "damien.mathieu@lim.eu"
36
- gemspec.homepage = "http://github.com/LIMSAS/localized_country_select"
37
- gemspec.authors = ["LIM SAS", "Damien MATHIEU", "Julien SANCHEZ", "Hervé GAUCHER"]
38
- end
39
- rescue LoadError
40
- puts "Jeweler not available. Install it with: gem install jeweler"
41
- end
17
+ #desc 'Generate documentation for the localized_country_select plugin.'
18
+ #Rake::Task.new(:rdoc) do |rdoc|
19
+ #rdoc.rdoc_dir = 'rdoc'
20
+ #rdoc.title = 'LocalizedCountrySelect'
21
+ #rdoc.options << '--line-numbers' << '--inline-source'
22
+ #rdoc.rdoc_files.include('README.rdoc')
23
+ #rdoc.rdoc_files.include('lib/**/*.rb')
24
+ #end
@@ -1,23 +1,24 @@
1
1
  # = LocalizedCountrySelect
2
- #
2
+ #
3
3
  # View helper for displaying select list with countries:
4
- #
5
- # country_select(:user, :country)
6
- #
4
+ #
5
+ # localized_country_select(:user, :country)
6
+ #
7
7
  # Works just like the default Rails' +country_select+ plugin, but stores countries as
8
8
  # country *codes*, not *names*, in the database.
9
- #
9
+ #
10
10
  # You can easily translate country codes in your application like this:
11
11
  # <%= I18n.t @user.country, :scope => 'countries' %>
12
- #
12
+ #
13
13
  # Uses the Rails internationalization framework (I18n) for translating the names of countries.
14
- #
14
+ #
15
15
  # Use Rake task <tt>rake import:country_select 'de'</tt> for importing country names
16
16
  # from Unicode.org's CLDR repository (http://www.unicode.org/cldr/data/charts/summary/root.html)
17
- #
17
+ #
18
18
  # Code adapted from Rails' default +country_select+ plugin (previously in core)
19
19
  # See http://github.com/rails/country_select/tree/master/lib/country_select.rb
20
20
  #
21
+
21
22
  module LocalizedCountrySelect
22
23
  class << self
23
24
  # Returns array with codes and localized country names (according to <tt>I18n.locale</tt>)
@@ -25,10 +26,10 @@ module LocalizedCountrySelect
25
26
  def localized_countries_array(options={})
26
27
  if(options[:description]==:abbreviated)
27
28
  I18n.translate(:countries).map { |key, value| [key.to_s.upcase] }.
28
- sort_by { |country| country.first }
29
+ sort_by { |country| country.first.parameterize }
29
30
  else
30
31
  I18n.translate(:countries).map { |key, value| [value, key.to_s.upcase] }.
31
- sort_by { |country| country.first }
32
+ sort_by { |country| country.first.parameterize }
32
33
  end
33
34
  end
34
35
  # Return array with codes and localized country names for array of country codes passed as argument
@@ -51,35 +52,40 @@ module ActionView
51
52
 
52
53
  module FormOptionsHelper
53
54
 
54
- # Return select and option tags for the given object and method, using +localized_country_options_for_select+
55
+ # Return select and option tags for the given object and method, using +localized_country_options_for_select+
55
56
  # to generate the list of option tags. Uses <b>country code</b>, not name as option +value+.
56
57
  # Country codes listed as an array of symbols in +priority_countries+ argument will be listed first
57
58
  # TODO : Implement pseudo-named args with a hash, not the "somebody said PHP?" multiple args sillines
58
- def country_select(object, method, priority_countries = nil, options = {}, html_options = {})
59
+ def localized_country_select(object, method, priority_countries = nil, options = {}, html_options = {})
59
60
  InstanceTag.new(object, method, self, options.delete(:object)).
60
61
  to_localized_country_select_tag(priority_countries, options, html_options)
61
62
  end
63
+ alias_method :country_select, :localized_country_select
62
64
 
63
65
  # Return "named" select and option tags according to given arguments.
64
66
  # Use +selected_value+ for setting initial value
65
67
  # It behaves likes older object-binded brother +localized_country_select+ otherwise
66
68
  # TODO : Implement pseudo-named args with a hash, not the "somebody said PHP?" multiple args sillines
67
- def country_select_tag(name, selected_value = nil, priority_countries = nil, html_options = {})
68
- select_tag name.to_sym, country_options_for_select(selected_value, priority_countries), html_options.stringify_keys
69
+ def localized_country_select_tag(name, selected_value = nil, priority_countries = nil, html_options = {})
70
+ select_tag name.to_sym, localized_country_options_for_select(selected_value, priority_countries).html_safe, html_options.stringify_keys
69
71
  end
72
+ alias_method :country_select_tag, :localized_country_select_tag
70
73
 
71
- # Returns a string of option tags for countries according to locale. Supply the country code in upper-case ('US', 'DE')
74
+ # Returns a string of option tags for countries according to locale. Supply the country code in upper-case ('US', 'DE')
72
75
  # as +selected+ to have it marked as the selected option tag.
73
76
  # Country codes listed as an array of symbols in +priority_countries+ argument will be listed first
74
- def country_options_for_select(selected = nil, priority_countries = nil,options={})
75
- country_options = ""
77
+ def localized_country_options_for_select(selected = nil, priority_countries = nil, options={})
78
+ country_options = "".html_safe
76
79
  if priority_countries
77
- country_options += options_for_select(LocalizedCountrySelect::priority_countries_array(priority_countries,options), selected)
78
- country_options += "<option value=\"\" disabled=\"disabled\">-------------</option>\n"
80
+ country_options += options_for_select(LocalizedCountrySelect::priority_countries_array(priority_countries, options), selected)
81
+ country_options += "<option value=\"\" disabled=\"disabled\">-------------</option>\n".html_safe
82
+ return country_options + options_for_select(LocalizedCountrySelect::localized_countries_array(options) - LocalizedCountrySelect::priority_countries_array(priority_countries, options), selected)
83
+ else
84
+ return country_options + options_for_select(LocalizedCountrySelect::localized_countries_array(options), selected)
79
85
  end
80
- return country_options + options_for_select(LocalizedCountrySelect::localized_countries_array(options), selected)
81
86
  end
82
-
87
+ alias_method :country_options_for_select, :localized_country_options_for_select
88
+
83
89
  end
84
90
 
85
91
  class InstanceTag
@@ -89,18 +95,23 @@ module ActionView
89
95
  value = value(object)
90
96
  content_tag("select",
91
97
  add_options(
92
- country_options_for_select(value, priority_countries,options),
98
+ localized_country_options_for_select(value, priority_countries, options).html_safe,
93
99
  options, value
94
100
  ), html_options
95
101
  )
96
102
  end
97
103
  end
98
-
104
+
99
105
  class FormBuilder
100
- def country_select(method, priority_countries = nil, options = {}, html_options = {})
101
- @template.country_select(@object_name, method, priority_countries, options.merge(:object => @object), html_options)
106
+ def localized_country_select(method, priority_countries = nil, options = {}, html_options = {})
107
+ @template.localized_country_select(@object_name, method, priority_countries, options.merge(:object => @object), html_options)
102
108
  end
109
+ alias_method :country_select, :localized_country_select
103
110
  end
104
111
 
105
112
  end
106
113
  end
114
+
115
+ if defined?(Rails)
116
+ require "localized_country_select/railtie"
117
+ end
@@ -0,0 +1,13 @@
1
+ require 'localized_country_select'
2
+
3
+ module LocalizedCountrySelect
4
+ if defined? Rails::Railtie
5
+ require 'rails'
6
+ class Railtie < Rails::Railtie
7
+ rake_tasks do
8
+ load "tasks/localized_country_select_tasks.rake"
9
+ end
10
+ end
11
+ end
12
+
13
+ end
@@ -0,0 +1,3 @@
1
+ module LocalizedCountrySelect
2
+ VERSION = "0.9.2"
3
+ end
@@ -10,7 +10,7 @@ require 'open-uri'
10
10
  # Don't forget to restart the application when you add new locale to load it into Rails!
11
11
  #
12
12
  # == Example
13
- # rake import:country_select LOCALE=de
13
+ # rake import:country_select 'de'
14
14
  #
15
15
  # The code is deliberately procedural and simple, so it's easily
16
16
  # understandable by beginners as an introduction to Rake tasks power.
@@ -63,7 +63,8 @@ namespace :import do
63
63
 
64
64
 
65
65
  # ----- Prepare the output format ------------------------------------------
66
- output =<<HEAD
66
+ output = "#encoding: UTF-8\n"
67
+ output <<<<HEAD
67
68
  { :#{locale} => {
68
69
 
69
70
  :countries => {
@@ -81,8 +82,10 @@ TAIL
81
82
 
82
83
  # ----- Write the parsed values into file ---------------------------------
83
84
  puts "\n... writing the output"
84
- filename = File.join(File.dirname(__FILE__), '..', '..', 'locale', "#{locale}.rb")
85
- filename += '.NEW' if File.exists?(filename) # Append 'NEW' if file exists
85
+ filename = Rails.root.join('config', 'locales', "country_select_#{locale.downcase}.rb")
86
+ if filename.exist?
87
+ filename = Pathname.new("#{filename.to_s}.NEW")
88
+ end
86
89
  File.open(filename, 'w+') { |f| f << output }
87
90
  puts "\n---\nWritten values for the '#{locale}' into file: #{filename}\n"
88
91
  # ------------------------------------------------------------------------------
@@ -0,0 +1,259 @@
1
+ { :cz => {
2
+
3
+ :countries => {
4
+ :AD => "Andorra",
5
+ :AE => "Spojené arabské emiráty",
6
+ :AF => "Afghánistán",
7
+ :AG => "Antigua a Barbuda",
8
+ :AI => "Anguila",
9
+ :AL => "Albánie",
10
+ :AM => "Arménie",
11
+ :AN => "Nizozemské Antily",
12
+ :AO => "Angola",
13
+ :AQ => "Antarktida",
14
+ :AR => "Argentina",
15
+ :AS => "Americká Samoa",
16
+ :AT => "Rakousko",
17
+ :AU => "Austrálie",
18
+ :AW => "Aruba",
19
+ :AX => "Alandy",
20
+ :AZ => "Ázerbájdžán",
21
+ :BA => "Bosna a Hercegovina",
22
+ :BB => "Barbados",
23
+ :BD => "Bangladéš",
24
+ :BE => "Belgie",
25
+ :BF => "Burkina Faso",
26
+ :BG => "Bulharsko",
27
+ :BH => "Bahrajn",
28
+ :BI => "Burundi",
29
+ :BJ => "Benin",
30
+ :BL => "Svatý Bartolomějd",
31
+ :BM => "Bermudy",
32
+ :BN => "Brunej Darussalam",
33
+ :BO => "Bolívie",
34
+ :BR => "Brazílie",
35
+ :BS => "Bahamy",
36
+ :BT => "Bhútán",
37
+ :BV => "Ostrov Bouvet",
38
+ :BW => "Botswana",
39
+ :BY => "Bělorusko",
40
+ :BZ => "Belize",
41
+ :CA => "Kanada",
42
+ :CC => "Kokosové ostrovy",
43
+ :CD => "Demokratická republika Kongo",
44
+ :CF => "Středoafrická republika",
45
+ :CG => "Kongo",
46
+ :CH => "Švýcarsko",
47
+ :CI => "Pobřeží slonoviny",
48
+ :CK => "Cookovy ostrovy",
49
+ :CL => "Chile",
50
+ :CM => "Kamerun",
51
+ :CN => "Čína",
52
+ :CO => "Kolumbie",
53
+ :CR => "Kostarika",
54
+ :CS => "Srbsko a Černá HoraR014",
55
+ :CU => "Kuba",
56
+ :CV => "Kapverdy",
57
+ :CX => "Vánoční ostrovy",
58
+ :CY => "Kypr",
59
+ :CZ => "Česká republika",
60
+ :DE => "Německo",
61
+ :DJ => "Džibuti",
62
+ :DK => "Dánsko",
63
+ :DM => "Dominika",
64
+ :DO => "Dominikánská republika",
65
+ :DZ => "Alžírsko",
66
+ :EC => "Ekvádor",
67
+ :EE => "Estonsko",
68
+ :EG => "Egypt",
69
+ :EH => "Západní Sahara",
70
+ :ER => "Eritrea",
71
+ :ES => "Španělsko",
72
+ :ET => "Etiopie",
73
+ :FI => "Finsko",
74
+ :FJ => "Fidži",
75
+ :FK => "Falklandské ostrovy",
76
+ :FM => "Mikronézie",
77
+ :FO => "Faerské ostrovy",
78
+ :FR => "Francie",
79
+ :GA => "Gabon",
80
+ :GB => "Velká Británie",
81
+ :GD => "Grenada",
82
+ :GE => "Gruzie",
83
+ :GF => "Francouzská Guyana",
84
+ :GG => "Guernsey",
85
+ :GH => "Ghana",
86
+ :GI => "Gibraltar",
87
+ :GL => "Grónsko",
88
+ :GM => "Gambie",
89
+ :GN => "Guinea",
90
+ :GP => "Guadeloupe",
91
+ :GQ => "Rovníková Guinea",
92
+ :GR => "Řecko",
93
+ :GS => "Jižní Georgie a Jižní Sandwichovy ostrovy",
94
+ :GT => "Guatemala",
95
+ :GU => "Guam",
96
+ :GW => "Guinea-Bissau",
97
+ :GY => "Guyana",
98
+ :HK => "Hongkong, zvláštní administrativní oblast Číny",
99
+ :HK => "Hongkong",
100
+ :HM => "Ostrovy Heard a McDonald",
101
+ :HN => "Honduras",
102
+ :HR => "Chorvatsko",
103
+ :HT => "Haiti",
104
+ :HU => "Maďarsko",
105
+ :ID => "Indonésie",
106
+ :IE => "Irsko",
107
+ :IL => "Izrael",
108
+ :IM => "Ostrov Man",
109
+ :IN => "Indie",
110
+ :IO => "Britské území v Indickém oceánu",
111
+ :IQ => "Irák",
112
+ :IR => "Írán",
113
+ :IS => "Island",
114
+ :IT => "Itálie",
115
+ :JE => "Jersey",
116
+ :JM => "Jamajka",
117
+ :JO => "Jordánsko",
118
+ :JP => "Japonsko",
119
+ :KE => "Keňa",
120
+ :KG => "Kyrgyzstán",
121
+ :KH => "Kambodža",
122
+ :KI => "Kiribati",
123
+ :KM => "Komory",
124
+ :KN => "Svatý Kitts a Nevis",
125
+ :KP => "Severní Korea",
126
+ :KR => "Jižní Korea",
127
+ :KW => "Kuvajt",
128
+ :KY => "Kajmanské ostrovy",
129
+ :KZ => "Kazachstán",
130
+ :LA => "Lidově demokratická republika Laos",
131
+ :LB => "Libanon",
132
+ :LC => "Svatá Lucie",
133
+ :LI => "Lichtenštejnsko",
134
+ :LK => "Srí Lanka",
135
+ :LR => "Libérie",
136
+ :LS => "Lesotho",
137
+ :LT => "Litva",
138
+ :LU => "Lucembursko",
139
+ :LV => "Lotyšsko",
140
+ :LY => "Libye",
141
+ :MA => "Maroko",
142
+ :MC => "Monako",
143
+ :MD => "Moldavsko, republika",
144
+ :ME => "Černá Hora",
145
+ :MF => "Svatý Martin; [draft=contributed]",
146
+ :MG => "Madagaskar",
147
+ :MH => "Marshallovy ostrovy",
148
+ :MK => "Macedonia",
149
+ :ML => "Mali",
150
+ :MM => "Myanmar",
151
+ :MN => "Mongolsko",
152
+ :MO => "Zvláštní administrativní oblast Číny Macao",
153
+ :MO => "Macao",
154
+ :MP => "Severní Mariany",
155
+ :MQ => "Martinik",
156
+ :MR => "Mauritánie",
157
+ :MS => "Montserrat",
158
+ :MT => "Malta",
159
+ :MU => "Mauricius",
160
+ :MV => "Maladivy",
161
+ :MW => "Malawi",
162
+ :MX => "Mexiko",
163
+ :MY => "Malajsie",
164
+ :MZ => "Mosambik",
165
+ :NA => "Namibie",
166
+ :NC => "Nová Kaledonie",
167
+ :NE => "Niger",
168
+ :NF => "Norfolk",
169
+ :NG => "Nigérie",
170
+ :NI => "Nikaragua",
171
+ :NL => "Nizozemsko",
172
+ :NO => "Norsko",
173
+ :NP => "Nepál",
174
+ :NR => "Nauru",
175
+ :NU => "Niue",
176
+ :NZ => "Nový Zéland",
177
+ :OM => "Omán",
178
+ :PA => "Panama",
179
+ :PE => "Peru",
180
+ :PF => "Francouzská Polynésie",
181
+ :PG => "Papua-Nová Guinea",
182
+ :PH => "Filipíny",
183
+ :PK => "Pákistán",
184
+ :PL => "Polsko",
185
+ :PM => "Svatý Pierre a Miquelon",
186
+ :PN => "Pitcairn",
187
+ :PR => "Portoriko",
188
+ :PS => "Palestinian Territory",
189
+ :PT => "Portugalsko",
190
+ :PW => "Palau",
191
+ :PY => "Paraguay",
192
+ :QA => "Katar",
193
+ :QO => "Vnější Oceánie",
194
+ :QU => "Evropská unie",
195
+ :RE => "Réunion",
196
+ :RO => "Rumunsko",
197
+ :RS => "Srbsko",
198
+ :RU => "Rusko",
199
+ :RW => "Rwanda",
200
+ :SA => "Saúdská Arábie",
201
+ :SB => "Šalamounovy ostrovy",
202
+ :SC => "Seychely",
203
+ :SD => "Súdán",
204
+ :SE => "Švédsko",
205
+ :SG => "Singapur",
206
+ :SH => "Svatá Helena",
207
+ :SI => "Slovinsko",
208
+ :SJ => "Svalbard a Jan Mayen",
209
+ :SK => "Slovensko",
210
+ :SL => "Sierra Leone",
211
+ :SM => "San Marino",
212
+ :SN => "Senegal",
213
+ :SO => "Somálsko",
214
+ :SR => "Surinam",
215
+ :ST => "Svatý Tomáš",
216
+ :SV => "El Salvador",
217
+ :SY => "Sýrie",
218
+ :SZ => "Svazijsko",
219
+ :TC => "Ostrovy Caicos a Turks",
220
+ :TD => "Čad",
221
+ :TF => "Francouzská jižní teritoria",
222
+ :TG => "Togo",
223
+ :TH => "Thajsko",
224
+ :TJ => "Tádžikistán",
225
+ :TK => "Tokelau",
226
+ :TL => "Východní Timor",
227
+ :TM => "Turkmenistán",
228
+ :TN => "Tunisko",
229
+ :TO => "Tonga",
230
+ :TR => "Turecko",
231
+ :TT => "Trinidad a Tobago",
232
+ :TV => "Tuvalu",
233
+ :TW => "Tchaj-wan",
234
+ :TZ => "Tanzanie",
235
+ :UA => "Ukrajina",
236
+ :UG => "Uganda",
237
+ :UM => "Menší odlehlé ostrovy USA",
238
+ :US => "Spojené státy",
239
+ :UY => "Uruguay",
240
+ :UZ => "Uzbekistán",
241
+ :VA => "Svatý stolec",
242
+ :VC => "Svatý Vincent a Grenadiny",
243
+ :VE => "Venezuela",
244
+ :VG => "Britské Panenské ostrovy",
245
+ :VI => "Americké Panenské ostrovy",
246
+ :VN => "Vietnam",
247
+ :VU => "Vanuatu",
248
+ :WF => "Wallis a Futuna",
249
+ :WS => "Samoa",
250
+ :YE => "Jemen",
251
+ :YT => "Mayotte",
252
+ :ZA => "Jihoafrická republika",
253
+ :ZM => "Zambie",
254
+ :ZW => "Zimbabwe",
255
+ :ZZ => "Neznámá nebo neplatná oblast",
256
+ }
257
+
258
+ }
259
+ }
@@ -31,6 +31,7 @@
31
31
  :BM => "Bermuda",
32
32
  :BN => "Brunei",
33
33
  :BO => "Bolivia",
34
+ :BQ => "British Antarctic Territory",
34
35
  :BR => "Brazil",
35
36
  :BS => "Bahamas",
36
37
  :BT => "Bhutan",
@@ -44,18 +45,21 @@
44
45
  :CF => "Central African Republic",
45
46
  :CG => "Congo - Brazzaville",
46
47
  :CH => "Switzerland",
47
- :CI => "Cote d'Ivoire",
48
+ :CI => "Ivory Coast",
48
49
  :CK => "Cook Islands",
49
50
  :CL => "Chile",
50
51
  :CM => "Cameroon",
51
52
  :CN => "China",
52
53
  :CO => "Colombia",
53
54
  :CR => "Costa Rica",
55
+ :CS => "Serbia and Montenegro",
56
+ :CT => "Canton and Enderbury Islands",
54
57
  :CU => "Cuba",
55
58
  :CV => "Cape Verde",
56
59
  :CX => "Christmas Island",
57
60
  :CY => "Cyprus",
58
61
  :CZ => "Czech Republic",
62
+ :DD => "East Germany",
59
63
  :DE => "Germany",
60
64
  :DJ => "Djibouti",
61
65
  :DK => "Denmark",
@@ -74,7 +78,9 @@
74
78
  :FK => "Falkland Islands",
75
79
  :FM => "Micronesia",
76
80
  :FO => "Faroe Islands",
81
+ :FQ => "French Southern and Antarctic Territories",
77
82
  :FR => "France",
83
+ :FX => "Metropolitan France",
78
84
  :GA => "Gabon",
79
85
  :GB => "United Kingdom",
80
86
  :GD => "Grenada",
@@ -94,6 +100,7 @@
94
100
  :GU => "Guam",
95
101
  :GW => "Guinea-Bissau",
96
102
  :GY => "Guyana",
103
+ :HK => "Hong Kong SAR China",
97
104
  :HK => "Hong Kong",
98
105
  :HM => "Heard Island and McDonald Islands",
99
106
  :HN => "Honduras",
@@ -105,6 +112,7 @@
105
112
  :IL => "Israel",
106
113
  :IM => "Isle of Man",
107
114
  :IN => "India",
115
+ :IO => "British Indian Ocean Territory",
108
116
  :IQ => "Iraq",
109
117
  :IR => "Iran",
110
118
  :IS => "Iceland",
@@ -113,6 +121,7 @@
113
121
  :JM => "Jamaica",
114
122
  :JO => "Jordan",
115
123
  :JP => "Japan",
124
+ :JT => "Johnston Island",
116
125
  :KE => "Kenya",
117
126
  :KG => "Kyrgyzstan",
118
127
  :KH => "Cambodia",
@@ -142,11 +151,13 @@
142
151
  :MF => "Saint Martin",
143
152
  :MG => "Madagascar",
144
153
  :MH => "Marshall Islands",
154
+ :MI => "Midway Islands",
145
155
  :MK => "Macedonia",
146
156
  :ML => "Mali",
147
157
  :MM => "Myanmar",
148
158
  :MN => "Mongolia",
149
- :MO => "Macao",
159
+ :MO => "Macau SAR China",
160
+ :MO => "Macau",
150
161
  :MP => "Northern Mariana Islands",
151
162
  :MQ => "Martinique",
152
163
  :MR => "Mauritania",
@@ -167,11 +178,14 @@
167
178
  :NL => "Netherlands",
168
179
  :NO => "Norway",
169
180
  :NP => "Nepal",
181
+ :NQ => "Dronning Maud Land",
170
182
  :NR => "Nauru",
183
+ :NT => "Neutral Zone",
171
184
  :NU => "Niue",
172
185
  :NZ => "New Zealand",
173
186
  :OM => "Oman",
174
187
  :PA => "Panama",
188
+ :PC => "Pacific Islands Trust Territory",
175
189
  :PE => "Peru",
176
190
  :PF => "French Polynesia",
177
191
  :PG => "Papua New Guinea",
@@ -183,9 +197,13 @@
183
197
  :PR => "Puerto Rico",
184
198
  :PS => "Palestinian Territory",
185
199
  :PT => "Portugal",
200
+ :PU => "U.S. Miscellaneous Pacific Islands",
186
201
  :PW => "Palau",
187
202
  :PY => "Paraguay",
203
+ :PZ => "Panama Canal Zone",
188
204
  :QA => "Qatar",
205
+ :QO => "Outlying Oceania",
206
+ :QU => "European Union",
189
207
  :RE => "Reunion",
190
208
  :RO => "Romania",
191
209
  :RS => "Serbia",
@@ -207,6 +225,7 @@
207
225
  :SO => "Somalia",
208
226
  :SR => "Suriname",
209
227
  :ST => "Sao Tome and Principe",
228
+ :SU => "Union of Soviet Socialist Republics",
210
229
  :SV => "El Salvador",
211
230
  :SY => "Syria",
212
231
  :SZ => "Swaziland",
@@ -228,22 +247,28 @@
228
247
  :TZ => "Tanzania",
229
248
  :UA => "Ukraine",
230
249
  :UG => "Uganda",
250
+ :UM => "United States Minor Outlying Islands",
231
251
  :US => "United States",
232
252
  :UY => "Uruguay",
233
253
  :UZ => "Uzbekistan",
234
254
  :VA => "Vatican",
235
255
  :VC => "Saint Vincent and the Grenadines",
256
+ :VD => "North Vietnam",
236
257
  :VE => "Venezuela",
237
258
  :VG => "British Virgin Islands",
238
259
  :VI => "U.S. Virgin Islands",
239
260
  :VN => "Vietnam",
240
261
  :VU => "Vanuatu",
262
+ :WF => "Wallis and Futuna",
263
+ :WK => "Wake Island",
241
264
  :WS => "Samoa",
265
+ :YD => "People's Democratic Republic of Yemen",
242
266
  :YE => "Yemen",
243
267
  :YT => "Mayotte",
244
268
  :ZA => "South Africa",
245
269
  :ZM => "Zambia",
246
270
  :ZW => "Zimbabwe",
271
+ :ZZ => "Unknown or Invalid Region",
247
272
  }
248
273
 
249
274
  }
@@ -1,12 +1,10 @@
1
- # coding: utf-8
2
- $KCODE = 'u'
3
-
1
+ # encoding: utf-8
4
2
  require 'test/unit'
5
3
 
6
4
  require 'rubygems'
7
5
  require 'active_support'
8
- require 'action_controller'
9
- # require 'action_controller/test_process'
6
+ require 'action_dispatch'
7
+ require 'action_dispatch/testing/test_process'
10
8
  require 'action_view'
11
9
  require 'action_view/helpers'
12
10
  require 'action_view/helpers/tag_helper'
@@ -27,58 +25,58 @@ class LocalizedCountrySelectTest < Test::Unit::TestCase
27
25
  include ActionView::Helpers::FormTagHelper
28
26
 
29
27
  def test_action_view_should_include_helper_for_object
30
- assert ActionView::Helpers::FormBuilder.instance_methods.include?('country_select') # WTF not working with 1.9
31
- assert ActionView::Helpers::FormOptionsHelper.instance_methods.include?('country_select')
28
+ assert ActionView::Helpers::FormBuilder.instance_methods.member?(:localized_country_select)
29
+ assert ActionView::Helpers::FormOptionsHelper.instance_methods.include?(:localized_country_select)
32
30
  end
33
31
 
34
32
  def test_action_view_should_include_helper_tag
35
- assert ActionView::Helpers::FormOptionsHelper.instance_methods.include?('country_select_tag') # WTF not working with 1.9
33
+ assert ActionView::Helpers::FormOptionsHelper.instance_methods.include?(:localized_country_select_tag)
36
34
  end
37
35
 
38
36
  def test_should_return_select_tag_with_proper_name_for_object
39
- # puts country_select(:user, :country)
40
- assert country_select(:user, :country) =~
37
+ # puts localized_country_select(:user, :country)
38
+ assert localized_country_select(:user, :country) =~
41
39
  Regexp.new(Regexp.escape('<select id="user_country" name="user[country]">')),
42
40
  "Should have proper name for object"
43
41
  end
44
42
 
45
43
  def test_should_return_select_tag_with_proper_name
46
- # puts country_select_tag( "competition_submission[data][citizenship]", nil)
47
- assert country_select_tag( "competition_submission[data][citizenship]", nil) =~
44
+ # puts localized_country_select_tag( "competition_submission[data][citizenship]", nil)
45
+ assert localized_country_select_tag( "competition_submission[data][citizenship]", nil) =~
48
46
  Regexp.new(
49
47
  Regexp.escape('<select id="competition_submission_data_citizenship" name="competition_submission[data][citizenship]">') ),
50
48
  "Should have proper name"
51
49
  end
52
50
 
53
51
  def test_should_return_option_tags
54
- assert country_select(:user, :country) =~ Regexp.new(Regexp.escape('<option value="ES">Spain</option>'))
52
+ assert localized_country_select(:user, :country) =~ Regexp.new(Regexp.escape('<option value="ES">Spain</option>'))
55
53
  end
56
54
 
57
55
  def test_should_return_localized_option_tags
58
- I18n.locale = 'ru'
59
- assert country_select(:user, :country) =~ Regexp.new(Regexp.escape('<option value="ES">Испания</option>'))
56
+ I18n.locale = 'cz'
57
+ assert localized_country_select(:user, :country) =~ Regexp.new(Regexp.escape('<option value="ES">Španělsko</option>'))
60
58
  end
61
59
 
62
60
  def test_should_return_priority_countries_first
63
- assert country_options_for_select(nil, [:ES, :CZ]) =~ Regexp.new(
61
+ assert localized_country_options_for_select(nil, [:ES, :CZ]) =~ Regexp.new(
64
62
  Regexp.escape("<option value=\"ES\">Spain</option>\n<option value=\"CZ\">Czech Republic</option><option value=\"\" disabled=\"disabled\">-------------</option>\n<option value=\"AF\">Afghanistan</option>\n"))
65
63
  end
66
64
 
67
65
  def test_i18n_should_know_about_countries
68
66
  assert_equal 'Spain', I18n.t('ES', :scope => 'countries')
69
- I18n.locale = 'ru'
70
- assert_equal 'Испания', I18n.t('ES', :scope => 'countries')
67
+ I18n.locale = 'cz'
68
+ assert_equal 'Španělsko', I18n.t('ES', :scope => 'countries')
71
69
  end
72
70
 
73
71
  def test_localized_countries_array_returns_correctly
74
72
  assert_nothing_raised { LocalizedCountrySelect::localized_countries_array() }
75
73
  # puts LocalizedCountrySelect::localized_countries_array.inspect
76
74
  I18n.locale = 'en'
77
- assert_equal 243, LocalizedCountrySelect::localized_countries_array.size
75
+ assert_equal 266, LocalizedCountrySelect::localized_countries_array.size
78
76
  assert_equal 'Afghanistan', LocalizedCountrySelect::localized_countries_array.first[0]
79
- I18n.locale = 'ru'
80
- assert_equal 243, LocalizedCountrySelect::localized_countries_array.size
81
- assert_equal 'Австралия', LocalizedCountrySelect::localized_countries_array.first[0]
77
+ I18n.locale = 'cz'
78
+ assert_equal 250, LocalizedCountrySelect::localized_countries_array.size
79
+ assert_equal 'Afghánistán', LocalizedCountrySelect::localized_countries_array.first[0]
82
80
  end
83
81
 
84
82
  def test_priority_countries_returns_correctly_and_in_correct_order
@@ -99,14 +97,14 @@ class LocalizedCountrySelectTest < Test::Unit::TestCase
99
97
  end
100
98
 
101
99
  def test_should_list_countries_with_accented_names_in_correct_order
102
- I18n.locale = 'ru'
103
- assert_match Regexp.new(Regexp.escape(%Q{<option value="BT">Бутан</option>\n<option value="VU">Вануату</option>})), country_select(:user, :country)
100
+ I18n.locale = 'cz'
101
+ assert_match Regexp.new(Regexp.escape(%Q{<option value="BI">Burundi</option>\n<option value="TD">Čad</option>})), localized_country_select(:user, :country)
104
102
  end
105
103
 
106
- # private
104
+ #private
107
105
 
108
106
  def setup
109
- ['ru', 'en'].each do |locale|
107
+ ['cz', 'en'].each do |locale|
110
108
  # I18n.load_translations( File.join(File.dirname(__FILE__), '..', 'locale', "#{locale}.rb") ) # <-- Old style! :)
111
109
  I18n.load_path += Dir[ File.join(File.dirname(__FILE__), '..', 'locale', "#{locale}.rb") ]
112
110
  end
metadata CHANGED
@@ -1,81 +1,115 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: localized_country_select
3
- version: !ruby/object:Gem::Version
4
- hash: 29
5
- prerelease: false
6
- segments:
7
- - 0
8
- - 0
9
- - 1
10
- version: 0.0.1
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.9.2
5
+ prerelease:
11
6
  platform: ruby
12
- authors:
7
+ authors:
8
+ - karmi
9
+ - mlitwiniuk
13
10
  - LIM SAS
14
11
  - Damien MATHIEU
15
12
  - Julien SANCHEZ
16
- - "Herv\xC3\xA9 GAUCHER"
13
+ - Hervé GAUCHER
14
+ - ! 'RainerBlessing '
17
15
  autorequire:
18
16
  bindir: bin
19
17
  cert_chain: []
20
-
21
- date: 2010-07-21 00:00:00 +02:00
22
- default_executable:
23
- dependencies: []
24
-
25
- description: Where are you from ?
26
- email: damien.mathieu@lim.eu
18
+ date: 2013-01-15 00:00:00.000000000 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: actionpack
22
+ requirement: !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ! '>='
26
+ - !ruby/object:Gem::Version
27
+ version: '3.0'
28
+ type: :runtime
29
+ prerelease: false
30
+ version_requirements: !ruby/object:Gem::Requirement
31
+ none: false
32
+ requirements:
33
+ - - ! '>='
34
+ - !ruby/object:Gem::Version
35
+ version: '3.0'
36
+ - !ruby/object:Gem::Dependency
37
+ name: hpricot
38
+ requirement: !ruby/object:Gem::Requirement
39
+ none: false
40
+ requirements:
41
+ - - ! '>='
42
+ - !ruby/object:Gem::Version
43
+ version: '0'
44
+ type: :runtime
45
+ prerelease: false
46
+ version_requirements: !ruby/object:Gem::Requirement
47
+ none: false
48
+ requirements:
49
+ - - ! '>='
50
+ - !ruby/object:Gem::Version
51
+ version: '0'
52
+ - !ruby/object:Gem::Dependency
53
+ name: rspec
54
+ requirement: !ruby/object:Gem::Requirement
55
+ none: false
56
+ requirements:
57
+ - - ! '>='
58
+ - !ruby/object:Gem::Version
59
+ version: 2.0.0
60
+ type: :development
61
+ prerelease: false
62
+ version_requirements: !ruby/object:Gem::Requirement
63
+ none: false
64
+ requirements:
65
+ - - ! '>='
66
+ - !ruby/object:Gem::Version
67
+ version: 2.0.0
68
+ description: Localized "country_select" helper with Rake task for downloading locales
69
+ from Unicode.org's CLDR
70
+ email:
71
+ - maciej@litwiniuk.net
27
72
  executables: []
28
-
29
73
  extensions: []
30
-
31
- extra_rdoc_files:
32
- - README.rdoc
33
- files:
74
+ extra_rdoc_files: []
75
+ files:
34
76
  - .gitignore
35
77
  - MIT-LICENSE
36
78
  - README.rdoc
37
79
  - Rakefile
38
- - init.rb
39
80
  - install.rb
40
81
  - lib/localized_country_select.rb
82
+ - lib/localized_country_select/railtie.rb
83
+ - lib/localized_country_select/version.rb
41
84
  - lib/tasks/localized_country_select_tasks.rake
85
+ - locale/cz.rb
42
86
  - locale/en.rb
43
- - locale/ru.rb
44
87
  - test/localized_country_select_test.rb
45
88
  - uninstall.rb
46
- has_rdoc: true
47
- homepage: http://github.com/LIMSAS/localized_country_select
89
+ homepage: https://github.com/mlitwiniuk/localized_country_select
48
90
  licenses: []
49
-
50
91
  post_install_message:
51
- rdoc_options:
52
- - --charset=UTF-8
53
- require_paths:
92
+ rdoc_options: []
93
+ require_paths:
54
94
  - lib
55
- required_ruby_version: !ruby/object:Gem::Requirement
95
+ required_ruby_version: !ruby/object:Gem::Requirement
56
96
  none: false
57
- requirements:
58
- - - ">="
59
- - !ruby/object:Gem::Version
60
- hash: 3
61
- segments:
62
- - 0
63
- version: "0"
64
- required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ! '>='
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
65
102
  none: false
66
- requirements:
67
- - - ">="
68
- - !ruby/object:Gem::Version
69
- hash: 3
70
- segments:
71
- - 0
72
- version: "0"
103
+ requirements:
104
+ - - ! '>='
105
+ - !ruby/object:Gem::Version
106
+ version: '0'
73
107
  requirements: []
74
-
75
108
  rubyforge_project:
76
- rubygems_version: 1.3.7
109
+ rubygems_version: 1.8.24
77
110
  signing_key:
78
111
  specification_version: 3
79
- summary: Localized country select list
80
- test_files:
112
+ summary: Localized "country_select" helper with Rake task for downloading locales
113
+ from Unicode.org's CLDR
114
+ test_files:
81
115
  - test/localized_country_select_test.rb
data/init.rb DELETED
@@ -1,5 +0,0 @@
1
- # Require the plugin code
2
- require 'localized_country_select'
3
-
4
- # Load locales for countries from +locale+ directory into Rails
5
- I18n.load_path += Dir[ File.join(File.dirname(__FILE__), 'locale', '*.{rb,yml}') ]
@@ -1,250 +0,0 @@
1
- { :ru => {
2
-
3
- :countries => {
4
- :AD => "Андорра",
5
- :AE => "Объединенные Арабские Эмираты",
6
- :AF => "Афганистан",
7
- :AG => "Антигуа и Барбуда",
8
- :AI => "Ангилья",
9
- :AL => "Албания",
10
- :AM => "Армения",
11
- :AN => "Нидерландские Антильские о-ва",
12
- :AO => "Ангола",
13
- :AQ => "Антарктида",
14
- :AR => "Аргентина",
15
- :AS => "Американское Самоа",
16
- :AT => "Австрия",
17
- :AU => "Австралия",
18
- :AW => "Аруба",
19
- :AX => "Аландские о-ва",
20
- :AZ => "Азербайджан",
21
- :BA => "Босния и Герцеговина",
22
- :BB => "Барбадос",
23
- :BD => "Бангладеш",
24
- :BE => "Бельгия",
25
- :BF => "Буркина Фасо",
26
- :BG => "Болгария",
27
- :BH => "Бахрейн",
28
- :BI => "Бурунди",
29
- :BJ => "Бенин",
30
- :BL => "Остров Святого Бартоломея",
31
- :BM => "Бермудские о-ва",
32
- :BN => "Бруней Даруссалам",
33
- :BO => "Боливия",
34
- :BR => "Бразилия",
35
- :BS => "Багамские о-ва",
36
- :BT => "Бутан",
37
- :BV => "Остров Буве",
38
- :BW => "Ботсвана",
39
- :BY => "Беларусь",
40
- :BZ => "Белиз",
41
- :CA => "Канада",
42
- :CC => "Кокосовые о-ва",
43
- :CD => "Демократическая Республика Конго",
44
- :CF => "Центральноафриканская Республика",
45
- :CG => "Конго",
46
- :CH => "Швейцария",
47
- :CI => "Кот д’Ивуар",
48
- :CK => "Острова Кука",
49
- :CL => "Чили",
50
- :CM => "Камерун",
51
- :CN => "Китай",
52
- :CO => "Колумбия",
53
- :CR => "Коста-Рика",
54
- :CU => "Куба",
55
- :CV => "Острова Зеленого Мыса",
56
- :CX => "Остров Рождества",
57
- :CY => "Кипр",
58
- :CZ => "Чехия",
59
- :DE => "Германия",
60
- :DJ => "Джибути",
61
- :DK => "Дания",
62
- :DM => "Доминика",
63
- :DO => "Доминиканская Республика",
64
- :DZ => "Алжир",
65
- :EC => "Эквадор",
66
- :EE => "Эстония",
67
- :EG => "Египет",
68
- :EH => "Западная Сахара",
69
- :ER => "Эритрея",
70
- :ES => "Испания",
71
- :ET => "Эфиопия",
72
- :FI => "Финляндия",
73
- :FJ => "Фиджи",
74
- :FK => "Фолклендские о-ва",
75
- :FM => "Федеративные Штаты Микронезии",
76
- :FO => "Фарерские о-ва",
77
- :FR => "Франция",
78
- :GA => "Габон",
79
- :GB => "Великобритания",
80
- :GD => "Гренада",
81
- :GE => "Грузия",
82
- :GF => "Французская Гвиана",
83
- :GG => "Гернси",
84
- :GH => "Гана",
85
- :GI => "Гибралтар",
86
- :GL => "Гренландия",
87
- :GM => "Гамбия",
88
- :GN => "Гвинея",
89
- :GP => "Гваделупа",
90
- :GQ => "Экваториальная Гвинея",
91
- :GR => "Греция",
92
- :GS => "Южная Джорджия и Южные Сандвичевы Острова",
93
- :GT => "Гватемала",
94
- :GU => "Гуам",
95
- :GW => "Гвинея-Бисау",
96
- :GY => "Гайана",
97
- :HK => "Гонконг",
98
- :HM => "Острова Херд и Макдональд",
99
- :HN => "Гондурас",
100
- :HR => "Хорватия",
101
- :HT => "Гаити",
102
- :HU => "Венгрия",
103
- :ID => "Индонезия",
104
- :IE => "Ирландия",
105
- :IL => "Израиль",
106
- :IM => "Остров Мэн",
107
- :IN => "Индия",
108
- :IQ => "Ирак",
109
- :IR => "Иран",
110
- :IS => "Исландия",
111
- :IT => "Италия",
112
- :JE => "Джерси",
113
- :JM => "Ямайка",
114
- :JO => "Иордания",
115
- :JP => "Япония",
116
- :KE => "Кения",
117
- :KG => "Киргизия",
118
- :KH => "Камбоджа",
119
- :KI => "Кирибати",
120
- :KM => "Коморские о-ва",
121
- :KN => "Сент-Киттс и Невис",
122
- :KP => "Северная Корея",
123
- :KR => "Республика Корея",
124
- :KW => "Кувейт",
125
- :KY => "Каймановы острова",
126
- :KZ => "Казахстан",
127
- :LA => "Лаос",
128
- :LB => "Ливан",
129
- :LC => "Сент-Люсия",
130
- :LI => "Лихтенштейн",
131
- :LK => "Шри-Ланка",
132
- :LR => "Либерия",
133
- :LS => "Лесото",
134
- :LT => "Литва",
135
- :LU => "Люксембург",
136
- :LV => "Латвия",
137
- :LY => "Ливия",
138
- :MA => "Марокко",
139
- :MC => "Монако",
140
- :MD => "Молдова",
141
- :ME => "Черногория",
142
- :MF => "Остров Святого Мартина",
143
- :MG => "Мадагаскар",
144
- :MH => "Маршалловы о-ва",
145
- :MK => "Македония",
146
- :ML => "Мали",
147
- :MM => "Мьянма",
148
- :MN => "Монголия",
149
- :MO => "Макао",
150
- :MP => "Северные Марианские о-ва",
151
- :MQ => "Мартиника",
152
- :MR => "Мавритания",
153
- :MS => "Монтсеррат",
154
- :MT => "Мальта",
155
- :MU => "Маврикий",
156
- :MV => "Мальдивские о-ва",
157
- :MW => "Малави",
158
- :MX => "Мексика",
159
- :MY => "Малайзия",
160
- :MZ => "Мозамбик",
161
- :NA => "Намибия",
162
- :NC => "Новая Каледония",
163
- :NE => "Нигер",
164
- :NF => "Остров Норфолк",
165
- :NG => "Нигерия",
166
- :NI => "Никарагуа",
167
- :NL => "Нидерланды",
168
- :NO => "Норвегия",
169
- :NP => "Непал",
170
- :NR => "Науру",
171
- :NU => "Ниуе",
172
- :NZ => "Новая Зеландия",
173
- :OM => "Оман",
174
- :PA => "Панама",
175
- :PE => "Перу",
176
- :PF => "Французская Полинезия",
177
- :PG => "Папуа – Новая Гвинея",
178
- :PH => "Филиппины",
179
- :PK => "Пакистан",
180
- :PL => "Польша",
181
- :PM => "Сен-Пьер и Микелон",
182
- :PN => "Питкэрн",
183
- :PR => "Пуэрто-Рико",
184
- :PS => "Палестинские территории",
185
- :PT => "Португалия",
186
- :PW => "Палау",
187
- :PY => "Парагвай",
188
- :QA => "Катар",
189
- :RE => "Реюньон",
190
- :RO => "Румыния",
191
- :RS => "Сербия",
192
- :RU => "Россия",
193
- :RW => "Руанда",
194
- :SA => "Саудовская Аравия",
195
- :SB => "Соломоновы о-ва",
196
- :SC => "Сейшельские о-ва",
197
- :SD => "Судан",
198
- :SE => "Швеция",
199
- :SG => "Сингапур",
200
- :SH => "Остров Святой Елены",
201
- :SI => "Словения",
202
- :SJ => "Свальбард и Ян-Майен",
203
- :SK => "Словакия",
204
- :SL => "Сьерра-Леоне",
205
- :SM => "Сан-Марино",
206
- :SN => "Сенегал",
207
- :SO => "Сомали",
208
- :SR => "Суринам",
209
- :ST => "Сан-Томе и Принсипи",
210
- :SV => "Сальвадор",
211
- :SY => "Сирия",
212
- :SZ => "Свазиленд",
213
- :TC => "Острова Тёркс и Кайкос",
214
- :TD => "Чад",
215
- :TF => "Французские Южные Территории",
216
- :TG => "Того",
217
- :TH => "Таиланд",
218
- :TJ => "Таджикистан",
219
- :TK => "Токелау",
220
- :TL => "Восточный Тимор",
221
- :TM => "Туркменистан",
222
- :TN => "Тунис",
223
- :TO => "Тонга",
224
- :TR => "Турция",
225
- :TT => "Тринидад и Тобаго",
226
- :TV => "Тувалу",
227
- :TW => "Тайвань",
228
- :TZ => "Танзания",
229
- :UA => "Украина",
230
- :UG => "Уганда",
231
- :US => "США",
232
- :UY => "Уругвай",
233
- :UZ => "Узбекистан",
234
- :VA => "Ватикан",
235
- :VC => "Сент-Винсент и Гренадины",
236
- :VE => "Венесуэла",
237
- :VG => "Британские Виргинские о-ва",
238
- :VI => "Виргинские о-ва (США)",
239
- :VN => "Вьетнам",
240
- :VU => "Вануату",
241
- :WS => "Самоа",
242
- :YE => "Йемен",
243
- :YT => "Майотта",
244
- :ZA => "ЮАР",
245
- :ZM => "Замбия",
246
- :ZW => "Зимбабве",
247
- }
248
-
249
- }
250
- }