nulogy-gettext_i18n_rails 0.5.0.1 → 0.5.0.2
Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
gettext_i18n_rails (0.5.0)
|
4
|
+
gettext_i18n_rails (0.5.0.2)
|
5
5
|
fast_gettext
|
6
6
|
|
7
7
|
GEM
|
@@ -41,7 +41,7 @@ GEM
|
|
41
41
|
builder (3.0.0)
|
42
42
|
diff-lcs (1.1.2)
|
43
43
|
erubis (2.7.0)
|
44
|
-
fast_gettext (0.
|
44
|
+
fast_gettext (0.6.7)
|
45
45
|
gettext (2.1.0)
|
46
46
|
locale (>= 2.0.5)
|
47
47
|
haml (3.1.4)
|
@@ -4,13 +4,13 @@ module GettextI18nRails::ActiveRecord
|
|
4
4
|
s_(gettext_translation_for_attribute_name(attribute))
|
5
5
|
end
|
6
6
|
|
7
|
-
# CarDealer -> _('car dealer')
|
8
7
|
# method deprecated in Rails 3.1
|
9
8
|
def human_name(*args)
|
10
|
-
_(self.humanize_class_name
|
9
|
+
_(self.humanize_class_name)
|
11
10
|
end
|
12
11
|
|
13
|
-
def humanize_class_name(name)
|
12
|
+
def humanize_class_name(name=nil)
|
13
|
+
name ||= self.to_s
|
14
14
|
name.underscore.humanize
|
15
15
|
end
|
16
16
|
|
@@ -9,7 +9,7 @@ module GettextI18nRails
|
|
9
9
|
File.open(file,'w') do |f|
|
10
10
|
f.puts "#DO NOT MODIFY! AUTOMATICALLY GENERATED FILE!"
|
11
11
|
ModelAttributesFinder.new.find(options).each do |model,column_names|
|
12
|
-
f.puts("_('#{model.
|
12
|
+
f.puts("_('#{model.humanize_class_name}')")
|
13
13
|
|
14
14
|
#all columns namespaced under the model
|
15
15
|
column_names.each do |attribute|
|
@@ -14,6 +14,9 @@ if defined?(Rails::Railtie)
|
|
14
14
|
if app.config.gettext_i18n_rails.use_for_active_record_attributes
|
15
15
|
ActiveSupport.on_load :active_record do
|
16
16
|
extend GettextI18nRails::ActiveRecord
|
17
|
+
end
|
18
|
+
|
19
|
+
ActiveSupport.on_load :active_model do
|
17
20
|
require 'gettext_i18n_rails/active_model.rb'
|
18
21
|
end
|
19
22
|
end
|