i18n_rails_helpers 0.5.7 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/README CHANGED
@@ -1,13 +1,19 @@
1
1
  I18nRailsHelpers
2
2
  ================
3
3
 
4
- Introduction goes here.
4
+ Rails i18n view helpers for things like crud actions, models and and attributes.
5
5
 
6
6
 
7
7
  Example
8
8
  =======
9
9
 
10
- Example goes here.
10
+ t_attr('first_name') => 'Vorname' # when called in patients_controller views
11
+ t_model => 'Konto' # when called in patients_controller views
12
+ t_crud('delete') => 'Konto löschen' # when called in accounts_controller views
13
+ t_confirm_delete(@account) => 'Konto Kasse wirklich löschen'
11
14
 
12
15
 
13
- Copyright (c) 2010 [name of plugin creator], released under the MIT license
16
+ Copyright (c) 2010 Simon Hürlimann <simon.huerlimann@cyt.ch>
17
+ Copyright (c) 2010 CyT <http://www.cyt.ch>
18
+
19
+ Released under the MIT license
@@ -3,7 +3,8 @@ de:
3
3
  confirm_delete: "%{model} %{record} wirklich löschen?"
4
4
 
5
5
  crud:
6
- edit: "%{model} bearbeiten"
7
- show: "%{model} anzeigen"
8
- new: "%{model} anlegen"
9
- back: "zurück"
6
+ index: "%{model} Liste"
7
+ edit: "%{model} bearbeiten"
8
+ show: "%{model} anzeigen"
9
+ new: "%{model} anlegen"
10
+ back: "zurück"
@@ -53,14 +53,8 @@ module I18nRailsHelpers
53
53
  # t_crud => 'Konto ändern' # when called in accounts_controller edit view
54
54
  #
55
55
  def t_crud(action = nil, model = nil)
56
- if model.is_a? Class
57
- model_name = model.name.underscore
58
- elsif model.nil?
59
- model_name = controller_name.singularize
60
- end
61
-
62
56
  action ||= action_name
63
- I18n::translate(action, :scope => :crud, :model => model_name.capitalize)
57
+ I18n::translate(action, :scope => :crud, :model => t_model(model))
64
58
  end
65
59
 
66
60
  # Returns translated deletion confirmation for +record+.
metadata CHANGED
@@ -4,9 +4,9 @@ version: !ruby/object:Gem::Version
4
4
  prerelease: false
5
5
  segments:
6
6
  - 0
7
- - 5
8
- - 7
9
- version: 0.5.7
7
+ - 6
8
+ - 0
9
+ version: 0.6.0
10
10
  platform: ruby
11
11
  authors:
12
12
  - "Simon H\xC3\xBCrlimann"
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-25 00:00:00 +02:00
17
+ date: 2010-07-28 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency