i18n_rails_helpers 1.4.12 → 2.0.0.beta0
Sign up to get free protection for your applications and to get access to all the features.
- data/MIT-LICENSE +21 -0
- data/README.md +27 -0
- data/Rakefile +28 -0
- data/app/assets/stylesheets/i18n_rails_helpers.scss +12 -0
- data/app/helpers/bootstrap_helper.rb +2 -1
- data/app/helpers/contextual_link_helpers.rb +1 -1
- data/app/helpers/list_link_helpers.rb +1 -1
- data/config/locales/de.yml +1 -0
- data/config/locales/en.yml +1 -0
- data/lib/i18n_rails_helpers/{railtie.rb → engine.rb} +1 -1
- data/lib/i18n_rails_helpers/version.rb +1 -1
- data/lib/i18n_rails_helpers.rb +5 -1
- metadata +105 -22
- data/README.markdown +0 -20
- data/rails/init.rb +0 -7
data/MIT-LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
Copyright (c) 2010-2014 Simon Hürlimann <simon.huerlimann@cyt.ch>
|
2
|
+
Copyright (c) 2010-2014 CyT <http://www.cyt.ch>
|
3
|
+
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
5
|
+
a copy of this software and associated documentation files (the
|
6
|
+
"Software"), to deal in the Software without restriction, including
|
7
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
8
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
9
|
+
permit persons to whom the Software is furnished to do so, subject to
|
10
|
+
the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be
|
13
|
+
included in all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
16
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
17
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
18
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
19
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
20
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
21
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,27 @@
|
|
1
|
+
I18nRailsHelpers
|
2
|
+
================
|
3
|
+
|
4
|
+
[![Build Status](https://secure.travis-ci.org/huerlisi/i18n_rails_helpers.png)](http://travis-ci.org/huerlisi/i18n_rails_helpers)
|
5
|
+
|
6
|
+
Rails i18n view helpers for things like crud actions, models and and attributes.
|
7
|
+
|
8
|
+
Install
|
9
|
+
=======
|
10
|
+
|
11
|
+
In Rails simply add
|
12
|
+
|
13
|
+
gem 'i18n_rails_helpers'
|
14
|
+
|
15
|
+
Example
|
16
|
+
=======
|
17
|
+
|
18
|
+
t_attr('first_name') # 'Vorname' # when called in patients_controller views
|
19
|
+
t_model # 'Konto' # when called in patients_controller views
|
20
|
+
t_title('delete') # 'Konto löschen' # when called in accounts_controller views
|
21
|
+
t_action('index') # 'Liste'
|
22
|
+
t_confirm_delete(@account) # 'Konto Kasse wirklich löschen'
|
23
|
+
|
24
|
+
License
|
25
|
+
=======
|
26
|
+
|
27
|
+
Released under the MIT license.
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
10
|
+
rdoc.rdoc_dir = 'rdoc'
|
11
|
+
rdoc.title = 'I18nRailsHelpers'
|
12
|
+
rdoc.options << '--line-numbers'
|
13
|
+
rdoc.rdoc_files.include('README.md')
|
14
|
+
rdoc.rdoc_files.include('{app,config,db,lib}/**/*.rb')
|
15
|
+
end
|
16
|
+
|
17
|
+
APP_RAKEFILE = File.expand_path('../spec/dummy/Rakefile', __FILE__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
19
|
+
|
20
|
+
Bundler::GemHelper.install_tasks
|
21
|
+
|
22
|
+
require 'rspec/core'
|
23
|
+
require 'rspec/core/rake_task'
|
24
|
+
|
25
|
+
desc 'Run all specs in spec directory (excluding plugin specs)'
|
26
|
+
RSpec::Core::RakeTask.new(:spec)
|
27
|
+
|
28
|
+
task default: :spec
|
@@ -44,7 +44,7 @@ module ContextualLinkHelpers
|
|
44
44
|
|
45
45
|
options.merge!(:class => classes.join(" "))
|
46
46
|
link_to(url_for(url), options) do
|
47
|
-
|
47
|
+
boot_icon(action_to_icon(icon)) + " " + title
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
data/config/locales/de.yml
CHANGED
data/config/locales/en.yml
CHANGED
data/lib/i18n_rails_helpers.rb
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
require 'i18n_rails_helpers/
|
1
|
+
require 'i18n_rails_helpers/engine'
|
2
2
|
|
3
3
|
module I18nRailsHelpers
|
4
4
|
# Configuration
|
@@ -24,4 +24,8 @@ module I18nRailsHelpers
|
|
24
24
|
# CSS class to use for contextual links
|
25
25
|
mattr_accessor :contextual_link_class
|
26
26
|
@@contextual_link_class = 'btn'
|
27
|
+
|
28
|
+
# Bootstrap icon class
|
29
|
+
mattr_accessor :boot_icon_class_template
|
30
|
+
@@boot_icon_class_template = 'icon icon-%s '
|
27
31
|
end
|
metadata
CHANGED
@@ -1,43 +1,126 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: i18n_rails_helpers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
5
|
-
prerelease:
|
4
|
+
version: 2.0.0.beta0
|
5
|
+
prerelease: 6
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
|
-
- Simon
|
8
|
+
- Simon Huerlimann (CyT)
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2014-
|
13
|
-
dependencies:
|
12
|
+
date: 2014-07-06 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rails
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ! '>'
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 3.0.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ! '>'
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 3.0.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: sqlite3
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec-rails
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
- !ruby/object:Gem::Dependency
|
63
|
+
name: capybara
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - ! '>='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '0'
|
70
|
+
type: :development
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
- !ruby/object:Gem::Dependency
|
79
|
+
name: factory_girl_rails
|
80
|
+
requirement: !ruby/object:Gem::Requirement
|
81
|
+
none: false
|
82
|
+
requirements:
|
83
|
+
- - ! '>='
|
84
|
+
- !ruby/object:Gem::Version
|
85
|
+
version: '0'
|
86
|
+
type: :development
|
87
|
+
prerelease: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
89
|
+
none: false
|
90
|
+
requirements:
|
91
|
+
- - ! '>='
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
14
94
|
description: Rails i18n view helpers for things like crud actions, models and and
|
15
95
|
attributes.
|
16
|
-
email:
|
96
|
+
email:
|
97
|
+
- simon.huerlimann@cyt.ch
|
17
98
|
executables: []
|
18
99
|
extensions: []
|
19
|
-
extra_rdoc_files:
|
20
|
-
- README.markdown
|
100
|
+
extra_rdoc_files: []
|
21
101
|
files:
|
22
|
-
- app/
|
23
|
-
- app/
|
24
|
-
- app/helpers/i18n_helpers.rb
|
25
|
-
- app/helpers/list_link_helpers.rb
|
102
|
+
- app/views/application/show.html.haml
|
103
|
+
- app/views/application/new.html.haml
|
26
104
|
- app/views/application/_list.html.haml
|
27
105
|
- app/views/application/edit.html.haml
|
28
106
|
- app/views/application/index.html.haml
|
29
|
-
- app/
|
30
|
-
- app/
|
31
|
-
-
|
107
|
+
- app/helpers/bootstrap_helper.rb
|
108
|
+
- app/helpers/i18n_helpers.rb
|
109
|
+
- app/helpers/contextual_link_helpers.rb
|
110
|
+
- app/helpers/list_link_helpers.rb
|
111
|
+
- app/assets/stylesheets/i18n_rails_helpers.scss
|
32
112
|
- config/locales/en.yml
|
33
|
-
-
|
113
|
+
- config/locales/de.yml
|
34
114
|
- lib/i18n_rails_helpers.rb
|
35
|
-
- lib/i18n_rails_helpers/
|
115
|
+
- lib/i18n_rails_helpers/engine.rb
|
36
116
|
- lib/i18n_rails_helpers/version.rb
|
37
|
-
-
|
38
|
-
-
|
117
|
+
- lib/boot_form_builder.rb
|
118
|
+
- MIT-LICENSE
|
119
|
+
- Rakefile
|
120
|
+
- README.md
|
39
121
|
homepage: https://github.com/huerlisi/i18n_rails_helpers
|
40
|
-
licenses:
|
122
|
+
licenses:
|
123
|
+
- MIT
|
41
124
|
post_install_message:
|
42
125
|
rdoc_options: []
|
43
126
|
require_paths:
|
@@ -51,9 +134,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
51
134
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
135
|
none: false
|
53
136
|
requirements:
|
54
|
-
- - ! '
|
137
|
+
- - ! '>'
|
55
138
|
- !ruby/object:Gem::Version
|
56
|
-
version:
|
139
|
+
version: 1.3.1
|
57
140
|
requirements: []
|
58
141
|
rubyforge_project:
|
59
142
|
rubygems_version: 1.8.23
|
data/README.markdown
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
I18nRailsHelpers
|
2
|
-
================
|
3
|
-
|
4
|
-
Rails i18n view helpers for things like crud actions, models and and attributes.
|
5
|
-
|
6
|
-
|
7
|
-
Example
|
8
|
-
=======
|
9
|
-
|
10
|
-
t_attr('first_name') => 'Vorname' # when called in patients_controller views
|
11
|
-
t_model => 'Konto' # when called in patients_controller views
|
12
|
-
t_title('delete') => 'Konto löschen' # when called in accounts_controller views
|
13
|
-
t_action('index') => 'Liste'
|
14
|
-
t_confirm_delete(@account) => 'Konto Kasse wirklich löschen'
|
15
|
-
|
16
|
-
|
17
|
-
Copyright (c) 2010 Simon Hürlimann <simon.huerlimann@cyt.ch>
|
18
|
-
Copyright (c) 2010 CyT <http://www.cyt.ch>
|
19
|
-
|
20
|
-
Released under the MIT license.
|
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
|