gettext_i18n_rails 0.2.19 → 0.2.20
Sign up to get free protection for your applications and to get access to all the features.
- data/Readme.md +1 -0
- data/VERSION +1 -1
- data/gettext_i18n_rails.gemspec +3 -3
- data/lib/gettext_i18n_rails/backend.rb +10 -6
- data/spec/gettext_i18n_rails/backend_spec.rb +8 -1
- metadata +7 -7
data/Readme.md
CHANGED
@@ -209,6 +209,7 @@ lib/tasks/gettext.rake:
|
|
209
209
|
- [Anh Hai Trinh](http://blog.onideas.ws)
|
210
210
|
- [ed0h](http://github.com/ed0h)
|
211
211
|
- [Nikos Dimitrakopoulos](http://blog.nikosd.com)
|
212
|
+
- [Ben Tucker](http://btucker.net/)
|
212
213
|
|
213
214
|
[Michael Grosser](http://grosser.it)<br/>
|
214
215
|
grosser.michael@gmail.com<br/>
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.20
|
data/gettext_i18n_rails.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{gettext_i18n_rails}
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.20"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Michael Grosser"]
|
12
|
-
s.date = %q{2011-
|
12
|
+
s.date = %q{2011-06-01}
|
13
13
|
s.email = %q{grosser.michael@gmail.com}
|
14
14
|
s.files = [
|
15
15
|
"Gemfile",
|
@@ -42,7 +42,7 @@ Gem::Specification.new do |s|
|
|
42
42
|
]
|
43
43
|
s.homepage = %q{http://github.com/grosser/gettext_i18n_rails}
|
44
44
|
s.require_paths = ["lib"]
|
45
|
-
s.rubygems_version = %q{1.
|
45
|
+
s.rubygems_version = %q{1.6.2}
|
46
46
|
s.summary = %q{Simple FastGettext Rails integration.}
|
47
47
|
s.test_files = [
|
48
48
|
"spec/gettext_i18n_rails/action_controller_spec.rb",
|
@@ -46,13 +46,17 @@ module GettextI18nRails
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def interpolate(string, values)
|
49
|
-
|
50
|
-
I18n::RESERVED_KEYS
|
49
|
+
if string.respond_to?(:%)
|
50
|
+
reserved_keys = if defined?(I18n::RESERVED_KEYS) # rails 3+
|
51
|
+
I18n::RESERVED_KEYS
|
52
|
+
else
|
53
|
+
I18n::Backend::Base::RESERVED_KEYS
|
54
|
+
end
|
55
|
+
|
56
|
+
string % values.except(*reserved_keys)
|
51
57
|
else
|
52
|
-
|
58
|
+
string
|
53
59
|
end
|
54
|
-
|
55
|
-
string % values.except(*reserved_keys)
|
56
60
|
end
|
57
61
|
|
58
62
|
def flatten_key key, options
|
@@ -60,4 +64,4 @@ module GettextI18nRails
|
|
60
64
|
scope.empty? ? key.to_s : "#{scope*'.'}.#{key}"
|
61
65
|
end
|
62
66
|
end
|
63
|
-
end
|
67
|
+
end
|
@@ -43,4 +43,11 @@ describe GettextI18nRails::Backend do
|
|
43
43
|
lambda{subject.translate('xx','y',:scope=>['xy','z'])}.should raise_error(I18n::MissingTranslationData)
|
44
44
|
end
|
45
45
|
end
|
46
|
-
|
46
|
+
|
47
|
+
describe :interpolate do
|
48
|
+
it "act as an identity function for an array" do
|
49
|
+
translation = [:month, :day, :year]
|
50
|
+
subject.send(:interpolate, translation, {}).should == translation
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gettext_i18n_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 63
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 20
|
10
|
+
version: 0.2.20
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Grosser
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-06-01 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -28,10 +28,10 @@ dependencies:
|
|
28
28
|
segments:
|
29
29
|
- 0
|
30
30
|
version: "0"
|
31
|
-
type: :runtime
|
32
31
|
requirement: *id001
|
33
|
-
name: fast_gettext
|
34
32
|
prerelease: false
|
33
|
+
type: :runtime
|
34
|
+
name: fast_gettext
|
35
35
|
description:
|
36
36
|
email: grosser.michael@gmail.com
|
37
37
|
executables: []
|
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
98
98
|
requirements: []
|
99
99
|
|
100
100
|
rubyforge_project:
|
101
|
-
rubygems_version: 1.
|
101
|
+
rubygems_version: 1.6.2
|
102
102
|
signing_key:
|
103
103
|
specification_version: 3
|
104
104
|
summary: Simple FastGettext Rails integration.
|