gettext_activerecord 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +55 -0
- data/ChangeLog +4 -0
- data/README.rdoc +172 -0
- data/Rakefile +110 -0
- data/data/locale/bg/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/bs/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/ca/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/cs/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/de/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/el/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/eo/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/es/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/et/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/fr/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/hr/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/hu/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/it/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/ja/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/ko/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/lv/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/nb/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/nl/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/pt_BR/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/ru/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/sr/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/ua/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/vi/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/zh/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/data/locale/zh_TW/LC_MESSAGES/gettext_activerecord.mo +0 -0
- data/lib/gettext_activerecord/base.rb +66 -0
- data/lib/gettext_activerecord/i18n.rb +27 -0
- data/lib/gettext_activerecord/migration.rb +16 -0
- data/lib/gettext_activerecord/parser.rb +216 -0
- data/lib/gettext_activerecord/schema_definitions.rb +28 -0
- data/lib/gettext_activerecord/tools.rb +25 -0
- data/lib/gettext_activerecord/validations.rb +189 -0
- data/lib/gettext_activerecord/version.rb +12 -0
- data/lib/gettext_activerecord.rb +19 -0
- data/po/bg/gettext_activerecord.po +115 -0
- data/po/bs/gettext_activerecord.po +125 -0
- data/po/ca/gettext_activerecord.po +116 -0
- data/po/cs/gettext_activerecord.po +124 -0
- data/po/de/gettext_activerecord.po +117 -0
- data/po/el/gettext_activerecord.po +115 -0
- data/po/eo/gettext_activerecord.po +116 -0
- data/po/es/gettext_activerecord.po +116 -0
- data/po/et/gettext_activerecord.po +116 -0
- data/po/fr/gettext_activerecord.po +118 -0
- data/po/gettext_activerecord.pot +113 -0
- data/po/hr/gettext_activerecord.po +125 -0
- data/po/hu/gettext_activerecord.po +116 -0
- data/po/it/gettext_activerecord.po +122 -0
- data/po/ja/gettext_activerecord.po +116 -0
- data/po/ko/gettext_activerecord.po +123 -0
- data/po/lv/gettext_activerecord.po +116 -0
- data/po/nb/gettext_activerecord.po +117 -0
- data/po/nl/gettext_activerecord.po +123 -0
- data/po/pt_BR/gettext_activerecord.po +117 -0
- data/po/ru/gettext_activerecord.po +117 -0
- data/po/sr/gettext_activerecord.po +117 -0
- data/po/test.rb +8 -0
- data/po/ua/gettext_activerecord.po +120 -0
- data/po/vi/gettext_activerecord.po +116 -0
- data/po/zh/gettext_activerecord.po +119 -0
- data/po/zh_TW/gettext_activerecord.po +119 -0
- data/replace.rb +21 -0
- data/sample/README.rdoc +9 -0
- data/sample/Rakefile +32 -0
- data/sample/book.rb +3 -0
- data/sample/config/database.yml +3 -0
- data/sample/data/locale/ja/LC_MESSAGES/sample_ar.mo +0 -0
- data/sample/db/development.sqlite3 +0 -0
- data/sample/db/schema.rb +5 -0
- data/sample/locale/ja/LC_MESSAGES/sample_ar.mo +0 -0
- data/sample/po/ja/sample_ar.po +29 -0
- data/sample/po/sample_ar.pot +29 -0
- data/sample/sample.rb +22 -0
- data/test/Rakefile +43 -0
- data/test/db/migrate.rb +41 -0
- data/test/db/sqlite.rb +8 -0
- data/test/helper.rb +38 -0
- data/test/locale/ja/LC_MESSAGES/active_record.mo +0 -0
- data/test/models/book.rb +3 -0
- data/test/models/developer.rb +5 -0
- data/test/models/inept_wizard.rb +3 -0
- data/test/models/reply.rb +40 -0
- data/test/models/topic.rb +68 -0
- data/test/models/user.rb +3 -0
- data/test/models/wizard.rb +5 -0
- data/test/po/active_record.pot +388 -0
- data/test/po/ja/active_record.po +387 -0
- data/test/test_parser.rb +95 -0
- data/test/test_validations.rb +2575 -0
- data/test/vendor/repair_helper.rb +50 -0
- data/test.rb +2 -0
- metadata +268 -0
@@ -0,0 +1,50 @@
|
|
1
|
+
module ActiveRecord
|
2
|
+
module Testing
|
3
|
+
module RepairHelper
|
4
|
+
def self.included(base)
|
5
|
+
base.class_eval do
|
6
|
+
extend ClassMethods
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
module Toolbox
|
11
|
+
def self.record_validations(*model_classes)
|
12
|
+
model_classes.inject({}) do |repair, klass|
|
13
|
+
repair[klass] ||= {}
|
14
|
+
[:validate, :validate_on_create, :validate_on_update].each do |callback|
|
15
|
+
the_callback = klass.instance_variable_get("@#{callback.to_s}_callbacks")
|
16
|
+
repair[klass][callback] = (the_callback.nil? ? nil : the_callback.dup)
|
17
|
+
end
|
18
|
+
repair
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.reset_validations(recorded)
|
23
|
+
recorded.each do |klass, repairs|
|
24
|
+
[:validate, :validate_on_create, :validate_on_update].each do |callback|
|
25
|
+
klass.instance_variable_set("@#{callback.to_s}_callbacks", repairs[callback])
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
module ClassMethods
|
32
|
+
def repair_validations(*model_classes)
|
33
|
+
setup do
|
34
|
+
@validation_repairs = ActiveRecord::Testing::RepairHelper::Toolbox.record_validations(*model_classes)
|
35
|
+
end
|
36
|
+
teardown do
|
37
|
+
ActiveRecord::Testing::RepairHelper::Toolbox.reset_validations(@validation_repairs)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def repair_validations(*model_classes, &block)
|
43
|
+
validation_repairs = ActiveRecord::Testing::RepairHelper::Toolbox.record_validations(*model_classes)
|
44
|
+
return block.call
|
45
|
+
ensure
|
46
|
+
ActiveRecord::Testing::RepairHelper::Toolbox.reset_validations(validation_repairs)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
data/test.rb
ADDED
metadata
ADDED
@@ -0,0 +1,268 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: gettext_activerecord
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Masao Mutoh
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
|
12
|
+
date: 2009-03-22 00:00:00 +09:00
|
13
|
+
default_executable:
|
14
|
+
dependencies:
|
15
|
+
- !ruby/object:Gem::Dependency
|
16
|
+
name: gettext
|
17
|
+
type: :runtime
|
18
|
+
version_requirement:
|
19
|
+
version_requirements: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: 2.0.0
|
24
|
+
version:
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: activerecord
|
27
|
+
type: :runtime
|
28
|
+
version_requirement:
|
29
|
+
version_requirements: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 2.3.2
|
34
|
+
version:
|
35
|
+
description: Localization support for ActiveRecord by Ruby-GetText-Package.
|
36
|
+
email: mutomasa at gmail.com
|
37
|
+
executables: []
|
38
|
+
|
39
|
+
extensions: []
|
40
|
+
|
41
|
+
extra_rdoc_files: []
|
42
|
+
|
43
|
+
files:
|
44
|
+
- po
|
45
|
+
- po/test.rb
|
46
|
+
- po/es
|
47
|
+
- po/es/gettext_activerecord.po
|
48
|
+
- po/el
|
49
|
+
- po/el/gettext_activerecord.po
|
50
|
+
- po/sv
|
51
|
+
- po/cs
|
52
|
+
- po/cs/gettext_activerecord.po
|
53
|
+
- po/ko
|
54
|
+
- po/ko/gettext_activerecord.po
|
55
|
+
- po/sr
|
56
|
+
- po/sr/gettext_activerecord.po
|
57
|
+
- po/nb
|
58
|
+
- po/nb/gettext_activerecord.po
|
59
|
+
- po/zh
|
60
|
+
- po/zh/gettext_activerecord.po
|
61
|
+
- po/eo
|
62
|
+
- po/eo/gettext_activerecord.po
|
63
|
+
- po/vi
|
64
|
+
- po/vi/gettext_activerecord.po
|
65
|
+
- po/nl
|
66
|
+
- po/nl/gettext_activerecord.po
|
67
|
+
- po/fr
|
68
|
+
- po/fr/gettext_activerecord.po
|
69
|
+
- po/bg
|
70
|
+
- po/bg/gettext_activerecord.po
|
71
|
+
- po/hu
|
72
|
+
- po/hu/gettext_activerecord.po
|
73
|
+
- po/ua
|
74
|
+
- po/ua/gettext_activerecord.po
|
75
|
+
- po/hr
|
76
|
+
- po/hr/gettext_activerecord.po
|
77
|
+
- po/et
|
78
|
+
- po/et/gettext_activerecord.po
|
79
|
+
- po/lv
|
80
|
+
- po/lv/gettext_activerecord.po
|
81
|
+
- po/it
|
82
|
+
- po/it/gettext_activerecord.po
|
83
|
+
- po/pt_BR
|
84
|
+
- po/pt_BR/gettext_activerecord.po
|
85
|
+
- po/ja
|
86
|
+
- po/ja/gettext_activerecord.po
|
87
|
+
- po/zh_TW
|
88
|
+
- po/zh_TW/gettext_activerecord.po
|
89
|
+
- po/ru
|
90
|
+
- po/ru/gettext_activerecord.po
|
91
|
+
- po/bs
|
92
|
+
- po/bs/gettext_activerecord.po
|
93
|
+
- po/de
|
94
|
+
- po/de/gettext_activerecord.po
|
95
|
+
- po/gettext_activerecord.pot
|
96
|
+
- po/ca
|
97
|
+
- po/ca/gettext_activerecord.po
|
98
|
+
- test.rb
|
99
|
+
- replace.rb
|
100
|
+
- ChangeLog
|
101
|
+
- COPYING
|
102
|
+
- lib
|
103
|
+
- lib/gettext_activerecord
|
104
|
+
- lib/gettext_activerecord/tools.rb
|
105
|
+
- lib/gettext_activerecord/base.rb
|
106
|
+
- lib/gettext_activerecord/version.rb
|
107
|
+
- lib/gettext_activerecord/migration.rb
|
108
|
+
- lib/gettext_activerecord/parser.rb
|
109
|
+
- lib/gettext_activerecord/schema_definitions.rb
|
110
|
+
- lib/gettext_activerecord/validations.rb
|
111
|
+
- lib/gettext_activerecord/i18n.rb
|
112
|
+
- lib/gettext_activerecord.rb
|
113
|
+
- README.rdoc
|
114
|
+
- test
|
115
|
+
- test/test_parser.rb
|
116
|
+
- test/po
|
117
|
+
- test/po/ja
|
118
|
+
- test/po/ja/active_record.po
|
119
|
+
- test/po/active_record.pot
|
120
|
+
- test/helper.rb
|
121
|
+
- test/locale
|
122
|
+
- test/locale/ja
|
123
|
+
- test/locale/ja/LC_MESSAGES
|
124
|
+
- test/locale/ja/LC_MESSAGES/active_record.mo
|
125
|
+
- test/test_validations.rb
|
126
|
+
- test/db
|
127
|
+
- test/db/sqlite.rb
|
128
|
+
- test/db/migrate.rb
|
129
|
+
- test/models
|
130
|
+
- test/models/user.rb
|
131
|
+
- test/models/topic.rb
|
132
|
+
- test/models/book.rb
|
133
|
+
- test/models/wizard.rb
|
134
|
+
- test/models/inept_wizard.rb
|
135
|
+
- test/models/reply.rb
|
136
|
+
- test/models/developer.rb
|
137
|
+
- test/vendor
|
138
|
+
- test/vendor/repair_helper.rb
|
139
|
+
- test/Rakefile
|
140
|
+
- sample
|
141
|
+
- sample/po
|
142
|
+
- sample/po/sample_ar.pot
|
143
|
+
- sample/po/ja
|
144
|
+
- sample/po/ja/sample_ar.po
|
145
|
+
- sample/book.rb
|
146
|
+
- sample/sample.rb
|
147
|
+
- sample/locale
|
148
|
+
- sample/locale/ja
|
149
|
+
- sample/locale/ja/LC_MESSAGES
|
150
|
+
- sample/locale/ja/LC_MESSAGES/sample_ar.mo
|
151
|
+
- sample/db
|
152
|
+
- sample/db/schema.rb
|
153
|
+
- sample/db/development.sqlite3
|
154
|
+
- sample/README.rdoc
|
155
|
+
- sample/config
|
156
|
+
- sample/config/database.yml
|
157
|
+
- sample/data
|
158
|
+
- sample/data/locale
|
159
|
+
- sample/data/locale/ja
|
160
|
+
- sample/data/locale/ja/LC_MESSAGES
|
161
|
+
- sample/data/locale/ja/LC_MESSAGES/sample_ar.mo
|
162
|
+
- sample/Rakefile
|
163
|
+
- data
|
164
|
+
- data/locale
|
165
|
+
- data/locale/es
|
166
|
+
- data/locale/es/LC_MESSAGES
|
167
|
+
- data/locale/es/LC_MESSAGES/gettext_activerecord.mo
|
168
|
+
- data/locale/el
|
169
|
+
- data/locale/el/LC_MESSAGES
|
170
|
+
- data/locale/el/LC_MESSAGES/gettext_activerecord.mo
|
171
|
+
- data/locale/cs
|
172
|
+
- data/locale/cs/LC_MESSAGES
|
173
|
+
- data/locale/cs/LC_MESSAGES/gettext_activerecord.mo
|
174
|
+
- data/locale/ko
|
175
|
+
- data/locale/ko/LC_MESSAGES
|
176
|
+
- data/locale/ko/LC_MESSAGES/gettext_activerecord.mo
|
177
|
+
- data/locale/sr
|
178
|
+
- data/locale/sr/LC_MESSAGES
|
179
|
+
- data/locale/sr/LC_MESSAGES/gettext_activerecord.mo
|
180
|
+
- data/locale/nb
|
181
|
+
- data/locale/nb/LC_MESSAGES
|
182
|
+
- data/locale/nb/LC_MESSAGES/gettext_activerecord.mo
|
183
|
+
- data/locale/zh
|
184
|
+
- data/locale/zh/LC_MESSAGES
|
185
|
+
- data/locale/zh/LC_MESSAGES/gettext_activerecord.mo
|
186
|
+
- data/locale/eo
|
187
|
+
- data/locale/eo/LC_MESSAGES
|
188
|
+
- data/locale/eo/LC_MESSAGES/gettext_activerecord.mo
|
189
|
+
- data/locale/vi
|
190
|
+
- data/locale/vi/LC_MESSAGES
|
191
|
+
- data/locale/vi/LC_MESSAGES/gettext_activerecord.mo
|
192
|
+
- data/locale/nl
|
193
|
+
- data/locale/nl/LC_MESSAGES
|
194
|
+
- data/locale/nl/LC_MESSAGES/gettext_activerecord.mo
|
195
|
+
- data/locale/fr
|
196
|
+
- data/locale/fr/LC_MESSAGES
|
197
|
+
- data/locale/fr/LC_MESSAGES/gettext_activerecord.mo
|
198
|
+
- data/locale/bg
|
199
|
+
- data/locale/bg/LC_MESSAGES
|
200
|
+
- data/locale/bg/LC_MESSAGES/gettext_activerecord.mo
|
201
|
+
- data/locale/hu
|
202
|
+
- data/locale/hu/LC_MESSAGES
|
203
|
+
- data/locale/hu/LC_MESSAGES/gettext_activerecord.mo
|
204
|
+
- data/locale/ua
|
205
|
+
- data/locale/ua/LC_MESSAGES
|
206
|
+
- data/locale/ua/LC_MESSAGES/gettext_activerecord.mo
|
207
|
+
- data/locale/hr
|
208
|
+
- data/locale/hr/LC_MESSAGES
|
209
|
+
- data/locale/hr/LC_MESSAGES/gettext_activerecord.mo
|
210
|
+
- data/locale/et
|
211
|
+
- data/locale/et/LC_MESSAGES
|
212
|
+
- data/locale/et/LC_MESSAGES/gettext_activerecord.mo
|
213
|
+
- data/locale/lv
|
214
|
+
- data/locale/lv/LC_MESSAGES
|
215
|
+
- data/locale/lv/LC_MESSAGES/gettext_activerecord.mo
|
216
|
+
- data/locale/it
|
217
|
+
- data/locale/it/LC_MESSAGES
|
218
|
+
- data/locale/it/LC_MESSAGES/gettext_activerecord.mo
|
219
|
+
- data/locale/pt_BR
|
220
|
+
- data/locale/pt_BR/LC_MESSAGES
|
221
|
+
- data/locale/pt_BR/LC_MESSAGES/gettext_activerecord.mo
|
222
|
+
- data/locale/ja
|
223
|
+
- data/locale/ja/LC_MESSAGES
|
224
|
+
- data/locale/ja/LC_MESSAGES/gettext_activerecord.mo
|
225
|
+
- data/locale/zh_TW
|
226
|
+
- data/locale/zh_TW/LC_MESSAGES
|
227
|
+
- data/locale/zh_TW/LC_MESSAGES/gettext_activerecord.mo
|
228
|
+
- data/locale/ru
|
229
|
+
- data/locale/ru/LC_MESSAGES
|
230
|
+
- data/locale/ru/LC_MESSAGES/gettext_activerecord.mo
|
231
|
+
- data/locale/bs
|
232
|
+
- data/locale/bs/LC_MESSAGES
|
233
|
+
- data/locale/bs/LC_MESSAGES/gettext_activerecord.mo
|
234
|
+
- data/locale/de
|
235
|
+
- data/locale/de/LC_MESSAGES
|
236
|
+
- data/locale/de/LC_MESSAGES/gettext_activerecord.mo
|
237
|
+
- data/locale/ca
|
238
|
+
- data/locale/ca/LC_MESSAGES
|
239
|
+
- data/locale/ca/LC_MESSAGES/gettext_activerecord.mo
|
240
|
+
- Rakefile
|
241
|
+
has_rdoc: true
|
242
|
+
homepage: http://gettext.rubyforge.org/
|
243
|
+
post_install_message:
|
244
|
+
rdoc_options: []
|
245
|
+
|
246
|
+
require_paths:
|
247
|
+
- lib
|
248
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
249
|
+
requirements:
|
250
|
+
- - ">="
|
251
|
+
- !ruby/object:Gem::Version
|
252
|
+
version: "0"
|
253
|
+
version:
|
254
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
255
|
+
requirements:
|
256
|
+
- - ">="
|
257
|
+
- !ruby/object:Gem::Version
|
258
|
+
version: "0"
|
259
|
+
version:
|
260
|
+
requirements: []
|
261
|
+
|
262
|
+
rubyforge_project: gettext
|
263
|
+
rubygems_version: 1.3.1
|
264
|
+
signing_key:
|
265
|
+
specification_version: 2
|
266
|
+
summary: Localization support for ActiveRecord by Ruby-GetText-Package.
|
267
|
+
test_files: []
|
268
|
+
|