From 7a0be2519ae9e815948d98720e19fe0d944da338 Mon Sep 17 00:00:00 2001 From: pixeldesu Date: Wed, 27 May 2015 04:31:28 +0200 Subject: [PATCH] localize question_header and questionbox --- app/views/shared/_question_header.haml | 4 ++-- app/views/shared/_questionbox.html.haml | 24 +++++++++--------------- config/locales/en.yml | 10 ++++++++++ 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/app/views/shared/_question_header.haml b/app/views/shared/_question_header.haml index 61400c46..0680819b 100644 --- a/app/views/shared/_question_header.haml +++ b/app/views/shared/_question_header.haml @@ -17,12 +17,12 @@ %li.text-danger %a{href: '#', tabindex: -1, data: { action: 'ab-question-destroy', q_id: question.id, redirect: if question.author_is_anonymous? then "/" else show_user_questions_path(question.user.screen_name) end }} %i.fa.fa-trash-o - Delete Question + = t 'views.actions.delete' - unless question.user == current_user %li %a{href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: question.id }} %i.fa.fa-exclamation-triangle - Report + = t 'views.actions.report' %h6.text-muted.media-heading.answerbox--question-user = user_screen_name question.user, question.author_is_anonymous, !hidden - unless hidden diff --git a/app/views/shared/_questionbox.html.haml b/app/views/shared/_questionbox.html.haml index 34c79e0a..7194457f 100644 --- a/app/views/shared/_questionbox.html.haml +++ b/app/views/shared/_questionbox.html.haml @@ -2,14 +2,14 @@ .panel-heading %h3.panel-title - if @user.motivation_header.blank? - Ask something! + = t 'views.questionbox.title' - else = @user.motivation_header .panel-body - if @user.banned? .row .col-xs-12.text-center - %strong This user got hit with ye olde banhammer. + %strong= t 'views.questionbox.banned' - else - if user_signed_in? or @user.privacy_allow_anonymous_questions? #question-box @@ -21,7 +21,7 @@ - if user_signed_in? - if @user.privacy_allow_anonymous_questions? %input{:name => "qb-anonymous", :type => "checkbox"}/ - Hide your name + = t 'views.actions.anonymous' %br/ - else %input{:name => "qb-anonymous", :type => "hidden", :value => "false"}/ @@ -34,24 +34,18 @@ #question-box-promote.row{:style => "display: none;"} .row .col-xs-12.text-center - %strong Your question has been sent. + %strong= t 'views.questionbox.promote.message' .row .col-sm-1 .col-sm-5 - %button#create-account.btn.btn-block.btn-primary Create an account + %button#create-account.btn.btn-block.btn-primary= t 'views.questionbox.promote.create' .col-sm-5 - %button#new-question.btn.btn-block.btn-default Ask another question + %button#new-question.btn.btn-block.btn-default= t 'views.questionbox.promote.another' .col-sm-1 .row .col-sm-1 - .col-xs-12.col-sm-10 - %small - Join - = APP_CONFIG['site_name'] - today! You'll be able to follow and ask people you know and a lot more. + .col-xs-12.col-sm-10.text-center + %small= t('views.questionbox.promote.join', app_title: APP_CONFIG['site_name']) .col-sm-1 - else - %p - This user does not want to get asked by strangers. Why don't you - = succeed "?" do - %a{:href => "{{ url_for('register') }}"} sign up \ No newline at end of file + %p= raw t 'views.questionbox.required', signup: link_to(t('views.sessions.new'),new_user_registration_path) \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 647f4838..abbdf50c 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -29,6 +29,7 @@ en: follower: "follower" following: "following" actions: + anonymous: "Hide your name" delete: "Delete" report: "Report" return: "Return to Inbox" @@ -121,4 +122,13 @@ en: no_smile: "No one smiled this, yet." no_comment: "There are no comments yet." commentsmile: "People who smiled this comment" + questionbox: + title: "Ask something!" + banned: "This user got hit with ye olde banhammer." + required: "This user does not want to get asked by strangers. Why don't you %{signup}?" + promote: + message: "Your question has been sent." + create: "Create an account" + another: "Ask another question" + join: "Join %{app_title} today! You'll be able to follow and ask people you know and a lot more." hello: "Hello world"