gettext_i18n_rails 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock
CHANGED
@@ -15,10 +15,11 @@ module GettextI18nRails::ActiveRecord
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def gettext_translation_for_attribute_name(attribute)
|
18
|
-
|
18
|
+
attribute = attribute.to_s
|
19
|
+
if attribute.ends_with?('_id')
|
19
20
|
humanize_class_name(attribute)
|
20
21
|
else
|
21
|
-
"#{self}|#{attribute.
|
22
|
+
"#{self}|#{attribute.split('.').map! {|a| a.humanize }.join('|')}"
|
22
23
|
end
|
23
24
|
end
|
24
25
|
end
|
@@ -27,7 +27,7 @@ describe ActiveRecord::Base do
|
|
27
27
|
|
28
28
|
describe :gettext_translation_for_attribute_name do
|
29
29
|
it "translates foreign keys to model name keys" do
|
30
|
-
Part.gettext_translation_for_attribute_name(
|
30
|
+
Part.gettext_translation_for_attribute_name(:car_seat_id).should == 'Car seat'
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
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: 13
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 3
|
10
|
+
version: 0.5.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Michael Grosser
|