i18n 0.6.3 → 0.6.4

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of i18n might be problematic. Click here for more details.

@@ -1,6 +1,4 @@
1
1
  # encoding: utf-8
2
- require 'i18n/core_ext/string/encoding'
3
-
4
2
  module I18n
5
3
  module Backend
6
4
  module Transliterator
@@ -91,11 +89,9 @@ module I18n
91
89
 
92
90
  # Add transliteration rules to the approximations hash.
93
91
  def add(hash)
94
- hash.keys.each do |key|
95
- utf8_key = key.to_s.dup.force_encoding('UTF-8')
96
- hash[utf8_key] = hash.delete(key).to_s
92
+ hash.each do |key, value|
93
+ approximations[key.to_s] = value.to_s
97
94
  end
98
- approximations.merge! hash
99
95
  end
100
96
  end
101
97
  end
@@ -66,7 +66,7 @@ module I18n
66
66
  assert_equal 'こんにちは、ゆきひろさん!', interpolate(:default => 'こんにちは、%{name}さん!', :name => 'ゆきひろ')
67
67
  end
68
68
 
69
- if Kernel.const_defined?(:Encoding)
69
+ if Object.const_defined?(:Encoding)
70
70
  test "interpolation: given a euc-jp translation and a utf-8 value it raises Encoding::CompatibilityError" do
71
71
  assert_raise(Encoding::CompatibilityError) do
72
72
  interpolate(:default => euc_jp('こんにちは、%{name}さん!'), :name => 'ゆきひろ')
@@ -1,3 +1,3 @@
1
1
  module I18n
2
- VERSION = "0.6.3"
2
+ VERSION = "0.6.4"
3
3
  end
@@ -1,12 +1,11 @@
1
1
  # encoding: utf-8
2
2
  require 'test_helper'
3
- require 'i18n/core_ext/string/encoding'
4
3
 
5
4
  class I18nBackendTransliterator < Test::Unit::TestCase
6
5
  def setup
7
6
  I18n.backend = I18n::Backend::Simple.new
8
7
  @proc = lambda { |n| n.upcase }
9
- @hash = { :"ü" => "ue", :"ö" => "oe" }
8
+ @hash = { "ü" => "ue", "ö" => "oe", "a" => "a" }
10
9
  @transliterator = I18n::Backend::Transliterator.get
11
10
  end
12
11
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: i18n
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.6.3
5
+ version: 0.6.4
6
6
  platform: ruby
7
7
  authors:
8
8
  - Sven Fuchs
@@ -109,7 +109,6 @@ files:
109
109
  - lib/i18n/config.rb
110
110
  - lib/i18n/core_ext/hash.rb
111
111
  - lib/i18n/core_ext/kernel/surpress_warnings.rb
112
- - lib/i18n/core_ext/string/encoding.rb
113
112
  - lib/i18n/core_ext/string/interpolate.rb
114
113
  - lib/i18n/exceptions.rb
115
114
  - lib/i18n/gettext/helpers.rb
@@ -1,10 +0,0 @@
1
- # Makes String#force_encoding working with ruby 1.8.7
2
- unless defined?(Encoding)
3
- require 'iconv'
4
-
5
- class String
6
- def force_encoding(encoding)
7
- ::Iconv.conv('UTF-8//IGNORE', encoding.upcase, self)
8
- end
9
- end
10
- end