From a23161e80721192e0f209c8781cdf5b89e587740 Mon Sep 17 00:00:00 2001 From: ponyesteves Date: Fri, 30 Oct 2015 13:47:37 -0300 Subject: [PATCH 1/2] Support for i18n in mailers views. With the en and es respective translations. Also included rusian, polish, french, portuguese (portugal and br) translations by Google Translate. --- .../mailer/confirmation_instructions.html.erb | 6 ++--- .../reset_password_instructions.html.erb | 10 ++++----- .../mailer/unlock_instructions.html.erb | 8 +++---- config/locales/de.yml | 20 ++++++++++++++++- config/locales/en.yml | 19 ++++++++++++++-- config/locales/es.yml | 22 +++++++++++++++++-- config/locales/fr.yml | 22 +++++++++++++++++-- config/locales/pl.yml | 22 +++++++++++++++++-- config/locales/pt-BR.yml | 22 +++++++++++++++++-- config/locales/pt.yml | 22 +++++++++++++++++-- config/locales/ru.yml | 20 ++++++++++++++++- 11 files changed, 167 insertions(+), 26 deletions(-) diff --git a/app/views/devise/mailer/confirmation_instructions.html.erb b/app/views/devise/mailer/confirmation_instructions.html.erb index c233a2165..dba08dc40 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.erb +++ b/app/views/devise/mailer/confirmation_instructions.html.erb @@ -1,5 +1,5 @@ -

Welcome <%= @email %>!

+

<%= t(:welcome).capitalize + ' ' + @email %>!

-

You can confirm your account email through the link below:

+

<%= t '.confirm_link_msg' %>

-

<%= link_to 'Confirm my account', confirmation_url(@resource, {confirmation_token: @token, config: message['client-config'].to_s, redirect_url: message['redirect-url']}).html_safe %>

+

<%= link_to t('.confirm_account_link'), confirmation_url(@resource, {confirmation_token: @token, config: message['client-config'].to_s, redirect_url: message['redirect-url']}).html_safe %>

diff --git a/app/views/devise/mailer/reset_password_instructions.html.erb b/app/views/devise/mailer/reset_password_instructions.html.erb index 859f8eac4..0fc308c40 100644 --- a/app/views/devise/mailer/reset_password_instructions.html.erb +++ b/app/views/devise/mailer/reset_password_instructions.html.erb @@ -1,8 +1,8 @@ -

Hello <%= @resource.email %>!

+

<%= t(:hello).capitalize %> <%= @resource.email %>!

-

Someone has requested a link to change your password. You can do this through the link below.

+

<%= t '.request_reset_link_msg' %>

-

<%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token, config: message['client-config'].to_s, redirect_url: message['redirect-url'].to_s).html_safe %>

+

<%= link_to t('.password_change_link'), edit_password_url(@resource, reset_password_token: @token, config: message['client-config'].to_s, redirect_url: message['redirect-url'].to_s).html_safe %>

-

If you didn't request this, please ignore this email.

-

Your password won't change until you access the link above and create a new one.

+

<%= t '.ignore_mail_msg' %>

+

<%= t '.no_changes_msg' %>

\ No newline at end of file diff --git a/app/views/devise/mailer/unlock_instructions.html.erb b/app/views/devise/mailer/unlock_instructions.html.erb index 8a1c14a94..3beae0f0c 100644 --- a/app/views/devise/mailer/unlock_instructions.html.erb +++ b/app/views/devise/mailer/unlock_instructions.html.erb @@ -1,7 +1,7 @@ -

Hello <%= @resource.email %>!

+

<%= t :hello %> <%= @resource.email %>!

-

Your account has been locked due to an excessive number of unsuccessful sign in attempts.

+

<%= t '.account_lock_msg' %>

-

Click the link below to unlock your account:

+

<%= t '.unlock_link_msg' %>

-

<%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token).html_safe %>

+

<%= link_to t('.unlock_link'), unlock_url(@resource, unlock_token: @token) %>

