localizable_routes 5.1.1 → 5.1.2
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95fe22b3c719d1404ec2a3343f8cd5e09dfef4b1
|
4
|
+
data.tar.gz: c5d642c35888e8309db2ae60ace00562fa7f5b75
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ea7f4df35838d767213c37bae7d178e347cecce18a17e634ead940b7bc64127084b1e29eca92b515ec0bdce2301fc3067468804e690080d798dd0d5999306b8
|
7
|
+
data.tar.gz: 004dd6a6969b8e1a565f8cabdbf42be031eb116a2ebe5300d9de500634c9f2b5d4b483cd628d39fb67a9f7e4b617dacd02b6b2fc280e5c2fa293064a5e13a93f
|
@@ -14,20 +14,12 @@ module LocalizableRoutes
|
|
14
14
|
options = args.extract_options!
|
15
15
|
strategy = localization[:strategy]
|
16
16
|
if strategy == :param
|
17
|
-
locale =
|
18
|
-
options[:locale] ||
|
19
|
-
url_options.try(:fetch, :locale, nil) ||
|
20
|
-
I18n.locale
|
21
|
-
)
|
17
|
+
locale = options[:locale]
|
22
18
|
else
|
23
|
-
key =
|
24
|
-
options[strategy] ||
|
25
|
-
url_options.try(:fetch, strategy, nil) ||
|
26
|
-
try(:request).try(strategy)
|
27
|
-
)
|
19
|
+
key = options[strategy]
|
28
20
|
locale = localization[:locales][key.to_s]
|
29
21
|
end
|
30
|
-
send "#{name}_#{locale}_#{type}", *(args << options)
|
22
|
+
send "#{name}_#{locale || I18n.locale}_#{type}", *(args << options)
|
31
23
|
end
|
32
24
|
end
|
33
25
|
instance_variable_get("@#{type}_helpers") << helper
|