i18n_country_select 1.0.17 → 1.0.18

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f78a5371b8fed10e962a95ac0b4659852ad5d8e5
4
- data.tar.gz: 82aa7386276cb89f01b6a00d6c4a569d46d5fd2c
3
+ metadata.gz: 00d7fc9362f2f2ab078a89b44443418ab8d70bdf
4
+ data.tar.gz: 140c210775c90f0b92576a237b524580cb6deaef
5
5
  SHA512:
6
- metadata.gz: fb4aca1a9644c0162a0ff101517bec239e051e947fd9d5a14714ea3650b87773db0db0c4d19af29efddd22e077b1caaf3c1d53a337af2e0695073e680bd3df33
7
- data.tar.gz: 4da6f3d14a67df2bd0959d5642f2279e6028bc667226fbfe6c61ffe064f0ef45b2ad5c1fd69b3bb004ffcdc93c8034c1f04c429bbb156ff785d2a5ad111ab9ba
6
+ metadata.gz: 9ba8ebb357eef9ca79398f518932c76e66bf5cc55083d091068f07e0f3e5f236cf5ab641b3b1df6523175c64b713b938d4e8deac42b605a03633271421df7dbe
7
+ data.tar.gz: fdbb619aaeac2148dcfb7db2bc5fbae4114b0ceb786e3d9947092cd5f83ef9c0663d24fc00a3dd00b15b6689e7bcd8994622b387be97b0f8e9534b56f76365d8
@@ -39,12 +39,13 @@ Supplying priority countries to be placed at the top of the list:
39
39
  Based on the deprecated country_code_select by: Russ Smith (russ@bashme.org) and Frank Wambutt (frank@mo-stud.io)
40
40
 
41
41
  == Version History
42
- 1.0.17 - Removing duplicate country code IE
43
- 1.0.16 - Removing unnecessary value attribute and corrected spelling error on the include_blank option tag
44
- 1.0.15 - Removing more duplicate country codes
45
- 1.0.14 - Removing duplicate country codes and adding Norway
46
- 1.0.13 - Ignore missing translations from i18n-country-translations
47
- 1.0.12 - Adds the ability to specify text to use in a blank option
42
+ * 1.0.18 - Fixed translated sorting
43
+ * 1.0.17 - Removing duplicate country code IE
44
+ * 1.0.16 - Removing unnecessary value attribute and corrected spelling error on the include_blank option tag
45
+ * 1.0.15 - Removing more duplicate country codes
46
+ * 1.0.14 - Removing duplicate country codes and adding Norway
47
+ * 1.0.13 - Ignore missing translations from i18n-country-translations
48
+ * 1.0.12 - Adds the ability to specify text to use in a blank option
48
49
 
49
50
  == License
50
51
 
@@ -1,4 +1,6 @@
1
- require "sort_alphabetical"
1
+ require 'unicode_utils/canonical_decomposition'
2
+ require 'unicode_utils/general_category'
3
+
2
4
  require "i18n-country-translations"
3
5
  require "i18n_country_select/countries"
4
6
  require "i18n_country_select/form_builder"
@@ -13,7 +13,9 @@ module I18nCountrySelect
13
13
  country_translations = country_translations = COUNTRY_CODES.map do |code|
14
14
  translation = I18n.t(code, :scope => :countries, :default => 'missing')
15
15
  translation == 'missing' ? nil : [translation, code]
16
- end.compact.sort_alphabetical_by(&:first)
16
+ end.compact.sort_by do |translation, code|
17
+ normalize_translation(translation)
18
+ end
17
19
 
18
20
  countries = ""
19
21
 
@@ -34,5 +36,12 @@ module I18nCountrySelect
34
36
 
35
37
  content_tag(:select, countries.html_safe, html_options)
36
38
  end
39
+
40
+ private
41
+ def normalize_translation(translation)
42
+ UnicodeUtils.canonical_decomposition(translation).split('').select do |c|
43
+ UnicodeUtils.general_category(c) =~ /Letter|Separator|Punctuation|Number/
44
+ end.join
45
+ end
37
46
  end
38
47
  end
@@ -1,3 +1,3 @@
1
1
  module I18nCountrySelect
2
- VERSION = "1.0.17"
2
+ VERSION = "1.0.18"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: i18n_country_select
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.17
4
+ version: 1.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian McQuay (brian@onomojo.com)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-09-05 00:00:00.000000000 Z
11
+ date: 2013-09-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: i18n
@@ -39,19 +39,19 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.0.9
41
41
  - !ruby/object:Gem::Dependency
42
- name: sort_alphabetical
42
+ name: unicode_utils
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - '>='
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.3
47
+ version: 1.0.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '>='
53
53
  - !ruby/object:Gem::Version
54
- version: 0.1.3
54
+ version: 1.0.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: rails
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
128
  version: 1.3.5
129
129
  requirements: []
130
130
  rubyforge_project: '[none]'
131
- rubygems_version: 2.0.7
131
+ rubygems_version: 2.0.6
132
132
  signing_key:
133
133
  specification_version: 4
134
134
  summary: I18n country select helper