Skip to content

Commit

Permalink
Add translations
Browse files Browse the repository at this point in the history
  • Loading branch information
fedescarpa committed Oct 15, 2021
1 parent c1ce5c5 commit 7466339
Show file tree
Hide file tree
Showing 10 changed files with 76 additions and 34 deletions.
10 changes: 5 additions & 5 deletions app/views/user_mailer/_mail_template.erb
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@
<% end %>

</div>
<div style="background-color: #F7F9FC;color: #6A7C94; padding: 32px;">
<div style="background-color: #F7F9FC;color: #6A7C94; padding: 32px">

<div style="font-size: 10px">
<div style="font-size: 10px">
<p>
Si tenés problemas con la plataforma escribinos a <a href="mailto:<%= @organization.contact_email %>" target="_blank" style="color: #17687D;"><%= @organization.contact_email %></a>.
<%= t('mailer.footer.problems', link: link_to(@organization.contact_email, "mailto:#{@organization.contact_email}", target: '_blank', style: 'color: #17687D')).html_safe %>
</p>
<p>
Podés dejar de recibir estos mails <a href="<%= @organization.url_for '/user/notifications/manage' %>" target="_blank" style="color: #17687D;">modificando tus preferencias</a>.
<%= t('mailer.footer.unsubscribe', link: link_to(t('mailer.footer.unsubscribe_link'), @organization.url_for('/user/notifications/manage'), target: '_blank', style: 'color: #17687D')).html_safe %>
</p>
</div>

