i18n_rails_helpers 0.16.0 → 0.17.0
Sign up to get free protection for your applications and to get access to all the features.
- data/config/locales/de.yml +1 -0
- data/lib/contextual_link_helpers.rb +1 -1
- data/lib/i18n_rails_helpers.rb +11 -0
- data/lib/i18n_rails_helpers/version.rb +1 -1
- metadata +4 -4
data/config/locales/de.yml
CHANGED
@@ -23,7 +23,7 @@ module ContextualLinkHelpers
|
|
23
23
|
model_name = model.to_s.underscore
|
24
24
|
|
25
25
|
# No link if CanCan is used and current user isn't authorized to call this action
|
26
|
-
return if respond_to?(:
|
26
|
+
return if respond_to?(:cannot?) and cannot?(action.to_sym, model)
|
27
27
|
|
28
28
|
# Option generation
|
29
29
|
case action
|
data/lib/i18n_rails_helpers.rb
CHANGED
@@ -101,4 +101,15 @@ module I18nRailsHelpers
|
|
101
101
|
def t_confirm_delete(record)
|
102
102
|
I18n::translate('messages.confirm_delete', :model => t_model(record), :record => record.to_s)
|
103
103
|
end
|
104
|
+
|
105
|
+
# Returns translated drop down field prompt for +model+.
|
106
|
+
#
|
107
|
+
# If no +model+ is given, it tries to guess it from the controller.
|
108
|
+
#
|
109
|
+
# Example:
|
110
|
+
# t_select_prompt(Account) => 'Konto auswählen'
|
111
|
+
#
|
112
|
+
def t_select_prompt(model = nil)
|
113
|
+
I18n::translate('messages.select_prompt', :model => t_model(model))
|
114
|
+
end
|
104
115
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n_rails_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 91
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 17
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.17.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Simon H\xC3\xBCrlimann (CyT)"
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-11-
|
18
|
+
date: 2011-11-16 00:00:00 +01:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|