Permalink
Browse files

Translating Devise Views

  • Loading branch information...
akitaonrails committed Jul 14, 2012
1 parent d434176 commit 0ff207ed9ea58a14a16c14fc11272a3991918dab
@@ -1,12 +1,12 @@
-<h2>Resend confirmation instructions</h2>
+<h1><%= t(".title") %></h1>
<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :email %><br />
<%= f.email_field :email %></div>
- <div><%= f.submit "Resend confirmation instructions" %></div>
+ <div><%= f.submit t(".submit") %></div>
<% end %>
<%= render "devise/shared/links" %>
@@ -1,4 +1,4 @@
-<h2>Change your password</h2>
+<h2><%= t(".title") %></h2>
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
<%= devise_error_messages! %>
@@ -10,7 +10,7 @@
<div><%= f.label :password_confirmation, "Confirm new password" %><br />
<%= f.password_field :password_confirmation %></div>
- <div><%= f.submit "Change my password" %></div>
+ <div><%= f.submit t(".submit") %></div>
<% end %>
<%= render "devise/shared/links" %>
@@ -1,12 +1,12 @@
-<h2>Forgot your password?</h2>
+<h2><%= t(".title") %></h2>
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :email %><br />
<%= f.email_field :email %></div>
- <div><%= f.submit "Send me reset password instructions" %></div>
+ <div><%= f.submit t(".submit") %></div>
<% end %>
<%= render "devise/shared/links" %>
@@ -1,4 +1,4 @@
-<h2>Edit <%= resource_name.to_s.humanize %></h2>
+<h2><%= t ".title", resource: resource_name.to_s.humanize %></h2>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
<%= devise_error_messages! %>
@@ -15,11 +15,11 @@
<div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
<%= f.password_field :current_password %></div>
- <div><%= f.submit "Update" %></div>
+ <div><%= f.submit t(".update") %></div>
<% end %>
-<h3>Cancel my account</h3>
+<h3><%= t(".cancel.title") %></h3>
-<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %>.</p>
+<p><%= t(".cancel.message") %> <%= link_to t(".cancel.action"), registration_path(resource_name), :data => { :confirm => t(".cancel.confirm") }, :method => :delete %>.</p>
<%= link_to "Back", :back %>
@@ -1,4 +1,4 @@
-<h2>Sign up</h2>
+<h2><%= t(".title") %></h2>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
@@ -12,7 +12,7 @@
<div><%= f.label :password_confirmation %><br />
<%= f.password_field :password_confirmation %></div>
- <div><%= f.submit "Sign up" %></div>
+ <div><%= f.submit t(".submit") %></div>
<% end %>
<%= render "devise/shared/links" %>
@@ -1,4 +1,4 @@
-<h2>Sign in</h2>
+<h2><%= t(".title") %></h2>
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
<div><%= f.label :email %><br />
@@ -11,7 +11,7 @@
<div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
<% end -%>
- <div><%= f.submit "Sign in" %></div>
+ <div><%= f.submit t(".submit") %></div>
<% end %>
<%= render "devise/shared/links" %>
@@ -1,25 +1,25 @@
<%- if controller_name != 'sessions' %>
- <%= link_to "Sign in", new_session_path(resource_name) %><br />
+ <%= link_to t("devise.sessions.new.title"), new_session_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
- <%= link_to "Sign up", new_registration_path(resource_name) %><br />
+ <%= link_to t("devise.registrations.new.title"), new_registration_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
- <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
+ <%= link_to t("devise.passwords.new.title"), new_password_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
- <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
+ <%= link_to t("devise.confirmations.link"), new_confirmation_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
- <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
+ <%= link_to t("devise.unlocks.link"), new_unlock_path(resource_name) %><br />
<% end -%>
<%- if devise_mapping.omniauthable? %>
<%- resource_class.omniauth_providers.each do |provider| %>
- <%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
+ <%= link_to t("devise.sessions.link", provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider) %><br />
<% end -%>
-<% end -%>
+<% end -%>
@@ -1,12 +1,12 @@
-<h2>Resend unlock instructions</h2>
+<h1><%= t(".title") %></h1>
<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :email %><br />
<%= f.email_field :email %></div>
- <div><%= f.submit "Resend unlock instructions" %></div>
+ <div><%= f.submit t(".submit") %></div>
<% end %>
<%= render "devise/shared/links" %>
@@ -0,0 +1,37 @@
+en:
+ devise:
+ confirmations:
+ new:
+ title: Resend confirmation instructions
+ submit: Resend confirmation instructions
+ link: Didn't receive confirmation instructions?
+ passwords:
+ edit:
+ title: Change your password
+ submit: Change my password
+ new:
+ title: Forgot your password?
+ submit: Send me reset password instructions
+ registrations:
+ edit:
+ title: Edit {resource}
+ update: Update
+ cancel:
+ title: Cancel my account
+ message: Unhappy?
+ action: Cancel my account
+ confirm: Are you sure?
+ back: Back
+ new:
+ title: Sign up
+ submit: Sign up
+ sessions:
+ new:
+ title: Sign in
+ submit: Sign in
+ link: Sign in with {provider}
+ unlocks:
+ new:
+ title: Resend unlock instructions
+ submit: Resend unlock instructions
+ link: Didn't receive unlock instructions?
@@ -0,0 +1,38 @@
+pt-BR:
+ devise:
+ confirmations:
+ new:
+ title: Reenviar instruções de confirmação
+ submit: Reenviar instruções de confirmação
+ link: Não recebeu instruções de confirmação?
+ passwords:
+ edit:
+ title: Mudar sua senha
+ submit: Mudar minha senha
+ new:
+ title: Esqueceu sua senha?
+ submit: Me enviar instruções para reiniciar minha senha
+ registrations:
+ edit:
+ title: Editar {resource}
+ update: Atualizar
+ cancel:
+ title: Cancelar minha conta
+ message: Não está contente?
+ action: Cancelar minha conta
+ confirm: Tem certeza?
+ back: Voltar
+ new:
+ title: Registrar
+ submit: Registrar
+ sessions:
+ new:
+ title: Login
+ submit: Login
+ link: Login com {provider}
+ unlocks:
+ new:
+ title: Reenviar instruções de desbloqueio
+ submit: Reenviar instruções de desbloqueio
+ link: Não recebeu instruções de desbloqueio?
+
@@ -7,3 +7,4 @@ en:
email: "Email"
password: "Password"
password_confirmation: "Password Confirmation"
+ remember_me: "Remember me"
@@ -213,6 +213,8 @@ pt-BR:
email: "E-mail"
password: "Senha"
password_confirmation: "Confirmar Senha"
+ current_password: "Senha Atual"
+ remember_me: "Lembre-se de mim"
article:
title: "Título"
body: "Conteúdo"

0 comments on commit 0ff207e

Please sign in to comment.