devise-i18n-views 0.2.5 → 0.2.6

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.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.5
1
+ 0.2.6
@@ -6,7 +6,7 @@
6
6
  <div><%= f.label :email %><br />
7
7
  <%= f.email_field :email %></div>
8
8
 
9
- <div><%= t('.resend_confirmation_instructions', :default => 'Resend confirmation instructions') %></div>
9
+ <div><%= f.submit t('.resend_confirmation_instructions', :default => 'Resend confirmation instructions') %></div>
10
10
  <% end %>
11
11
 
12
12
  <%= render "devise/shared/links" %>
@@ -1,4 +1,4 @@
1
- <h2><%= t('.title', :resource => resource_name.to_s.humanize , :default => 'Edit #{resource_name.to_s.humanize}') %></h2>
1
+ <h2><%= t('.title', :resource => resource_class.model_name.human , :default => 'Edit #{resource_name.to_s.humanize}') %></h2>
2
2
 
3
3
  <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
4
4
  <%= devise_error_messages! %>
@@ -15,11 +15,11 @@
15
15
  <div><%= f.label :current_password %> <i>(<%= t('.we_need_your_current_password_to_confirm_your_changes', :default => 'we need your current password to confirm your changes') %>)</i><br />
16
16
  <%= f.password_field :current_password %></div>
17
17
 
18
- <div><%= f.submit "Update" %></div>
18
+ <div><%= f.submit t('.update', :default => "Update") %></div>
19
19
  <% end %>
20
20
 
21
- <h3>Cancel my account</h3>
21
+ <h3><%= t('.cancel_my_account', :default => 'Cancel my account') %></h3>
22
22
 
23
- <p>Unhappy? <%= link_to t('.cancel_my_account', :default => "Cancel my account"), registration_path(resource_name), :data => { :confirm => t('.are_you_sure', :default => "Are you sure?") }, :method => :delete %>.</p>
23
+ <p><%= t('.unhappy', :default => 'Unhappy') %>? <%= link_to t('.cancel_my_account', :default => "Cancel my account"), registration_path(resource_name), :data => { :confirm => t('.are_you_sure', :default => "Are you sure?") }, :method => :delete %>.</p>
24
24
 
25
25
  <%= link_to "Back", :back %>
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "devise-i18n-views"
8
- s.version = "0.2.5"
8
+ s.version = "0.2.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["mcasimir"]
@@ -2,4 +2,22 @@ require 'rails'
2
2
  module DeviseI18nViews
3
3
  class Engine < ::Rails::Engine
4
4
  end
5
+
6
+ class Railtie < ::Rails::Railtie #:nodoc:
7
+ initializer 'rails-i18n-views' do |app|
8
+ DeviseI18nViews::Railtie.instance_eval do
9
+ pattern = pattern_from app.config.i18n.available_locales
10
+
11
+ files = Dir[File.join(File.dirname(__FILE__), '../locales', "#{pattern}.yml")]
12
+ I18n.load_path.concat(files)
13
+ end
14
+ end
15
+
16
+ protected
17
+
18
+ def self.pattern_from(args)
19
+ array = Array(args || [])
20
+ array.blank? ? '*' : "{#{array.join ','}}"
21
+ end
22
+ end
5
23
  end
@@ -4,7 +4,7 @@ module Devise
4
4
  source_root File.expand_path('../../../../../../app/views', __FILE__)
5
5
  def copy_views
6
6
  directory("devise", Rails.root.join("app", "views", "devise"))
7
- end
7
+ end
8
8
  end
9
9
  end
10
10
  end
@@ -4,7 +4,7 @@ module Devise
4
4
  source_root File.expand_path('../../../../../../locales', __FILE__)
5
5
  def copy_locale
6
6
  copy_file("#{name}.yml", Rails.root.join("config", "locales", "devise.views.#{name}.yml"))
7
- end
7
+ end
8
8
  end
9
9
  end
10
10
  end
data/locales/en.yml CHANGED
@@ -38,6 +38,9 @@ en:
38
38
  leave_blank_if_you_don_t_want_to_change_it: leave blank if you dont want to change it
39
39
  title: Edit %{resource}
40
40
  we_need_your_current_password_to_confirm_your_changes: we need your current password to confirm your changes
41
+ update: Update
42
+ cancel_my_account: Cancel my account
43
+ unhappy: Unhappy
41
44
  new:
42
45
  sign_up: Sign up
43
46
  sessions:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: devise-i18n-views
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -147,9 +147,6 @@ required_ruby_version: !ruby/object:Gem::Requirement
147
147
  - - ! '>='
148
148
  - !ruby/object:Gem::Version
149
149
  version: '0'
150
- segments:
151
- - 0
152
- hash: -1462681026008733906
153
150
  required_rubygems_version: !ruby/object:Gem::Requirement
154
151
  none: false
155
152
  requirements:
@@ -158,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
158
155
  version: '0'
159
156
  requirements: []
160
157
  rubyforge_project:
161
- rubygems_version: 1.8.24
158
+ rubygems_version: 1.8.25
162
159
  signing_key:
163
160
  specification_version: 3
164
161
  summary: I18n support for devise views