diff --git a/config/locales/de.yml b/config/locales/de.yml index e0eccb44e..5e21cf41b 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -23,10 +23,28 @@ de: password_not_required: "Dieser Account benötigt kein Passwort. Melden Sie Sich stattdessen über Ihren Account bei %{provider} an." missing_passwords: 'Sie müssen die Felder "Passwort" and "Passwortbestätigung" ausfüllen.' successfully_updated: "Ihr Passwort wurde erfolgreich aktualisiert." - errors: validate_sign_up_params: "Bitte übermitteln sie vollständige Anmeldeinformationen im Body des Requests." validate_account_update_params: "Bitte übermitteln sie vollständige Informationen zur Aktualisierung im Body des Requests." not_email: "ist keine E-Mail Adresse" messages: already_in_use: "bereits in Verwendung" + devise: + mailer: + confirmation_instructions: + subject: "Bestätigungs-" + confirm_link_msg: "Sie können Ihr Konto E-Mail über den untenstehenden Link bestätigen:" + confirm_account_link: "Ihr Konto zu bestätigen" + reset_password_instructions: + subject: "Wiederherstellungskennwort Anweisungen" + request_reset_link_msg: "Jemand hat einen Link auf Ihr Kennwort zu ändern angefordert. Sie können dies durch den folgenden Link tun:" + password_change_link: "Kennwort ändern" + ignore_mail_msg: "Wenn Sie nicht angefordert haben diese , ignorieren Sie bitte diese E-Mail:" + no_changes_msg: "Ihr Passwort wird nicht geändert , bis Sie auf den obigen Link zugreifen und eine neue erstellen ." + unlock_instructions: + subject: "entsperren Anweisungen" + account_lock_msg: "Ihr Konto wurde aufgrund einer übermäßigen Anzahl von erfolglosen Zeichen in Versuchen gesperrt." + unlock_link_msg: "Klicken Sie auf den Link unten , um Ihr Konto zu entsperren :" + unlock_link: "Entsperren Sie Ihr Konto " + hello: "hallo" + welcome: "willkommen" \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index ac0bdc285..82c633cfc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -23,10 +23,25 @@ en: password_not_required: "This account does not require a password. Sign in using your %{provider} account instead." missing_passwords: 'You must fill out the fields labeled "password" and "password confirmation".' successfully_updated: "Your password has been successfully updated." - errors: validate_sign_up_params: "Please submit proper sign up data in request body." validate_account_update_params: "Please submit proper account update data in request body." not_email: "is not an email" messages: - already_in_use: already in use \ No newline at end of file + already_in_use: already in use + devise: + mailer: + confirmation_instructions: + confirm_link_msg: "You can confirm your account email through the link below:" + confirm_account_link: Confirm my account + reset_password_instructions: + request_reset_link_msg: "Someone has requested a link to change your password. You can do this through the link below." + password_change_link: Change my password + ignore_mail_msg: "If you didn't request this, please ignore this email." + no_changes_msg: "Your password won't change until you access the link above and create a new one." + unlock_instructions: + account_lock_msg: Your account has been locked due to an excessive number of unsuccessful sign in attempts. + unlock_link_msg: "Click the link below to unlock your account:" + unlock_link: Unlock my account + hello: hello + welcome: welcome \ No newline at end of file diff --git a/config/locales/es.yml b/config/locales/es.yml index 018fb6143..649c98193 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -23,10 +23,28 @@ es: password_not_required: "Esta cuenta no requiere contraseña. Iniciar sesión utilizando %{provider}." missing_passwords: 'Debe llenar los campos "contraseña" y "confirmación de contraseña".' successfully_updated: "Su contraseña ha sido actualizada con éxito." - errors: validate_sign_up_params: "Los datos introducidos en la solicitud de acceso no son válidos." validate_account_update_params: "Los datos introducidos en la solicitud de actualización no son válidos." not_email: "no es un correo electrónico" messages: - already_in_use: ya ha sido ocupado \ No newline at end of file + already_in_use: ya ha sido ocupado + devise: + mailer: + confirmation_instructions: + subject: Instrucciones de confirmación + confirm_link_msg: "Para confirmar su cuenta ingrese en el siguiente link:" + confirm_account_link: Confirmar cuenta + reset_password_instructions: + subject: Instrucciones para restablecer su contraseña + request_reset_link_msg: "Ha solicitado un cambio de contraseña. Para continuar ingrese en el siguiente link:" + password_change_link: Cambiar contraseña + ignore_mail_msg: Por favor ignore este mensaje si no ha solicitado esta acción. + no_changes_msg: "Importante: Su contraseña no será actualizada a menos que ingrese en el link." + unlock_instructions: + subject: Instrucciones de desbloqueo + account_lock_msg: Su cuenta ha sido bloqueada debido a sucesivos intentos de ingresos fallidos + unlock_link_msg: "Para desbloquear su cuenta ingrese en el siguiente link:" + unlock_link: Desbloquear cuenta + hello: hola + welcome: bienvenido \ No newline at end of file diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 730f71f8c..646230a7d 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -23,10 +23,28 @@ fr: password_not_required: "Ce compte ne demande pas de mot de passe. Connectez vous plutôt en utilisant %{provider}." missing_passwords: 'Vous devez remplir les champs "mt de passe" et "confirmation de mot de passe".' successfully_updated: "Votre mot de passe a été correctement mis à jour." - errors: validate_sign_up_params: "Les données de l'inscription dans le corps de la requête ne sont pas valides." validate_account_update_params: "Les données de mise à jour dans le corps de la requête ne sont pas valides." not_email: "n'est pas un email" messages: - already_in_use: "déjà utilisé" \ No newline at end of file + already_in_use: "déjà utilisé" + devise: + mailer: + confirmation_instructions: + subject: "Les instructions de confirmation" + confirm_link_msg: "Vous pouvez confirmer votre compte e-mail via le lien ci-dessous :" + confirm_account_link: "Confirmez mon compte" + reset_password_instructions: + subject: "Instructions de mot de passe de récupération" + request_reset_link_msg: "Quelqu'un a demandé un lien pour changer votre mot de passe . Vous pouvez le faire via le lien ci-dessous ." + password_change_link: "Changer mon mot de passe" + ignore_mail_msg: "Si vous ne l'avez pas demandé cela, s'il vous plaît ignorer cet e-mail ." + no_changes_msg: "Votre mot de passe ne changera pas jusqu'à ce que vous accédez au lien ci-dessus et en créer un nouveau ." + unlock_instructions: + subject: "Instructions à débloquer" + account_lock_msg: "Votre compte a été bloqué en raison d' un nombre excessif de signe échec dans les tentatives ." + unlock_link_msg: "Cliquez sur le lien ci-dessous pour déverrouiller votre compte :" + unlock_link: "Déverrouiller mon compte" + hello: bonjour + welcome: bienvenue \ No newline at end of file diff --git a/config/locales/pl.yml b/config/locales/pl.yml index b6f5df5a5..aa4db2e81 100644 --- a/config/locales/pl.yml +++ b/config/locales/pl.yml @@ -23,10 +23,28 @@ pl: password_not_required: "To konto nie wymaga podania hasła. Zaloguj się używając konta %{provider}." missing_passwords: 'Musisz wypełnić wszystkie pola z etykietą "hasło" oraz "potwierdzenie hasła".' successfully_updated: "Twoje hasło zostało zaktualizowane." - errors: validate_sign_up_params: "Proszę dostarczyć odpowiednie dane logowania w ciele zapytania." validate_account_update_params: "Proszę dostarczyć odpowiednie dane aktualizacji konta w ciele zapytania." not_email: "nie jest prawidłowym adresem e-mail" messages: - already_in_use: "już w użyciu" \ No newline at end of file + already_in_use: "już w użyciu" + devise: + mailer: + confirmation_instructions: + subject: "Instrukcji potwierdzania" + confirm_link_msg: "Możesz potwierdzić swój e-mail konta poprzez link poniżej :" + confirm_account_link: "Potwierdź swoje konto" + reset_password_instructions: + subject: "Instrukcje resetowania hasła" + request_reset_link_msg: "Ktoś o link do zmiany hasła . Można to zrobić za pośrednictwem linku poniżej ." + password_change_link: "Zmień hasło" + ignore_mail_msg: "Jeśli jej nie potrzebuję , zignoruj ​​tę wiadomość." + no_changes_msg: "Twoje hasło nie zmieni , dopóki dostęp powyższy link i utwórz nowy ." + unlock_instructions: + subject: "Instrukcje do odblokowania" + account_lock_msg: "Twoje konto zostało zablokowane z powodu zbyt dużej liczby nieudanych znak w próbach ." + unlock_link_msg: "Kliknij poniższy link, aby odblokować konto :" + unlock_link: "Odblokować konto" + hello: halo + welcome: witam \ No newline at end of file diff --git a/config/locales/pt-BR.yml b/config/locales/pt-BR.yml index ac9e026f1..f12a4387f 100644 --- a/config/locales/pt-BR.yml +++ b/config/locales/pt-BR.yml @@ -23,10 +23,28 @@ pt-BR: password_not_required: "Esta conta não necessita de uma senha. Faça login utilizando %{provider}." missing_passwords: 'Preencha a senha e a confirmação de senha.' successfully_updated: "Senha atualizada com sucesso." - errors: validate_sign_up_params: "Os dados submetidos na requisição de cadastro são inválidos." validate_account_update_params: "Os dados submetidos para atualização de conta são inválidos." not_email: "não é um e-mail" messages: - already_in_use: "em uso" \ No newline at end of file + already_in_use: "em uso" + devise: + mailer: + confirmation_instructions: + subject: "Instruções de confirmação" + confirm_link_msg: "Você pode confirmar a sua conta de e-mail através do link abaixo :" + confirm_account_link: "Confirme conta" + reset_password_instructions: + subject: "Instruções para redefinir sua senha" + request_reset_link_msg: "Alguém pediu um link para mudar sua senha. Você pode fazer isso através do link abaixo " + password_change_link: "Alterar a senha" + ignore_mail_msg: "Se você não pediu isso, por favor, ignore este e-mail." + no_changes_msg: "Sua senha não será alterada até que você acessar o link acima e criar um novo." + unlock_instructions: + subject: "Instruções de desbloqueio" + account_lock_msg: "A sua conta foi bloqueada devido a um número excessivo de sinal de sucesso em tentativas." + unlock_link_msg: "Clique no link abaixo para desbloquear sua conta:" + unlock_link: "Desbloquear minha conta" + hello: "olá" + welcome: "bem-vindo" \ No newline at end of file diff --git a/config/locales/pt.yml b/config/locales/pt.yml index 9f7cf3800..f3bcf5cd0 100644 --- a/config/locales/pt.yml +++ b/config/locales/pt.yml @@ -23,10 +23,28 @@ pt: password_not_required: "Esta conta não necessita de uma senha. Faça login utilizando %{provider}." missing_passwords: 'Preencha a senha e a confirmação de senha.' successfully_updated: "Senha atualizada com sucesso." - errors: validate_sign_up_params: "Os dados submetidos na requisição de registo são inválidos." validate_account_update_params: "Os dados submetidos para atualização de conta são inválidos." not_email: "não é um e-mail" messages: - already_in_use: "em uso" \ No newline at end of file + already_in_use: "em uso" + devise: + mailer: + confirmation_instructions: + subject: "Instruções de confirmação" + confirm_link_msg: "Você pode confirmar a sua conta de e-mail através do link abaixo :" + confirm_account_link: "Confirme conta" + reset_password_instructions: + subject: "Instruções para redefinir sua senha" + request_reset_link_msg: "Alguém pediu um link para mudar sua senha. Você pode fazer isso através do link abaixo " + password_change_link: "Alterar a senha" + ignore_mail_msg: "Se você não pediu isso, por favor, ignore este e-mail." + no_changes_msg: "Sua senha não será alterada até que você acessar o link acima e criar um novo." + unlock_instructions: + subject: "Instruções de desbloqueio" + account_lock_msg: "A sua conta foi bloqueada devido a um número excessivo de sinal de sucesso em tentativas." + unlock_link_msg: "Clique no link abaixo para desbloquear sua conta:" + unlock_link: "Desbloquear minha conta" + hello: "olá" + welcome: "bem-vindo" \ No newline at end of file diff --git a/config/locales/ru.yml b/config/locales/ru.yml index 683177f79..28918feb2 100644 --- a/config/locales/ru.yml +++ b/config/locales/ru.yml @@ -23,11 +23,29 @@ ru: password_not_required: "Эта учетная запись не требует пароля. Войдите используя учетную запись %{provider}." missing_passwords: 'Вы должны заполнить поля "пароль" и "повторите пароль".' successfully_updated: "Ваш пароль успешно обновлён." - errors: validate_sign_up_params: "Пожалуйста, укажите надлежащие данные для регистрации в теле запроса." validate_account_update_params: "Пожалуйста, укажите надлежащие данные для обновления учетной записи в теле запроса." not_email: "не является электронной почтой" messages: already_in_use: "уже используется" + devise: + mailer: + confirmation_instructions: + subject: "Инструкции подтверждения" + confirm_link_msg: "Вы можете подтвердить ваш адрес электронной почты через ссылку ниже :" + confirm_account_link: Подтвердите свой ​​счет + reset_password_instructions: + subject: "Инструкции для восстановления пароля" + request_reset_link_msg: "Кто-то просил ссылку , чтобы изменить пароль . Вы можете сделать это через ссылку ниже." + password_change_link: "Изменить пароль" + ignore_mail_msg: "If you didn't request this, please ignore this email." + no_changes_msg: "Ваш пароль не изменится, пока вы не открыть ссылку выше и создать новый." + unlock_instructions: + subject: "Разблокировать Инструкции" + account_lock_msg: "Ваш аккаунт был заблокирован из-за чрезмерного количества неудачных попыток в знак ." + unlock_link_msg: "Нажмите на ссылку ниже, чтобы разблокировать свой ​​аккаунт :" + unlock_link: "Открой свой ​​аккаунт" + hello: "Здравствуйте" + welcome: "Добро пожаловат" From b9b88ecd362c5c9eae01b8f1e9468717aa26d13e Mon Sep 17 00:00:00 2001 From: ValentinTrinque Date: Sat, 21 Nov 2015 01:48:24 +0100 Subject: [PATCH 2/2] Improve french locale --- config/locales/fr.yml | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 646230a7d..940775106 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -1,7 +1,7 @@ fr: devise_token_auth: sessions: - not_confirmed: "Une email de confirmation de votre compte a été envoyé à %{email}. Merci de suivre les instructions afin de valider votre compte" + not_confirmed: "Un e-mail de confirmation de votre compte a été envoyé à %{email}. Merci de suivre les instructions afin de valider votre compte" bad_credentials: "Mot de passe ou identifiant invalide." not_supported: "Utilisez POST /sign_in pour la connexion. GET n'est pas supporté." user_not_found: "L'utilisateur est inconnu ou n'est pas connecté." @@ -10,41 +10,41 @@ fr: registrations: missing_confirm_success_url: "Le paramètre `confirm_success_url` est manquant." redirect_url_not_allowed: "Redirection vers %{redirect_url} n'est pas autorisée." - email_already_exists: "Un compte existe déjà avec cet email: %{email}" + email_already_exists: "Un compte existe déjà avec cette addresse e-mail: %{email}" account_with_uid_destroyed: "Le compte avec l'identifiant %{uid} a été supprimé." - account_to_destroy_not_found: "Impossible de trouver le compte à supprimer." - user_not_found: "Utilisateur non trouvé." + account_to_destroy_not_found: "Le compte à supprimer est introuvable." + user_not_found: "Utilisateur introuvable." passwords: - missing_email: "Vous devez soumettre un email." - missing_redirect_url: "Url de redirection manquante." + missing_email: "Vous devez soumettre un e-mail." + missing_redirect_url: "URL de redirection manquante." not_allowed_redirect_url: "Redirection vers %{redirect_url} n'est pas autorisée." - sended: "Un email a été envoyé à %{email} avec les instructions pour réinitialiser votre mot de passe." - user_not_found: "Impossible de trouver un utilisateur avec cet email: '%{email}'." - password_not_required: "Ce compte ne demande pas de mot de passe. Connectez vous plutôt en utilisant %{provider}." - missing_passwords: 'Vous devez remplir les champs "mt de passe" et "confirmation de mot de passe".' + sended: "Un e-mail a été envoyé à %{email} avec les instructions de réinitialisation du mot de passe." + user_not_found: "Impossible de trouver l'utilisateur avec l'adresse e-mail: '%{email}'." + password_not_required: "Ce compte ne demande pas de mot de passe. Connectez vous en utilisant %{provider}." + missing_passwords: 'Vous devez remplir les champs "mot de passe" et "confirmation de mot de passe".' successfully_updated: "Votre mot de passe a été correctement mis à jour." errors: - validate_sign_up_params: "Les données de l'inscription dans le corps de la requête ne sont pas valides." + validate_sign_up_params: "Les données d'inscription dans le corps de la requête ne sont pas valides." validate_account_update_params: "Les données de mise à jour dans le corps de la requête ne sont pas valides." - not_email: "n'est pas un email" + not_email: "n'est pas une adresse e-mail" messages: already_in_use: "déjà utilisé" devise: mailer: confirmation_instructions: - subject: "Les instructions de confirmation" + subject: "Instructions de confirmation" confirm_link_msg: "Vous pouvez confirmer votre compte e-mail via le lien ci-dessous :" - confirm_account_link: "Confirmez mon compte" + confirm_account_link: "Confirmer mon compte" reset_password_instructions: - subject: "Instructions de mot de passe de récupération" - request_reset_link_msg: "Quelqu'un a demandé un lien pour changer votre mot de passe . Vous pouvez le faire via le lien ci-dessous ." + subject: "Instructions de récupération de mot de passe" + request_reset_link_msg: "Quelqu'un a demandé un lien pour changer votre mot de passe. Pour procéder ainsi, suivez le lien ci-dessous." password_change_link: "Changer mon mot de passe" - ignore_mail_msg: "Si vous ne l'avez pas demandé cela, s'il vous plaît ignorer cet e-mail ." - no_changes_msg: "Votre mot de passe ne changera pas jusqu'à ce que vous accédez au lien ci-dessus et en créer un nouveau ." + ignore_mail_msg: "Si vous n'avez pas demandé cela, veuillez ignorer cet e-mail." + no_changes_msg: "Votre mot de passe ne changera pas tant que vous n'accédez pas au lien ci-dessus pour en créer un nouveau." unlock_instructions: - subject: "Instructions à débloquer" - account_lock_msg: "Votre compte a été bloqué en raison d' un nombre excessif de signe échec dans les tentatives ." - unlock_link_msg: "Cliquez sur le lien ci-dessous pour déverrouiller votre compte :" + subject: "Instructions de déblocage" + account_lock_msg: "Votre compte a été bloqué en raison de nombreuses tentatives de connection erronées." + unlock_link_msg: "Cliquez sur le lien ci-dessous pour déverrouiller votre compte:" unlock_link: "Déverrouiller mon compte" hello: bonjour welcome: bienvenue \ No newline at end of file