i18n_rails_helpers 0.14.2 → 0.14.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/i18n_rails_helpers/version.rb +1 -1
- data/lib/i18n_rails_helpers.rb +6 -1
- metadata +4 -5
- data/rails/init.rb +0 -7
data/lib/i18n_rails_helpers.rb
CHANGED
@@ -59,6 +59,11 @@ module I18nRailsHelpers
|
|
59
59
|
# The translation file comming with the plugin supports the following actions
|
60
60
|
# by default: index, edit, show, new, delete
|
61
61
|
#
|
62
|
+
# You may provide controller specific titles in the translation file. The keys
|
63
|
+
# should have the following format:
|
64
|
+
#
|
65
|
+
# #{controller_name}.#{action}.title
|
66
|
+
#
|
62
67
|
# Example:
|
63
68
|
# t_title('new', Account') => 'Konto anlegen'
|
64
69
|
# t_title('delete') => 'Konto löschen' # when called in accounts_controller views
|
@@ -66,7 +71,7 @@ module I18nRailsHelpers
|
|
66
71
|
#
|
67
72
|
def t_title(action = nil, model = nil)
|
68
73
|
action ||= action_name
|
69
|
-
I18n::translate(action, :
|
74
|
+
I18n::translate("#{controller_name.underscore}.#{action}.title", :default => [:"crud.title.#{action}"], :model => t_model(model))
|
70
75
|
end
|
71
76
|
alias :t_crud :t_title
|
72
77
|
|
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: 47
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 14
|
9
|
-
-
|
10
|
-
version: 0.14.
|
9
|
+
- 4
|
10
|
+
version: 0.14.4
|
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-
|
18
|
+
date: 2011-10-10 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies: []
|
21
21
|
|
@@ -36,7 +36,6 @@ files:
|
|
36
36
|
- lib/i18n_rails_helpers/railtie.rb
|
37
37
|
- lib/i18n_rails_helpers/version.rb
|
38
38
|
- lib/list_link_helpers.rb
|
39
|
-
- rails/init.rb
|
40
39
|
- README.markdown
|
41
40
|
has_rdoc: true
|
42
41
|
homepage: https://github.com/huerlisi/i18n_rails_helpers
|
data/rails/init.rb
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
# Register helpers for Rails < 3
|
2
|
-
require File.join(File.dirname(__FILE__), *%w[.. lib i18n_rails_helpers])
|
3
|
-
ActionView::Base.send :include, I18nRailsHelpers
|
4
|
-
require File.join(File.dirname(__FILE__), *%w[.. lib contextual_link_helpers])
|
5
|
-
ActionView::Base.send :include, ContextualLinkHelpers
|
6
|
-
require File.join(File.dirname(__FILE__), *%w[.. lib list_link_helpers.rb])
|
7
|
-
ActionView::Base.send :include, ListLinkHelpers
|