i18n 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.
|
95
|
-
|
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
|
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 => 'ゆきひろ')
|
data/lib/i18n/version.rb
CHANGED
@@ -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 = {
|
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.
|
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
|