i18n_structure 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/i18n_structure/locale_helper.rb +7 -1
- data/lib/i18n_structure/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1c2262ae336e730bb84fd614091d5712af0821c
|
4
|
+
data.tar.gz: f7201e0a5337e1631a6e2ea600813cb30f1ada26
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5064eff2cde8a5b01880b4f2f51733c224f54cb37f4c473e8c71334ce2cff7a7e5a3601bcfa906148c4672a7cc3266f779a28b54cd7546350fb4d322295c3300
|
7
|
+
data.tar.gz: 7771ad8c25d59fa9429e442c90a680ecbe9047cc9f33d60ca8a5fc0e45bd10764f1b39260df0c6164ac04f246985ba524f4844c5b48141613bf4903e67573403
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module I18nStructure
|
2
2
|
module LocaleHelper
|
3
|
-
[:labels, :tooltips, :attributes
|
3
|
+
[:labels, :tooltips, :attributes].each do |kind|
|
4
4
|
define_method("translate_#{kind.to_s.singularize}") do |*args|
|
5
5
|
I18n.send("translate_#{kind.to_s.singularize}", *args)
|
6
6
|
end
|
@@ -11,5 +11,11 @@ module I18nStructure
|
|
11
11
|
end
|
12
12
|
alias_method "t#{kind.to_s[0]}?", "translate_#{kind.to_s.singularize}_exist?"
|
13
13
|
end
|
14
|
+
[:collections, :views].each do |kind|
|
15
|
+
define_method("translate_#{kind.to_s.singularize}") do |*args|
|
16
|
+
I18n.send("translate_#{kind.to_s.singularize}", *args)
|
17
|
+
end
|
18
|
+
alias_method "t#{kind.to_s[0]}", "translate_#{kind.to_s.singularize}"
|
19
|
+
end
|
14
20
|
end
|
15
21
|
end
|