gettext_simple_rails 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gettext_simple_rails/translators/globalize_translator.rb +15 -7
- data/lib/gettext_simple_rails/version.rb +1 -1
- data/spec/dummy/log/test.log +17 -0
- metadata +117 -117
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7d4be0d0534b4a7a70ddca219372da837ab026fb
|
4
|
+
data.tar.gz: efd0ed1bb47482868b5d519509bb97608d43bef1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0c38d4c00a24e9153eced1556abbb8b48d6e5707cf3d391f8c896eb34acde02d200cf6b428201bebe6752851b85296d8aad7bdc8b502ddf77da188d15884756
|
7
|
+
data.tar.gz: 43c029501fc3ca0bd3d68a7acc282bccad2177a365729822deaea7fd32d602b503e11beac0f666dbea0c0ea5c12c6f5752851e539303979a10ee0168c2decc7b
|
@@ -2,7 +2,7 @@ class GettextSimpleRails::Translators::GlobalizeTranslator
|
|
2
2
|
def detected?
|
3
3
|
return ::Kernel.const_defined?("Globalize")
|
4
4
|
end
|
5
|
-
|
5
|
+
|
6
6
|
def translations
|
7
7
|
@translations_hash = {
|
8
8
|
"activerecord" => {
|
@@ -10,23 +10,31 @@ class GettextSimpleRails::Translators::GlobalizeTranslator
|
|
10
10
|
}
|
11
11
|
}
|
12
12
|
attributes = @translations_hash["activerecord"]["attributes"]
|
13
|
-
|
13
|
+
|
14
14
|
GettextSimpleRails::ModelInspector.model_classes do |inspector|
|
15
15
|
next unless inspector.clazz.respond_to?(:globalize_migrator)
|
16
|
-
|
16
|
+
|
17
17
|
class_lower_name = StringCases.camel_to_snake(inspector.clazz.name)
|
18
18
|
translate_class_name = "#{inspector.clazz.name}::Translation"
|
19
19
|
translate_class = translate_class_name.constantize
|
20
|
-
|
20
|
+
|
21
21
|
id_column_name = "#{class_lower_name}_id"
|
22
|
-
|
23
|
-
|
22
|
+
|
23
|
+
begin
|
24
|
+
column_names = translate_class.column_names
|
25
|
+
rescue ActiveRecord::StatementInvalid
|
26
|
+
puts "GettextSimpleRails: Translator class could not be found: '#{translate_class_name}' - skipping translations for this class."
|
27
|
+
next
|
28
|
+
end
|
29
|
+
|
30
|
+
translate_columns = column_names - ["id", "locale", "created_at", "updated_at", id_column_name]
|
31
|
+
|
24
32
|
translate_columns.each do |column_name|
|
25
33
|
attributes[class_lower_name] = {} unless attributes.key?(class_lower_name)
|
26
34
|
attributes[class_lower_name][column_name] = column_name
|
27
35
|
end
|
28
36
|
end
|
29
|
-
|
37
|
+
|
30
38
|
return @translations_hash
|
31
39
|
end
|
32
40
|
end
|
data/spec/dummy/log/test.log
CHANGED
@@ -1026,3 +1026,20 @@ Migrating to CreateUserTranslations (20140515092420)
|
|
1026
1026
|
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1027
1027
|
[1m[35m (0.0ms)[0m begin transaction
|
1028
1028
|
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1029
|
+
[1m[36mActiveRecord::SchemaMigration Load (0.1ms)[0m [1mSELECT "schema_migrations".* FROM "schema_migrations"[0m
|
1030
|
+
[1m[35m (0.1ms)[0m begin transaction
|
1031
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1032
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1033
|
+
[1m[36m (0.0ms)[0m [1mrollback transaction[0m
|
1034
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1035
|
+
[1m[36m (0.3ms)[0m [1mrollback transaction[0m
|
1036
|
+
[1m[35m (0.2ms)[0m begin transaction
|
1037
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1038
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1039
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1040
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1041
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1042
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1043
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
1044
|
+
[1m[35m (0.0ms)[0m begin transaction
|
1045
|
+
[1m[36m (0.1ms)[0m [1mrollback transaction[0m
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gettext_simple_rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kasper Johansen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -116,95 +116,95 @@ executables: []
|
|
116
116
|
extensions: []
|
117
117
|
extra_rdoc_files: []
|
118
118
|
files:
|
119
|
-
- app/controllers/gettext_simple_rails/application_controller.rb
|
120
|
-
- app/views/layouts/gettext_simple_rails/application.html.erb
|
121
|
-
- app/helpers/gettext_simple_rails/application_helper.rb
|
122
119
|
- app/assets/stylesheets/gettext_simple_rails/application.css
|
123
120
|
- app/assets/javascripts/gettext_simple_rails/application.js
|
121
|
+
- app/helpers/gettext_simple_rails/application_helper.rb
|
122
|
+
- app/controllers/gettext_simple_rails/application_controller.rb
|
123
|
+
- app/views/layouts/gettext_simple_rails/application.html.erb
|
124
|
+
- config/poedit_ruby_parser.conf
|
124
125
|
- config/routes.rb
|
125
126
|
- config/default.po
|
126
|
-
-
|
127
|
-
- lib/
|
128
|
-
- lib/gettext_simple_rails/engine.rb
|
129
|
-
- lib/gettext_simple_rails/version.rb
|
130
|
-
- lib/gettext_simple_rails/setup_helper.rb
|
131
|
-
- lib/gettext_simple_rails/cache_handler.rb
|
132
|
-
- lib/gettext_simple_rails/i18n_injector.rb
|
133
|
-
- lib/gettext_simple_rails/translators/simple_form_translator.rb
|
134
|
-
- lib/gettext_simple_rails/translators/devise_translator.rb
|
135
|
-
- lib/gettext_simple_rails/translators/active_record_validations_translator.rb
|
136
|
-
- lib/gettext_simple_rails/translators/active_admin_translator.rb
|
127
|
+
- lib/gettext_simple_rails.rb
|
128
|
+
- lib/tasks/gettext_simple_rails_tasks.rake
|
137
129
|
- lib/gettext_simple_rails/translators/active_record_attributes_translator.rb
|
138
|
-
- lib/gettext_simple_rails/translators/
|
130
|
+
- lib/gettext_simple_rails/translators/active_record_validations_translator.rb
|
139
131
|
- lib/gettext_simple_rails/translators/number_translator.rb
|
132
|
+
- lib/gettext_simple_rails/translators/simple_form_translator.rb
|
133
|
+
- lib/gettext_simple_rails/translators/date_translator.rb
|
140
134
|
- lib/gettext_simple_rails/translators/globalize_translator.rb
|
141
|
-
- lib/gettext_simple_rails.rb
|
142
|
-
- lib/
|
135
|
+
- lib/gettext_simple_rails/translators/devise_translator.rb
|
136
|
+
- lib/gettext_simple_rails/translators/active_admin_translator.rb
|
137
|
+
- lib/gettext_simple_rails/engine.rb
|
138
|
+
- lib/gettext_simple_rails/cache_handler.rb
|
139
|
+
- lib/gettext_simple_rails/setup_helper.rb
|
140
|
+
- lib/gettext_simple_rails/i18n_injector.rb
|
141
|
+
- lib/gettext_simple_rails/version.rb
|
142
|
+
- lib/gettext_simple_rails/model_inspector.rb
|
143
143
|
- MIT-LICENSE
|
144
144
|
- Rakefile
|
145
|
+
- spec/poedit_config_with_ruby.conf
|
146
|
+
- spec/poedit_config_without_ruby.conf
|
147
|
+
- spec/spec_helper.rb
|
148
|
+
- spec/date_translator_spec.rb
|
149
|
+
- spec/active_record_validations_spec.rb
|
150
|
+
- spec/cache_handler_spec.rb
|
151
|
+
- spec/dummy/Rakefile
|
152
|
+
- spec/dummy/lib/gettext_simple_rails/number_translator_translations.rb
|
153
|
+
- spec/dummy/lib/gettext_simple_rails/globalize_translator_translations.rb
|
154
|
+
- spec/dummy/lib/gettext_simple_rails/active_record_validations_translator_translations.rb
|
155
|
+
- spec/dummy/lib/gettext_simple_rails/active_record_attributes_translator_translations.rb
|
156
|
+
- spec/dummy/lib/gettext_simple_rails/date_translator_translations.rb
|
157
|
+
- spec/dummy/log/test.log
|
158
|
+
- spec/dummy/README.rdoc
|
159
|
+
- spec/dummy/public/422.html
|
160
|
+
- spec/dummy/public/favicon.ico
|
161
|
+
- spec/dummy/public/500.html
|
162
|
+
- spec/dummy/public/404.html
|
163
|
+
- spec/dummy/test/models/user_test.rb
|
164
|
+
- spec/dummy/test/models/role_test.rb
|
165
|
+
- spec/dummy/test/fixtures/roles.yml
|
166
|
+
- spec/dummy/test/fixtures/users.yml
|
167
|
+
- spec/dummy/config/boot.rb
|
168
|
+
- spec/dummy/config/secrets.yml
|
145
169
|
- spec/dummy/config/environments/test.rb
|
146
170
|
- spec/dummy/config/environments/production.rb
|
147
171
|
- spec/dummy/config/environments/development.rb
|
148
|
-
- spec/dummy/config/environment.rb
|
149
|
-
- spec/dummy/config/secrets.yml
|
150
|
-
- spec/dummy/config/application.rb
|
151
172
|
- spec/dummy/config/database.yml
|
173
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
174
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
175
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
176
|
+
- spec/dummy/config/initializers/mime_types.rb
|
177
|
+
- spec/dummy/config/initializers/inflections.rb
|
178
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
179
|
+
- spec/dummy/config/initializers/session_store.rb
|
180
|
+
- spec/dummy/config/environment.rb
|
152
181
|
- spec/dummy/config/locales/en.yml
|
153
182
|
- spec/dummy/config/locales/da.yml
|
154
|
-
- spec/dummy/config/
|
155
|
-
- spec/dummy/config/locales_gettext/en/LC_MESSAGES/default.po
|
183
|
+
- spec/dummy/config/application.rb
|
156
184
|
- spec/dummy/config/locales_gettext/static_translation_file.json
|
157
185
|
- spec/dummy/config/locales_gettext/da/LC_MESSAGES/default.mo
|
158
186
|
- spec/dummy/config/locales_gettext/da/LC_MESSAGES/default.po
|
159
|
-
- spec/dummy/config/
|
160
|
-
- spec/dummy/config/
|
161
|
-
- spec/dummy/
|
162
|
-
- spec/dummy/
|
163
|
-
- spec/dummy/
|
164
|
-
- spec/dummy/
|
165
|
-
- spec/dummy/
|
166
|
-
- spec/dummy/
|
167
|
-
- spec/dummy/
|
168
|
-
- spec/dummy/bin/rails
|
169
|
-
- spec/dummy/bin/bundle
|
170
|
-
- spec/dummy/log/test.log
|
171
|
-
- spec/dummy/test/fixtures/users.yml
|
172
|
-
- spec/dummy/test/fixtures/roles.yml
|
173
|
-
- spec/dummy/test/models/role_test.rb
|
174
|
-
- spec/dummy/test/models/user_test.rb
|
175
|
-
- spec/dummy/public/422.html
|
176
|
-
- spec/dummy/public/500.html
|
177
|
-
- spec/dummy/public/404.html
|
178
|
-
- spec/dummy/public/favicon.ico
|
179
|
-
- spec/dummy/db/schema.rb
|
180
|
-
- spec/dummy/db/test.sqlite3
|
181
|
-
- spec/dummy/db/migrate/20140411112622_create_roles.rb
|
187
|
+
- spec/dummy/config/locales_gettext/en/LC_MESSAGES/default.po
|
188
|
+
- spec/dummy/config/routes.rb
|
189
|
+
- spec/dummy/app/models/role.rb
|
190
|
+
- spec/dummy/app/models/user.rb
|
191
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
192
|
+
- spec/dummy/app/assets/javascripts/application.js
|
193
|
+
- spec/dummy/app/helpers/application_helper.rb
|
194
|
+
- spec/dummy/app/controllers/application_controller.rb
|
195
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
182
196
|
- spec/dummy/db/migrate/20140410170418_create_users.rb
|
183
197
|
- spec/dummy/db/migrate/20140515092420_create_user_translations.rb
|
184
|
-
- spec/dummy/
|
185
|
-
- spec/dummy/
|
186
|
-
- spec/dummy/
|
187
|
-
- spec/dummy/lib/gettext_simple_rails/globalize_translator_translations.rb
|
188
|
-
- spec/dummy/lib/gettext_simple_rails/active_record_attributes_translator_translations.rb
|
189
|
-
- spec/dummy/Rakefile
|
198
|
+
- spec/dummy/db/migrate/20140411112622_create_roles.rb
|
199
|
+
- spec/dummy/db/test.sqlite3
|
200
|
+
- spec/dummy/db/schema.rb
|
190
201
|
- spec/dummy/config.ru
|
191
|
-
- spec/dummy/
|
192
|
-
- spec/dummy/
|
193
|
-
- spec/dummy/
|
194
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
195
|
-
- spec/dummy/app/assets/javascripts/application.js
|
196
|
-
- spec/dummy/app/models/role.rb
|
197
|
-
- spec/dummy/app/models/user.rb
|
198
|
-
- spec/dummy/README.rdoc
|
199
|
-
- spec/setup_helper_spec.rb
|
200
|
-
- spec/poedit_config_without_ruby.conf
|
202
|
+
- spec/dummy/bin/bundle
|
203
|
+
- spec/dummy/bin/rake
|
204
|
+
- spec/dummy/bin/rails
|
201
205
|
- spec/globalize_translator_spec.rb
|
202
|
-
- spec/
|
203
|
-
- spec/cache_handler_spec.rb
|
206
|
+
- spec/setup_helper_spec.rb
|
204
207
|
- spec/gettext_simple_rails_spec.rb
|
205
|
-
- spec/spec_helper.rb
|
206
|
-
- spec/date_translator_spec.rb
|
207
|
-
- spec/active_record_validations_spec.rb
|
208
208
|
homepage: http://www.github.com/kaspernj/gettext_simple_rails
|
209
209
|
licenses:
|
210
210
|
- MIT
|
@@ -230,66 +230,66 @@ signing_key:
|
|
230
230
|
specification_version: 4
|
231
231
|
summary: Helpers for translating a Rails app with Gettext and POEdit.
|
232
232
|
test_files:
|
233
|
+
- spec/poedit_config_with_ruby.conf
|
234
|
+
- spec/poedit_config_without_ruby.conf
|
235
|
+
- spec/spec_helper.rb
|
236
|
+
- spec/date_translator_spec.rb
|
237
|
+
- spec/active_record_validations_spec.rb
|
238
|
+
- spec/cache_handler_spec.rb
|
239
|
+
- spec/dummy/Rakefile
|
240
|
+
- spec/dummy/lib/gettext_simple_rails/number_translator_translations.rb
|
241
|
+
- spec/dummy/lib/gettext_simple_rails/globalize_translator_translations.rb
|
242
|
+
- spec/dummy/lib/gettext_simple_rails/active_record_validations_translator_translations.rb
|
243
|
+
- spec/dummy/lib/gettext_simple_rails/active_record_attributes_translator_translations.rb
|
244
|
+
- spec/dummy/lib/gettext_simple_rails/date_translator_translations.rb
|
245
|
+
- spec/dummy/log/test.log
|
246
|
+
- spec/dummy/README.rdoc
|
247
|
+
- spec/dummy/public/422.html
|
248
|
+
- spec/dummy/public/favicon.ico
|
249
|
+
- spec/dummy/public/500.html
|
250
|
+
- spec/dummy/public/404.html
|
251
|
+
- spec/dummy/test/models/user_test.rb
|
252
|
+
- spec/dummy/test/models/role_test.rb
|
253
|
+
- spec/dummy/test/fixtures/roles.yml
|
254
|
+
- spec/dummy/test/fixtures/users.yml
|
255
|
+
- spec/dummy/config/boot.rb
|
256
|
+
- spec/dummy/config/secrets.yml
|
233
257
|
- spec/dummy/config/environments/test.rb
|
234
258
|
- spec/dummy/config/environments/production.rb
|
235
259
|
- spec/dummy/config/environments/development.rb
|
236
|
-
- spec/dummy/config/environment.rb
|
237
|
-
- spec/dummy/config/secrets.yml
|
238
|
-
- spec/dummy/config/application.rb
|
239
260
|
- spec/dummy/config/database.yml
|
261
|
+
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
262
|
+
- spec/dummy/config/initializers/cookies_serializer.rb
|
263
|
+
- spec/dummy/config/initializers/wrap_parameters.rb
|
264
|
+
- spec/dummy/config/initializers/mime_types.rb
|
265
|
+
- spec/dummy/config/initializers/inflections.rb
|
266
|
+
- spec/dummy/config/initializers/backtrace_silencers.rb
|
267
|
+
- spec/dummy/config/initializers/session_store.rb
|
268
|
+
- spec/dummy/config/environment.rb
|
240
269
|
- spec/dummy/config/locales/en.yml
|
241
270
|
- spec/dummy/config/locales/da.yml
|
242
|
-
- spec/dummy/config/
|
243
|
-
- spec/dummy/config/locales_gettext/en/LC_MESSAGES/default.po
|
271
|
+
- spec/dummy/config/application.rb
|
244
272
|
- spec/dummy/config/locales_gettext/static_translation_file.json
|
245
273
|
- spec/dummy/config/locales_gettext/da/LC_MESSAGES/default.mo
|
246
274
|
- spec/dummy/config/locales_gettext/da/LC_MESSAGES/default.po
|
247
|
-
- spec/dummy/config/
|
248
|
-
- spec/dummy/config/
|
249
|
-
- spec/dummy/
|
250
|
-
- spec/dummy/
|
251
|
-
- spec/dummy/
|
252
|
-
- spec/dummy/
|
253
|
-
- spec/dummy/
|
254
|
-
- spec/dummy/
|
255
|
-
- spec/dummy/
|
256
|
-
- spec/dummy/bin/rails
|
257
|
-
- spec/dummy/bin/bundle
|
258
|
-
- spec/dummy/log/test.log
|
259
|
-
- spec/dummy/test/fixtures/users.yml
|
260
|
-
- spec/dummy/test/fixtures/roles.yml
|
261
|
-
- spec/dummy/test/models/role_test.rb
|
262
|
-
- spec/dummy/test/models/user_test.rb
|
263
|
-
- spec/dummy/public/422.html
|
264
|
-
- spec/dummy/public/500.html
|
265
|
-
- spec/dummy/public/404.html
|
266
|
-
- spec/dummy/public/favicon.ico
|
267
|
-
- spec/dummy/db/schema.rb
|
268
|
-
- spec/dummy/db/test.sqlite3
|
269
|
-
- spec/dummy/db/migrate/20140411112622_create_roles.rb
|
275
|
+
- spec/dummy/config/locales_gettext/en/LC_MESSAGES/default.po
|
276
|
+
- spec/dummy/config/routes.rb
|
277
|
+
- spec/dummy/app/models/role.rb
|
278
|
+
- spec/dummy/app/models/user.rb
|
279
|
+
- spec/dummy/app/assets/stylesheets/application.css
|
280
|
+
- spec/dummy/app/assets/javascripts/application.js
|
281
|
+
- spec/dummy/app/helpers/application_helper.rb
|
282
|
+
- spec/dummy/app/controllers/application_controller.rb
|
283
|
+
- spec/dummy/app/views/layouts/application.html.erb
|
270
284
|
- spec/dummy/db/migrate/20140410170418_create_users.rb
|
271
285
|
- spec/dummy/db/migrate/20140515092420_create_user_translations.rb
|
272
|
-
- spec/dummy/
|
273
|
-
- spec/dummy/
|
274
|
-
- spec/dummy/
|
275
|
-
- spec/dummy/lib/gettext_simple_rails/globalize_translator_translations.rb
|
276
|
-
- spec/dummy/lib/gettext_simple_rails/active_record_attributes_translator_translations.rb
|
277
|
-
- spec/dummy/Rakefile
|
286
|
+
- spec/dummy/db/migrate/20140411112622_create_roles.rb
|
287
|
+
- spec/dummy/db/test.sqlite3
|
288
|
+
- spec/dummy/db/schema.rb
|
278
289
|
- spec/dummy/config.ru
|
279
|
-
- spec/dummy/
|
280
|
-
- spec/dummy/
|
281
|
-
- spec/dummy/
|
282
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
283
|
-
- spec/dummy/app/assets/javascripts/application.js
|
284
|
-
- spec/dummy/app/models/role.rb
|
285
|
-
- spec/dummy/app/models/user.rb
|
286
|
-
- spec/dummy/README.rdoc
|
287
|
-
- spec/setup_helper_spec.rb
|
288
|
-
- spec/poedit_config_without_ruby.conf
|
290
|
+
- spec/dummy/bin/bundle
|
291
|
+
- spec/dummy/bin/rake
|
292
|
+
- spec/dummy/bin/rails
|
289
293
|
- spec/globalize_translator_spec.rb
|
290
|
-
- spec/
|
291
|
-
- spec/cache_handler_spec.rb
|
294
|
+
- spec/setup_helper_spec.rb
|
292
295
|
- spec/gettext_simple_rails_spec.rb
|
293
|
-
- spec/spec_helper.rb
|
294
|
-
- spec/date_translator_spec.rb
|
295
|
-
- spec/active_record_validations_spec.rb
|