i18n-inflector-rails 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/.gemtest +0 -0
- data/ChangeLog +12 -0
- data/Rakefile +4 -4
- data/docs/HISTORY +6 -0
- data/i18n-inflector-rails.gemspec +3 -2
- data/lib/i18n-inflector-rails.rb +4 -1
- data/lib/i18n-inflector-rails/inflector.rb +8 -3
- data/lib/i18n-inflector-rails/version.rb +1 -1
- data/spec/inflector_spec.rb +6 -1
- metadata +10 -48
- metadata.gz.sig +2 -4
data.tar.gz.sig
CHANGED
Binary file
|
data/.gemtest
ADDED
File without changes
|
data/ChangeLog
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
commit 1360542f0cf6d3cbce6577a62330697ffb8e4dca
|
2
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
3
|
+
Date: Wed Feb 23 01:12:13 2011 +0100
|
4
|
+
|
5
|
+
Release 1.0.2
|
6
|
+
|
7
|
+
commit 9ea4414d555a719cabb3521f0da66652ec3ee782
|
8
|
+
Author: Paweł Wilk <siefca@gnu.org>
|
9
|
+
Date: Wed Feb 23 01:08:44 2011 +0100
|
10
|
+
|
11
|
+
Applied workaround for Ruby 1.8.x bug #734 in t() alias
|
12
|
+
|
1
13
|
commit 696d8f4ef50ae54fd0017a96a3750af56ce2cb56
|
2
14
|
Author: Paweł Wilk <siefca@gnu.org>
|
3
15
|
Date: Tue Feb 15 14:50:13 2011 +0100
|
data/Rakefile
CHANGED
@@ -41,12 +41,12 @@ Hoe.spec 'i18n-inflector-rails' do
|
|
41
41
|
self.readme_file = 'README.rdoc'
|
42
42
|
self.history_file = 'docs/HISTORY'
|
43
43
|
|
44
|
-
extra_deps << ['i18n-inflector', '~> 2.
|
44
|
+
extra_deps << ['i18n-inflector', '~> 2.4'] <<
|
45
45
|
['railties', '~> 3.0'] <<
|
46
46
|
['actionpack', '~> 3.0']
|
47
|
-
extra_dev_deps << ['rspec', '>= 2.3.0']
|
48
|
-
['yard', '>= 0.6.4']
|
49
|
-
['bundler', '>= 1.0.
|
47
|
+
extra_dev_deps << ['rspec', '>= 2.3.0'] <<
|
48
|
+
['yard', '>= 0.6.4'] <<
|
49
|
+
['bundler', '>= 1.0.10'] <<
|
50
50
|
['hoe-bundler', '>= 1.0.0']
|
51
51
|
|
52
52
|
unless extra_dev_deps.flatten.include?('hoe-yard')
|
data/docs/HISTORY
CHANGED
@@ -22,14 +22,15 @@ Gem::Specification.new do |s|
|
|
22
22
|
s.platform = Gem::Platform::RUBY
|
23
23
|
s.require_path = 'lib'
|
24
24
|
s.rubyforge_project = '[none]'
|
25
|
-
s.required_rubygems_version = '>= 1.
|
25
|
+
s.required_rubygems_version = '>= 1.4.0'
|
26
26
|
s.specification_version = 3
|
27
27
|
|
28
|
-
s.add_dependency 'i18n-inflector', '~> 2.
|
28
|
+
s.add_dependency 'i18n-inflector', '~> 2.4'
|
29
29
|
s.add_dependency 'railties', '~> 3.0'
|
30
30
|
s.add_dependency 'actionpack', '~> 3.0'
|
31
31
|
s.add_development_dependency 'rspec', '>= 2.3.0'
|
32
32
|
s.add_development_dependency 'yard', '>= 1.0.7'
|
33
|
+
s.add_development_dependency 'bundler', '>= 1.0.10'
|
33
34
|
s.add_development_dependency 'hoe-bundler', '>= 1.0.0'
|
34
35
|
s.add_development_dependency 'hoe-yard', '>= 0.1.2'
|
35
36
|
end
|
data/lib/i18n-inflector-rails.rb
CHANGED
@@ -12,7 +12,10 @@ if defined? Rails::Engine
|
|
12
12
|
|
13
13
|
else
|
14
14
|
|
15
|
-
|
15
|
+
if not defined? ActionController::Base
|
16
|
+
require 'active_support/core_ext/module/deprecation' # workaround for Rails missing require
|
17
|
+
require 'action_controller'
|
18
|
+
end
|
16
19
|
require 'action_view' if not defined? ActionView::Base
|
17
20
|
|
18
21
|
ActionController::Base.send(:extend, I18n::Inflector::Rails::ClassMethods)
|
@@ -313,16 +313,21 @@ module I18n
|
|
313
313
|
# collect inflection variables that are present in this context
|
314
314
|
subopts = t_prepare_inflection_options(inflector, locale, options)
|
315
315
|
|
316
|
-
# jump to
|
316
|
+
# jump to translate if no inflection options are present
|
317
317
|
return super if subopts.empty?
|
318
318
|
|
319
|
-
# pass options
|
319
|
+
# pass options and call translate
|
320
320
|
args.pop if opts_present
|
321
321
|
args.push subopts.merge(options)
|
322
322
|
super
|
323
323
|
end
|
324
324
|
|
325
|
-
|
325
|
+
# workaround for Ruby 1.8.x bug
|
326
|
+
if RUBY_VERSION.gsub(/\D/,'')[0..1].to_i < 19
|
327
|
+
def t(*args); translate(*args) end
|
328
|
+
else
|
329
|
+
alias_method :t, :translate
|
330
|
+
end
|
326
331
|
|
327
332
|
protected
|
328
333
|
|
data/spec/inflector_spec.rb
CHANGED
@@ -57,6 +57,7 @@ describe ApplicationController do
|
|
57
57
|
:it => 'It'},
|
58
58
|
} })
|
59
59
|
|
60
|
+
I18n.backend.store_translations(:ns, 'welcome' => 'Dear @{f:Lady|m:Sir|n:You|All}!')
|
60
61
|
I18n.backend.store_translations(:xx, 'welcome' => 'Dear @{f:Lady|m:Sir|n:You|All}!')
|
61
62
|
I18n.backend.store_translations(:xx, 'welcome_strict' => 'Dear @gender{f:Lady|m:Sir|d:Dude|n:You|All}!')
|
62
63
|
I18n.backend.store_translations(:xx, 'to_be' => 'Oh @{i:I am|you:You are|it:It is}')
|
@@ -210,7 +211,7 @@ describe ApplicationController do
|
|
210
211
|
before do
|
211
212
|
|
212
213
|
class InflectedTranslateController
|
213
|
-
def trn(*args);
|
214
|
+
def trn(*args); t(*args) end
|
214
215
|
def t_male; t('welcome') end
|
215
216
|
def users_gender; :m end
|
216
217
|
def time
|
@@ -314,6 +315,10 @@ describe ApplicationController do
|
|
314
315
|
@strict_over_controller.trn('welcome', :inflector_lazy_methods => false).should == 'Dear Lady!'
|
315
316
|
end
|
316
317
|
|
318
|
+
it "should omit pattern interpolation when locale is not inflected" do
|
319
|
+
@strict_over_controller.trn('welcome', :locale => :ns).should == 'Dear!'
|
320
|
+
end
|
321
|
+
|
317
322
|
end
|
318
323
|
|
319
324
|
describe "#t" do
|
metadata
CHANGED
@@ -1,12 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n-inflector-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
prerelease:
|
5
|
-
|
6
|
-
- 1
|
7
|
-
- 0
|
8
|
-
- 1
|
9
|
-
version: 1.0.1
|
4
|
+
prerelease:
|
5
|
+
version: 1.0.2
|
10
6
|
platform: ruby
|
11
7
|
authors:
|
12
8
|
- "Pawe\xC5\x82 Wilk"
|
@@ -34,7 +30,7 @@ cert_chain:
|
|
34
30
|
NK3TIZaPCh1S2/ES6wXNvjQ+5EnEEL9j/pSEop9DYEBPaM2WDVR5i0jJTAaRWw==
|
35
31
|
-----END CERTIFICATE-----
|
36
32
|
|
37
|
-
date: 2011-02-
|
33
|
+
date: 2011-02-23 00:00:00 +01:00
|
38
34
|
default_executable:
|
39
35
|
dependencies:
|
40
36
|
- !ruby/object:Gem::Dependency
|
@@ -44,10 +40,7 @@ dependencies:
|
|
44
40
|
requirements:
|
45
41
|
- - ~>
|
46
42
|
- !ruby/object:Gem::Version
|
47
|
-
|
48
|
-
- 2
|
49
|
-
- 3
|
50
|
-
version: "2.3"
|
43
|
+
version: "2.4"
|
51
44
|
type: :runtime
|
52
45
|
prerelease: false
|
53
46
|
version_requirements: *id001
|
@@ -58,9 +51,6 @@ dependencies:
|
|
58
51
|
requirements:
|
59
52
|
- - ~>
|
60
53
|
- !ruby/object:Gem::Version
|
61
|
-
segments:
|
62
|
-
- 3
|
63
|
-
- 0
|
64
54
|
version: "3.0"
|
65
55
|
type: :runtime
|
66
56
|
prerelease: false
|
@@ -72,9 +62,6 @@ dependencies:
|
|
72
62
|
requirements:
|
73
63
|
- - ~>
|
74
64
|
- !ruby/object:Gem::Version
|
75
|
-
segments:
|
76
|
-
- 3
|
77
|
-
- 0
|
78
65
|
version: "3.0"
|
79
66
|
type: :runtime
|
80
67
|
prerelease: false
|
@@ -86,10 +73,6 @@ dependencies:
|
|
86
73
|
requirements:
|
87
74
|
- - ">="
|
88
75
|
- !ruby/object:Gem::Version
|
89
|
-
segments:
|
90
|
-
- 0
|
91
|
-
- 1
|
92
|
-
- 2
|
93
76
|
version: 0.1.2
|
94
77
|
type: :development
|
95
78
|
prerelease: false
|
@@ -101,10 +84,6 @@ dependencies:
|
|
101
84
|
requirements:
|
102
85
|
- - ">="
|
103
86
|
- !ruby/object:Gem::Version
|
104
|
-
segments:
|
105
|
-
- 2
|
106
|
-
- 3
|
107
|
-
- 0
|
108
87
|
version: 2.3.0
|
109
88
|
type: :development
|
110
89
|
prerelease: false
|
@@ -116,10 +95,6 @@ dependencies:
|
|
116
95
|
requirements:
|
117
96
|
- - ">="
|
118
97
|
- !ruby/object:Gem::Version
|
119
|
-
segments:
|
120
|
-
- 0
|
121
|
-
- 6
|
122
|
-
- 4
|
123
98
|
version: 0.6.4
|
124
99
|
type: :development
|
125
100
|
prerelease: false
|
@@ -131,11 +106,7 @@ dependencies:
|
|
131
106
|
requirements:
|
132
107
|
- - ">="
|
133
108
|
- !ruby/object:Gem::Version
|
134
|
-
|
135
|
-
- 1
|
136
|
-
- 0
|
137
|
-
- 7
|
138
|
-
version: 1.0.7
|
109
|
+
version: 1.0.10
|
139
110
|
type: :development
|
140
111
|
prerelease: false
|
141
112
|
version_requirements: *id007
|
@@ -146,10 +117,6 @@ dependencies:
|
|
146
117
|
requirements:
|
147
118
|
- - ">="
|
148
119
|
- !ruby/object:Gem::Version
|
149
|
-
segments:
|
150
|
-
- 1
|
151
|
-
- 0
|
152
|
-
- 0
|
153
120
|
version: 1.0.0
|
154
121
|
type: :development
|
155
122
|
prerelease: false
|
@@ -161,11 +128,7 @@ dependencies:
|
|
161
128
|
requirements:
|
162
129
|
- - ">="
|
163
130
|
- !ruby/object:Gem::Version
|
164
|
-
|
165
|
-
- 2
|
166
|
-
- 8
|
167
|
-
- 0
|
168
|
-
version: 2.8.0
|
131
|
+
version: 2.9.1
|
169
132
|
type: :development
|
170
133
|
prerelease: false
|
171
134
|
version_requirements: *id009
|
@@ -203,7 +166,8 @@ files:
|
|
203
166
|
- lib/i18n-inflector-rails/version.rb
|
204
167
|
- spec/inflector_spec.rb
|
205
168
|
- spec/spec_helper.rb
|
206
|
-
|
169
|
+
- .gemtest
|
170
|
+
has_rdoc: true
|
207
171
|
homepage: https://rubygems.org/gems/i18n-inflector-rails/
|
208
172
|
licenses: []
|
209
173
|
|
@@ -219,7 +183,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
219
183
|
requirements:
|
220
184
|
- - ">="
|
221
185
|
- !ruby/object:Gem::Version
|
222
|
-
hash:
|
186
|
+
hash: 1894167685465804087
|
223
187
|
segments:
|
224
188
|
- 0
|
225
189
|
version: "0"
|
@@ -228,13 +192,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
228
192
|
requirements:
|
229
193
|
- - ">="
|
230
194
|
- !ruby/object:Gem::Version
|
231
|
-
segments:
|
232
|
-
- 0
|
233
195
|
version: "0"
|
234
196
|
requirements: []
|
235
197
|
|
236
198
|
rubyforge_project: i18n-inflector-rails
|
237
|
-
rubygems_version: 1.
|
199
|
+
rubygems_version: 1.5.2
|
238
200
|
signing_key:
|
239
201
|
specification_version: 3
|
240
202
|
summary: I18n Inflector bindings for Rails
|
metadata.gz.sig
CHANGED
@@ -1,4 +1,2 @@
|
|
1
|
-
|
2
|
-
�I
|
3
|
-
��pY.�C 3G�����d�u��=M����d���.��p]#x8��d�l
|
4
|
-
�O�\�+{�
|
1
|
+
�H�˚5L>ss�Y�$��ɏg�5���0Tl|bZ>��c\݁��������j��Y�)@��Vf�H�*��-ZOq��23�=֛��!6yͥ@�A�q+�!خ��R&�ڮ 7�ڕڊm�Je[�b���@D
|
2
|
+
Ҹ��u��yh�d���r���r����� �y)q�0�j��];��ޒh��4J��W�#���I[���$2��ؗ�����[u��۰X�5ۆIkpa��U4I��sM�Uu<JL�J�i)�
|