adds i18n to comments_helper

This commit is contained in:
Juanjo Bazán
2015-07-31 15:13:00 +02:00
parent 66079f1741
commit 927f79fd78
4 changed files with 16 additions and 6 deletions

View File

@@ -1,11 +1,11 @@
module CommentsHelper
def comment_link_text(parent)
parent.class == Debate ? "Comentar" : "Responder"
parent.class == Debate ? t("comments_helper.comment_link") : t("comments_helper.reply_link")
end
def comment_button_text(parent)
parent.class == Debate ? "Publicar comentario" : "Publicar respuesta"
parent.class == Debate ? t("comments_helper.comment_button") : t("comments_helper.reply_button")
end
end

View File

@@ -39,6 +39,11 @@ en:
new:
publish_new: Publish new debate
back_link: Back
comments_helper:
comment_link: Comment
comment_button: Publish comment
reply_link: Reply
reply_button: Publish reply
votes:
notice_thanks: "Thanks for voting."
notice_already_registered: "Your vote is already registered."

View File

@@ -39,6 +39,11 @@ es:
new:
publish_new: Publicar debate nuevo
back_link: Volver
comments_helper:
comment_link: Comentar
comment_button: Publicar comentario
reply_link: Responder
reply_button: Publicar respuesta
votes:
notice_thanks: "Gracias por votar."
notice_already_registered: "Tu voto ya ha sido registrado."

View File

@@ -26,10 +26,10 @@ feature 'Comments' do
login_as(user)
visit debate_path(debate)
click_on 'Comentar'
click_on 'Comment'
fill_in 'comment_body', with: '¿Has pensado en esto...?'
click_button 'Publicar comentario'
click_button 'Publish comment'
within "#comments" do
expect(page).to have_content '¿Has pensado en esto...?'
@@ -45,10 +45,10 @@ feature 'Comments' do
login_as(manuela)
visit debate_path(debate)
click_link "Responder"
click_link "Reply"
within "#js-comment-form-comment_#{comment.id}" do
fill_in 'comment_body', with: 'La semana que viene está hecho.'
click_button 'Publicar respuesta'
click_button 'Publish reply'
end
within "#comment-#{comment.id}" do