r18n-rails-api 1.1.10 → 1.1.11
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.
- checksums.yaml +4 -4
- data/lib/r18n-rails-api/backend.rb +3 -0
- data/spec/backend_spec.rb +3 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95934fcd7dab04c55e3a3e26e77a222a743389d9
|
4
|
+
data.tar.gz: 22cbe765710c61b1ffbdadae27f482f0d7c66ca9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ee1b04b3fc3a3e17e0aadaf8738d028db8337a37818a4f658ce94addddc4c854176944f72a4a78822e5524e275a0562ebaa85a6722ab72d0d74d19443ea0812
|
7
|
+
data.tar.gz: 6b84c05d65282b0f5932fdefba6cd3a06ec0010137a7c59a75cb2bbabf2738318a9cd4371d9a2ba30ae51a851a2883125aa83e9b06a69652674aaeec3e1a3c13
|
@@ -53,6 +53,9 @@ module R18n
|
|
53
53
|
if entry.is_a? Symbol
|
54
54
|
value = lookup(locale, scope, entry, separator, params)
|
55
55
|
return value unless value.is_a? Untranslated
|
56
|
+
elsif entry.is_a? Proc
|
57
|
+
proc_key = options.delete(:object) || key
|
58
|
+
return entry.call(proc_key, options)
|
56
59
|
else
|
57
60
|
return entry
|
58
61
|
end
|
data/spec/backend_spec.rb
CHANGED
@@ -48,9 +48,10 @@ describe R18n::Backend do
|
|
48
48
|
end
|
49
49
|
|
50
50
|
it "uses default value" do
|
51
|
-
I18n.t(:missed, :default => 'Default').should
|
52
|
-
I18n.t(:missed, :default => :default, :scope => :in).should
|
51
|
+
I18n.t(:missed, :default => 'Default').should == 'Default'
|
52
|
+
I18n.t(:missed, :default => :default, :scope => :in).should == 'Default'
|
53
53
|
I18n.t(:missed, :default => [:also_no, :'in.default']).should == 'Default'
|
54
|
+
I18n.t(:missed, :default => proc { |key| key.to_s }).should == 'missed'
|
54
55
|
end
|
55
56
|
|
56
57
|
it "raises error on no translation" do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: r18n-rails-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Sitnik
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: r18n-core
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.1.
|
19
|
+
version: 1.1.11
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.1.
|
26
|
+
version: 1.1.11
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: i18n
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|