Expand All @@ -48,7 +48,7 @@
<div style="height: 20px; width: 50%; text-align: right">
<a href="https://www.twitter.com/MumukiOrg" style="color: unset; padding-left: 16px;"><img src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-color-twitter-48.png" height="24" width="24"></a>
<a href="https://www.facebook.com/MumukiOrg" style="color: unset; padding-left: 16px;"><img src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-color-facebook-48.png" height="24" width="24"></a>
<a href="https://www.instagram.com/MumukiOrg" style="color: unset; padding-left: 16px;"><img src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-color-instagram-48.png" height="24" width="24""></a>
<a href="https://www.instagram.com/MumukiOrg" style="color: unset; padding-left: 16px;"><img src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-color-instagram-48.png" height="24" width="24"></a>
</div>
</div>
</div>
Expand Down
8 changes: 4 additions & 4 deletions app/views/user_mailer/certificate.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= render partial: 'user_mailer/mail_template', locals: {
title: t(:congratulations),
subtitle: t(:certificate_available),
text: t(:certificate_download),
button: t(:my_profile),
title: t('mailer.title.certificate'),
subtitle: t('mailer.subtitle.certificate'),
text: t('mailer.text.certificate'),
button: t('mailer.button.certificate'),
url: @organization.url_for('/user/certificates')
} %>
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
<%= render inline: target.custom_html %>
<% else %>
<%= render partial: 'user_mailer/mail_template', locals: {
title: t("mailer.title.custom"),
title: t("mailer.title.custom_notification"),
subtitle: '',
text: target.body_html.html_safe,
button: t("mailer.button.custom"),
button: t("mailer.button.custom_notification"),
url: @organization.url_for('/user/notifications')
} %>
<% end %>
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
<%= render partial: 'user_mailer/mail_template', locals: {
title: t("mailer.title.exam_authorization_request_rejected"),
subtitle: t("mailer.subtitle.exam_authorization_request_rejected"),
text: t("mailer.text.exam_authorization_request_rejected"),
button: t("mailer.button.exam_authorization_request_rejected"),
url: @organization.url_for('/user/exam_authorizations')
text: t("mailer.text.exam_authorization_request_rejected")
} %>
2 changes: 1 addition & 1 deletion app/views/user_mailer/welcome.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= render partial: 'user_mailer/mail_template', locals: {
title: '¡Hola, Matías!<br>Te damos la bienvenida a Mumuki'.html_safe,
title: t('mailer.title.welcome', first_name: @user.first_name).html_safe,
text: @organization.welcome_email_template.html_safe,
url: @organization.url_for('/user'),
} %>
17 changes: 14 additions & 3 deletions lib/mumuki/laboratory/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,23 +199,34 @@ en:
locked_content: 'This content will be unlocked when you finish previous chapters'
mailer:
title:
certificate: Congratulations!
custom: You have a new notification!
custom_notification: You have a new notification!
exam_authorization_request_updated: There are updates in your exam registration
exam_authorization_request_rejected: Exam registration rejected
exam_registration: Exam registrations open
custom: You have a new notification!
welcome: Hello %{first_name}!<br>Welcome to Mumuki
subtitle:
certificate: Your certificate is available!
exam_authorization_request_approved: Your registration request to the exam has been approved.
exam_authorization_request_rejected: Your registration request to the exam has been rejected because the requirements weren't met.
exam_registration: ¡You can register for the exam!
text:
certificate: You can find it attached to this email or in your Mumuki profile
exam_authorization_request_approved: You can sit for the exam on %{exam_start_date} by going into the platform. ¡Good luck!
exam_authorization_request_rejected: ¡Don't be upset! You did a great job and we hope you'll keep learning programming.
exam_registration: You have until %{exam_registration_deadline} to sign up. In order to be approved, you must meet the requirements.
button:
certificate: View certificate
custom: View my notifications
custom_notification: View my notifications
exam_registration: Sign up for the exam
exam_authorization_request_approved: Go to the platform
exam_authorization_request_rejected: My exams
custom: My notifications
exam_authorization_request_rejected: ''
footer:
problems: If you have technical issues with the platform, get in contact with us at %{link}.
unsubscribe: You can stop receiving these emails by %{link}.
unsubscribe_link: modifying your preferences
male: Male
manage_notification_subscriptions: Manage your notification subscriptions
manage_notifications: Manage notifications
Expand Down
19 changes: 15 additions & 4 deletions lib/mumuki/laboratory/locales/es-CL.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,23 +203,34 @@ es-CL:
locked_content: 'Éste contenido se desbloqueará cuando termines los capítulos anteriores'
mailer:
title:
exam_authorization_request_updated: Tenés cambios en tu inscripción al examen
certificate: ¡Felicitaciones!
custom: ¡Tenés una nueva notificación!
custom_notification: ¡Tenés una nueva notificación!
exam_authorization_request_updated: Tenemos novedades sobre tu inscripción al examen
exam_authorization_request_rejected: Inscripción rechazada
exam_registration: Apertura de inscripciones
custom: ¡Tenés una nueva notificación!
welcome: ¡Hola, %{first_name}!<br>Te damos la bienvenida a Mumuki
subtitle:
certificate: Ya está disponible tu certificado.
exam_authorization_request_approved: Tu solicitud de inscripción al examen fue aprobada.
exam_authorization_request_rejected: Tu solicitud de inscripción al examen fue rechazada ya que no se cumplieron los requisitos.
exam_registration: ¡Ya podés inscribirte al examen!
text:
certificate: Descargalo desde el adjunto de este mail o visualizalo en tu perfil de Mumuki.
exam_authorization_request_approved: Podrás rendir el examen el día %{exam_start_date} ingresando a la plataforma. ¡Éxitos!
exam_authorization_request_rejected: ¡No te desanimes! Hiciste un gran esfuerzo y esperamos que continúes aprendiendo programación.
exam_registration: Tenés tiempo de inscribirte hasta el %{exam_registration_deadline}. Para que tu inscripción sea aceptada debés cumplir con los requisitos.
button:
certificate: Ver certificado
custom: Ver mis notificaciones
custom_notification: Ver mis notificaciones
exam_registration: Inscribirme al Examen
exam_authorization_request_approved: Ir a la plataforma
exam_authorization_request_rejected: Mis exámenes
custom: Mis notificaciones
exam_authorization_request_rejected: ''
footer:
problems: Si tienes problemas con la plataforma escribinos a %{link}.
unsubscribe: Podés dejar de recibir estos mails %{link}.
unsubscribe_link: modificando tus preferencias
male: Hombre
manage_notification_subscriptions: Administrá tus notificaciones
manage_notifications: Administrar notificaciones
Expand Down
19 changes: 15 additions & 4 deletions lib/mumuki/laboratory/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,23 +212,34 @@ es:
locked_content: 'Este contenido se desbloqueará cuando termines los capítulos anteriores'
mailer:
title:
exam_authorization_request_updated: Tenés cambios en tu inscripción al examen
certificate: ¡Felicitaciones!
custom: ¡Tenés una nueva notificación!
custom_notification: ¡Tenés una nueva notificación!
exam_authorization_request_updated: Tenemos novedades sobre tu inscripción al examen
exam_authorization_request_rejected: Inscripción rechazada
exam_registration: Apertura de inscripciones
custom: ¡Tenés una nueva notificación!
welcome: ¡Hola, %{first_name}!<br>Te damos la bienvenida a Mumuki
subtitle:
certificate: Ya está disponible tu certificado.
exam_authorization_request_approved: Tu solicitud de inscripción al examen fue aprobada.
exam_authorization_request_rejected: Tu solicitud de inscripción al examen fue rechazada ya que no se cumplieron los requisitos.
exam_registration: ¡Ya podés inscribirte al examen!
text:
certificate: Descargalo desde el adjunto de este mail o visualizalo en tu perfil de Mumuki.
exam_authorization_request_approved: Podrás rendir el examen el día %{exam_start_date} ingresando a la plataforma. ¡Éxitos!
exam_authorization_request_rejected: ¡No te desanimes! Hiciste un gran esfuerzo y esperamos que continúes aprendiendo programación.
exam_registration: Tenés tiempo de inscribirte hasta el %{exam_registration_deadline}. Para que tu inscripción sea aceptada debés cumplir con los requisitos.
button:
certificate: Ver certificado
custom: Ver mis notificaciones
custom_notification: Ver mis notificaciones
exam_registration: Inscribirme al Examen
exam_authorization_request_approved: Ir a la plataforma
exam_authorization_request_rejected: Mis exámenes
custom: Mis notificaciones
exam_authorization_request_rejected: ''
footer:
problems: Si tenés problemas con la plataforma escribinos a %{link}.
unsubscribe: Podés dejar de recibir estos mails %{link}.
unsubscribe_link: modificando tus preferencias
male: Hombre
manage_notification_subscriptions: Administrá tus notificaciones
manage_notifications: Administrar notificaciones
Expand Down
19 changes: 15 additions & 4 deletions lib/mumuki/laboratory/locales/pt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ pt:
blocked_forum_explanation: Você está no meio de um exame agora?
cancel: Cancelar
certificate: Certificado
certificate_available: Seu certificado já está disponível
certificate_available: Seu certificado já está disponível.
certificate_download: Baixe-o do anexo deste e-mail ou visualize-o em seu perfil Mumuki.
certificates: Certificados
certificates_will_be_here: Seus certificados nesta organização aparecerão aqui
Expand Down Expand Up @@ -203,23 +203,34 @@ pt:
locked_content: 'Este conteúdo será desbloqueado quando você terminar os capítulos anteriores'
mailer:
title:
certificate: Parabéns!
custom: Você tem uma nova notificação!
custom_notification: Você tem uma nova notificação!
exam_authorization_request_updated: Você tem alterações no registro do seu exame
exam_authorization_request_rejected: Inscrição rejeitada
exam_registration: Abertura de inscrições
custom: Você tem uma nova notificação!
welcome: Olá %{first_name}!<br>Sejam bem-vindos a Mumuki
subtitle:
certificate: Seu certificado já está disponível.
exam_authorization_request_approved: Seu pedido de inscrição para o exame foi aprovado.
exam_authorization_request_rejected: Sua inscrição para o exame foi rejeitada porque os requisitos não foram atendidos.
exam_registration: Agora você pode se inscrever para o exame!
text:
certificate: Baixe-o do anexo deste e-mail ou visualize-o em seu perfil Mumuki.
exam_authorization_request_approved: Você poderá fazer o exame em %{exam_start_date} ao entrar na plataforma. Êxitos!
exam_authorization_request_rejected: Não te desanimes! Você fez um grande esforço e esperamos que continue aprendendo programação.
exam_registration: Você tem tempo para se registrar até o exam_registration_deadline. Para que seu registro seja aceito, você deve atender aos requisitos.
button:
certificate: Minhas certificado
custom: Minhas notificações
custom_notification: Minhas notificações
exam_registration: Assinar o exame
exam_authorization_request_approved: Vá para a plataforma
exam_authorization_request_rejected: Meus exames
custom: Minhas notificações
exam_authorization_request_rejected: ''
footer:
problems: Se você tiver problemas com a plataforma, escreva para %{link}.
unsubscribe: Você pode parar de receber esses e-mails %{link}.
unsubscribe_link: modificando suas preferências
male: Masculino
manage_notification_subscriptions: Gerenciar suas notificações
manage_notifications: Gerenciar notificações
Expand Down
8 changes: 4 additions & 4 deletions spec/mailers/user_mailer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,21 +82,21 @@

context "last submission 1 week ago" do
it { expect(user.should_remind?).to be true }
it { expect(reminder.body.encoded).to include("Keep learning") }
it { expect(reminder.body.encoded).to include 'KEEP LEARNING' }
end

context "last submission 2 weeks ago" do
let(:days_since_last_submission) { 16 }

it { expect(user.should_remind?).to be true }
it { expect(reminder.body.encoded).to include("Keep learning") }
it { expect(reminder.body.encoded).to include 'KEEP LEARNING' }
end

context "last submission 3 weeks ago" do
let(:days_since_last_submission) { 26 }

it { expect(user.should_remind?).to be true }
it { expect(reminder.body.encoded).to include("Keep learning") }
it { expect(reminder.body.encoded).to include 'KEEP LEARNING' }
end

context "last submission 4 weeks ago" do
Expand Down Expand Up @@ -186,7 +186,7 @@

let(:user) { create :user, first_name: 'some name' }

it { expect(email.body.encoded).to eq 'hello some name!' }
it { expect(email.body.encoded).to include 'Hello some name!' }

context 'when organization does not have a custom sender address' do
it { expect(email.from).to eq ['[email protected]'] }
Expand Down

0 comments on commit 7466339

Please sign in to comment.