devise-i18n-views 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +16 -6
- data/VERSION +1 -1
- data/app/views/devise/confirmations/new.html.erb +2 -2
- data/app/views/devise/passwords/new.html.erb +2 -2
- data/app/views/devise/registrations/edit.html.erb +4 -4
- data/app/views/devise/registrations/new.html.erb +2 -2
- data/app/views/devise/sessions/new.html.erb +2 -2
- data/app/views/devise/shared/_links.erb +6 -6
- data/app/views/devise/unlocks/new.html.erb +2 -2
- data/devise-i18n-views.gemspec +5 -4
- data/lib/generators/devise_i18n_views/locale/locale_generator.rb +8 -0
- data/{config/locales → locales}/en.yml +23 -23
- data/{config/locales → locales}/it.yml +23 -23
- metadata +5 -4
data/README.md
CHANGED
@@ -1,25 +1,35 @@
|
|
1
1
|
# devise-i18n-views
|
2
2
|
|
3
|
-
I18n support and translations
|
3
|
+
I18n support and translations for **[Devise v2.+](https://github.com/plataformatec/devise)** views.
|
4
4
|
|
5
5
|
## Install
|
6
6
|
|
7
|
-
Add the following line
|
7
|
+
Add the following line to your `Gemfile`
|
8
8
|
|
9
9
|
``` rb
|
10
|
-
|
10
|
+
gem 'devise-i18n-views'
|
11
11
|
```
|
12
12
|
|
13
|
-
|
13
|
+
and run `bundle install`.
|
14
|
+
|
15
|
+
Then you need to install the required translations in your `config/locales`. You can do this either manually (downloading them from [devise-i18n-views/locales](https://github.com/mcasimir/devise-i18n-views/tree/master/locales)) or through the apposite generator `devise_i18n_views:locale`, eg.
|
16
|
+
|
17
|
+
``` sh
|
18
|
+
rails g devise_i18n_views:locale it
|
19
|
+
```
|
14
20
|
|
15
|
-
|
21
|
+
will generate `config/locales/devise.views.it.yml`.
|
16
22
|
|
17
23
|
## Submit or edit a translation for devise-i18n-views
|
18
24
|
|
19
25
|
* Fork the latest master
|
20
|
-
* Create a translation file or edit an existing one under `
|
26
|
+
* Create a translation file or edit an existing one under `locales`
|
21
27
|
* Make a pull request
|
22
28
|
|
29
|
+
## Translation file stub
|
30
|
+
|
31
|
+
Please refer to [devise-i18n-views/locales/en.yml](https://github.com/mcasimir/devise-i18n-views/blob/master/locales/en.yml) to grab a stub for your translation
|
32
|
+
|
23
33
|
## Copyright
|
24
34
|
|
25
35
|
Copyright (c) 2012 mcasimir. See LICENSE.txt for
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.2.0
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<h2><%= t('
|
1
|
+
<h2><%= t('.resend_confirmation_instructions', :default => 'Resend confirmation instructions') %></h2>
|
2
2
|
|
3
3
|
<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
|
4
4
|
<%= devise_error_messages! %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<div><%= f.label :email %><br />
|
7
7
|
<%= f.email_field :email %></div>
|
8
8
|
|
9
|
-
<div><%= t('
|
9
|
+
<div><%= 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('
|
1
|
+
<h2><%= t('.forgot_your_password', :default => 'Forgot your password?') %></h2>
|
2
2
|
|
3
3
|
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
|
4
4
|
<%= devise_error_messages! %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<div><%= f.label :email %><br />
|
7
7
|
<%= f.email_field :email %></div>
|
8
8
|
|
9
|
-
<div><%= f.submit t('
|
9
|
+
<div><%= f.submit t('.send_me_reset_password_instructions', :default => "Send me reset password instructions") %></div>
|
10
10
|
<% end %>
|
11
11
|
|
12
12
|
<%= render "devise/shared/links" %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<h2><%= t('
|
1
|
+
<h2><%= t('.title', :resource => resource_name.to_s.humanize , :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! %>
|
@@ -6,13 +6,13 @@
|
|
6
6
|
<div><%= f.label :email %><br />
|
7
7
|
<%= f.email_field :email %></div>
|
8
8
|
|
9
|
-
<div><%= f.label :password %> <i>(<%= t('
|
9
|
+
<div><%= f.label :password %> <i>(<%= t('.leave_blank_if_you_don_t_want_to_change_it', :default => "leave blank if you don't want to change it") %>)</i><br />
|
10
10
|
<%= f.password_field :password, :autocomplete => "off" %></div>
|
11
11
|
|
12
12
|
<div><%= f.label :password_confirmation %><br />
|
13
13
|
<%= f.password_field :password_confirmation %></div>
|
14
14
|
|
15
|
-
<div><%= f.label :current_password %> <i>(<%= t('
|
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
18
|
<div><%= f.submit "Update" %></div>
|
@@ -20,6 +20,6 @@
|
|
20
20
|
|
21
21
|
<h3>Cancel my account</h3>
|
22
22
|
|
23
|
-
<p>Unhappy? <%= link_to t('
|
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>
|
24
24
|
|
25
25
|
<%= link_to "Back", :back %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<h2><%= t('
|
1
|
+
<h2><%= t('.sign_up', :default => "Sign up") %></h2>
|
2
2
|
|
3
3
|
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
|
4
4
|
<%= devise_error_messages! %>
|
@@ -12,7 +12,7 @@
|
|
12
12
|
<div><%= f.label :password_confirmation %><br />
|
13
13
|
<%= f.password_field :password_confirmation %></div>
|
14
14
|
|
15
|
-
<div><%= f.submit t('
|
15
|
+
<div><%= f.submit t('.sign_up', :default => "Sign up") %></div>
|
16
16
|
<% end %>
|
17
17
|
|
18
18
|
<%= render "devise/shared/links" %>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<h2><%= t('
|
1
|
+
<h2><%= t('.sign_in', :default => "Sign in") %></h2>
|
2
2
|
|
3
3
|
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
4
4
|
<div><%= f.label :email %><br />
|
@@ -11,7 +11,7 @@
|
|
11
11
|
<div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
|
12
12
|
<% end -%>
|
13
13
|
|
14
|
-
<div><%= f.submit t('
|
14
|
+
<div><%= f.submit t('.sign_in', :default => "Sign in") %></div>
|
15
15
|
<% end %>
|
16
16
|
|
17
17
|
<%= render "devise/shared/links" %>
|
@@ -1,25 +1,25 @@
|
|
1
1
|
<%- if controller_name != 'sessions' %>
|
2
|
-
<%= link_to t("
|
2
|
+
<%= link_to t(".sign_in", :default => "Sign in"), new_session_path(resource_name) %><br />
|
3
3
|
<% end -%>
|
4
4
|
|
5
5
|
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
6
|
-
<%= link_to t("
|
6
|
+
<%= link_to t(".sign_up", :default => "Sign up"), new_registration_path(resource_name) %><br />
|
7
7
|
<% end -%>
|
8
8
|
|
9
9
|
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
|
10
|
-
<%= link_to t("
|
10
|
+
<%= link_to t(".forgot_your_password", :default => "Forgot your password?"), new_password_path(resource_name) %><br />
|
11
11
|
<% end -%>
|
12
12
|
|
13
13
|
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
14
|
-
<%= link_to t('
|
14
|
+
<%= link_to t('.didn_t_receive_confirmation_instructions', :default => "Didn't receive confirmation instructions?"), new_confirmation_path(resource_name) %><br />
|
15
15
|
<% end -%>
|
16
16
|
|
17
17
|
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
18
|
-
<%= link_to t('
|
18
|
+
<%= link_to t('.didn_t_receive_unlock_instructions', :default => "Didn't receive unlock instructions?"), new_unlock_path(resource_name) %><br />
|
19
19
|
<% end -%>
|
20
20
|
|
21
21
|
<%- if devise_mapping.omniauthable? %>
|
22
22
|
<%- resource_class.omniauth_providers.each do |provider| %>
|
23
|
-
<%= link_to t('
|
23
|
+
<%= link_to t('.sign_in_with_provider', :provider => provider.to_s.titleize, :default => "Sign in with #{provider.to_s.titleize}"), omniauth_authorize_path(resource_name, provider) %><br />
|
24
24
|
<% end -%>
|
25
25
|
<% end -%>
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<h2><%= t('
|
1
|
+
<h2><%= t('.resend_unlock_instructions', :default => "Resend unlock instructions") %></h2>
|
2
2
|
|
3
3
|
<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
|
4
4
|
<%= devise_error_messages! %>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<div><%= f.label :email %><br />
|
7
7
|
<%= f.email_field :email %></div>
|
8
8
|
|
9
|
-
<div><%= f.submit t('
|
9
|
+
<div><%= f.submit t('.resend_unlock_instructions', :default => "Resend unlock instructions") %></div>
|
10
10
|
<% end %>
|
11
11
|
|
12
12
|
<%= render "devise/shared/links" %>
|
data/devise-i18n-views.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "devise-i18n-views"
|
8
|
-
s.version = "0.
|
8
|
+
s.version = "0.2.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["mcasimir"]
|
@@ -36,10 +36,11 @@ Gem::Specification.new do |s|
|
|
36
36
|
"app/views/devise/sessions/new.html.erb",
|
37
37
|
"app/views/devise/shared/_links.erb",
|
38
38
|
"app/views/devise/unlocks/new.html.erb",
|
39
|
-
"config/locales/en.yml",
|
40
|
-
"config/locales/it.yml",
|
41
39
|
"devise-i18n-views.gemspec",
|
42
|
-
"lib/devise-i18n-views.rb"
|
40
|
+
"lib/devise-i18n-views.rb",
|
41
|
+
"lib/generators/devise_i18n_views/locale/locale_generator.rb",
|
42
|
+
"locales/en.yml",
|
43
|
+
"locales/it.yml"
|
43
44
|
]
|
44
45
|
s.homepage = "http://github.com/mcasimir/devise-i18n-views"
|
45
46
|
s.licenses = ["MIT"]
|
@@ -0,0 +1,8 @@
|
|
1
|
+
module DeviseI18nViews
|
2
|
+
class LocaleGenerator < Rails::Generators::NamedBase
|
3
|
+
source_root File.expand_path('../../../../../locales', __FILE__)
|
4
|
+
def copy_locale
|
5
|
+
copy_file("#{name}.yml", Rails.root.join("config", "locales", "devise.views.#{name}.yml"))
|
6
|
+
end
|
7
|
+
end
|
8
|
+
end
|
@@ -19,26 +19,26 @@ en:
|
|
19
19
|
message: "Your account has been locked due to an excessive amount of unsuccessful sign in attempts."
|
20
20
|
instruction: "Click the link below to unlock your account:"
|
21
21
|
action: "Unlock my account"
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
22
|
+
confirmations:
|
23
|
+
new:
|
24
|
+
resend_confirmation_instructions: "Resend confirmation instructions"
|
25
|
+
passwords:
|
26
|
+
new:
|
27
|
+
forgot_your_password: "Forgot your password?"
|
28
|
+
send_me_reset_password_instructions: "Send me reset password instructions"
|
29
|
+
registrations:
|
30
|
+
edit:
|
31
|
+
title: "Edit %{resource}"
|
32
|
+
leave_blank_if_you_don_t_want_to_change_it: "leave blank if you dont want to change it"
|
33
|
+
we_need_your_current_password_to_confirm_your_changes: "we need your current password to confirm your changes"
|
34
|
+
cancel_my_account: "Cancel my account"
|
35
|
+
are_you_sure: "Are you sure?"
|
36
|
+
new:
|
37
|
+
sign_up: "Sign up"
|
38
|
+
sessions:
|
39
|
+
new:
|
40
|
+
sign_in: "Sign in"
|
41
|
+
shared:
|
42
42
|
links:
|
43
43
|
didn_t_receive_confirmation_instructions: "Didn't receive confirmation instructions?"
|
44
44
|
didn_t_receive_unlock_instructions: "Didn't receive unlock instructions?"
|
@@ -46,6 +46,6 @@ en:
|
|
46
46
|
sign_in: "Sign in"
|
47
47
|
sign_up: "Sign up"
|
48
48
|
sign_in_with_provider: "Sign in with %{provider}"
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
unlocks:
|
50
|
+
new:
|
51
|
+
resend_unlock_instructions: "Resend unlock instructions"
|
@@ -19,26 +19,26 @@ it:
|
|
19
19
|
message: 'Il tuo account è stato bloccato a seguito di un numero eccessivo di tentativi di accesso falliti.'
|
20
20
|
instruction: 'Clicca sul link qui sotto per sbloccare il tuo account:'
|
21
21
|
action: "Sblocca il mio account"
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
22
|
+
confirmations:
|
23
|
+
new:
|
24
|
+
resend_confirmation_instructions: "Invia di nuovo le istruzioni per la conferma"
|
25
|
+
passwords:
|
26
|
+
new:
|
27
|
+
forgot_your_password: "Password dimenticata?"
|
28
|
+
send_me_reset_password_instructions: "Inviami le istruzioni per resettare la password"
|
29
|
+
registrations:
|
30
|
+
edit:
|
31
|
+
title: "Modifica %{resource}"
|
32
|
+
leave_blank_if_you_don_t_want_to_change_it: "lascia in bianco se non vuoi cambiarla"
|
33
|
+
we_need_your_current_password_to_confirm_your_changes: "abbiamo bisogno della tua password attuale per confermare i cambiamenti"
|
34
|
+
cancel_my_account: "Rimuovi il mio account"
|
35
|
+
are_you_sure: "Sei sicuro?"
|
36
|
+
new:
|
37
|
+
sign_up: "Registrati"
|
38
|
+
sessions:
|
39
|
+
new:
|
40
|
+
sign_in: "Accedi"
|
41
|
+
shared:
|
42
42
|
links:
|
43
43
|
forgot_your_password: "Password dimenticata?"
|
44
44
|
sign_up: "Registrati"
|
@@ -46,7 +46,7 @@ it:
|
|
46
46
|
sign_in_with_provider: "Accedi con %{provider}"
|
47
47
|
didn_t_receive_confirmation_instructions: "Non hai ricevuto le istruzioni per la conferma?"
|
48
48
|
didn_t_receive_unlock_instructions: "Non hai ricevuto le istruzioni per lo sblocco?"
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
unlocks:
|
50
|
+
new:
|
51
|
+
resend_unlock_instructions: "Invia di nuovo le istruzioni per lo sblocco"
|
52
52
|
|
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.
|
4
|
+
version: 0.2.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -70,10 +70,11 @@ files:
|
|
70
70
|
- app/views/devise/sessions/new.html.erb
|
71
71
|
- app/views/devise/shared/_links.erb
|
72
72
|
- app/views/devise/unlocks/new.html.erb
|
73
|
-
- config/locales/en.yml
|
74
|
-
- config/locales/it.yml
|
75
73
|
- devise-i18n-views.gemspec
|
76
74
|
- lib/devise-i18n-views.rb
|
75
|
+
- lib/generators/devise_i18n_views/locale/locale_generator.rb
|
76
|
+
- locales/en.yml
|
77
|
+
- locales/it.yml
|
77
78
|
homepage: http://github.com/mcasimir/devise-i18n-views
|
78
79
|
licenses:
|
79
80
|
- MIT
|
@@ -89,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
89
90
|
version: '0'
|
90
91
|
segments:
|
91
92
|
- 0
|
92
|
-
hash:
|
93
|
+
hash: -1969737330795035709
|
93
94
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
94
95
|
none: false
|
95
96
|
requirements:
|