i18n_rails_helpers 0.16.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,7 @@
1
1
  de:
2
2
  messages:
3
3
  confirm_delete: "%{model} %{record} wirklich löschen?"
4
+ select_prompt: "%{model} auswählen"
4
5
 
5
6
  crud:
6
7
  title:
@@ -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?(:can?) and cannot?(action.to_sym, model)
26
+ return if respond_to?(:cannot?) and cannot?(action.to_sym, model)
27
27
 
28
28
  # Option generation
29
29
  case action
@@ -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
@@ -1,3 +1,3 @@
1
1
  module I18nRailsHelpers
2
- VERSION = "0.16.0"
2
+ VERSION = "0.17.0"
3
3
  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: 95
4
+ hash: 91
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 16
8
+ - 17
9
9
  - 0
10
- version: 0.16.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-04 00:00:00 +01:00
18
+ date: 2011-11-16 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21