r18n-rails-api 0.4.1 → 0.4.2

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.
@@ -81,11 +81,11 @@ module R18n
81
81
  if value.empty?
82
82
  value
83
83
  elsif value.keys.inject(true) { |a, i| a and PLURAL_KEYS.include? i }
84
- R18n::Typed.new('pl', Hash[value.map { |k, v|
84
+ R18n::Typed.new('pl', R18n::Utils.hash_map(value) { |k, v|
85
85
  [PLURAL_KEYS[k], transform(v)]
86
- }])
86
+ })
87
87
  else
88
- Hash[value.map { |k, v| [k.to_s, transform(v)] }]
88
+ R18n::Utils.hash_map(value) { |k, v| [k.to_s, transform(v)] }
89
89
  end
90
90
  elsif value.is_a? ::YAML::PrivateType
91
91
  Typed.new(value.type_id, value.value)
data/spec/backend_spec.rb CHANGED
@@ -47,16 +47,16 @@ describe R18n::Backend do
47
47
  end
48
48
 
49
49
  it "should use default value" do
50
- I18n.t(:no, :default => 'Default').should == 'Default'
51
- I18n.t(:no, :default => :default, :scope => :in).should == 'Default'
52
- I18n.t(:no, :default => [:also_no, :'in.default']).should == 'Default'
50
+ I18n.t(:missed, :default => 'Default').should == 'Default'
51
+ I18n.t(:missed, :default => :default, :scope => :in).should == 'Default'
52
+ I18n.t(:missed, :default => [:also_no, :'in.default']).should == 'Default'
53
53
  end
54
54
 
55
55
  it "should raise error on no translation" do
56
56
  lambda {
57
- I18n.backend.translate(:en, :no)
57
+ I18n.backend.translate(:en, :missed)
58
58
  }.should raise_error(::I18n::MissingTranslationData)
59
- I18n.t(:no).should == 'translation missing: en, no'
59
+ I18n.t(:missed).should == 'translation missing: en, missed'
60
60
  end
61
61
 
62
62
  it "should reload translations" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r18n-rails-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrey "A.I." Sitnik
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-11 00:00:00 +03:00
12
+ date: 2010-02-19 00:00:00 +03:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -20,7 +20,7 @@ dependencies:
20
20
  requirements:
21
21
  - - "="
22
22
  - !ruby/object:Gem::Version
23
- version: 0.4.1
23
+ version: 0.4.2
24
24
  version:
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: i18n