Add new translations for answerbox

This commit is contained in:
Andreas Nedbal 2022-07-30 22:45:40 +02:00 committed by Andreas Nedbal
parent d9a2e7dde8
commit f4f581d12f
5 changed files with 22 additions and 9 deletions

View File

@ -1,5 +1,5 @@
- if a.comments.all.count.zero? - if a.comments.all.count.zero?
= t "views.answerbox.no_comment" = t(".none")
- else - else
%ul.comment__container %ul.comment__container
- a.comments.order(:created_at).each do |comment| - a.comments.order(:created_at).each do |comment|
@ -49,5 +49,5 @@
= t("voc.report") = t("voc.report")
- if user_signed_in? - if user_signed_in?
.form-group.has-feedback.comment__input-group{ name: "ab-comment-new-group", data: { a_id: a.id } } .form-group.has-feedback.comment__input-group{ name: "ab-comment-new-group", data: { a_id: a.id } }
%input.form-control.comment__input{ type: :text, placeholder: t("views.placeholder.comment"), name: "ab-comment-new", data: { a_id: a.id } } %input.form-control.comment__input{ type: :text, placeholder: t(".placeholder"), name: "ab-comment-new", data: { a_id: a.id } }
%span.text-muted.form-control-feedback.comment__character-count{ id: "ab-comment-charcount-#{a.id}" } 160 %span.text-muted.form-control-feedback.comment__character-count{ id: "ab-comment-charcount-#{a.id}" } 160

View File

@ -25,10 +25,10 @@
%h6.text-muted.media-heading.answerbox__question-user %h6.text-muted.media-heading.answerbox__question-user
- if a.question.author_is_anonymous - if a.question.author_is_anonymous
%i.fa.fa-user-secret{ title: t('.anon_hint') } %i.fa.fa-user-secret{ title: t('.anon_hint') }
= raw t('views.answerbox.asked', user: user_screen_name(a.question.user, context_user: a.user, author_identifier: a.question.author_is_anonymous ? a.question.author_identifier: nil), time: time_tooltip(a.question)) = raw t(".asked", user: user_screen_name(a.question.user, context_user: a.user, author_identifier: a.question.author_is_anonymous ? a.question.author_identifier: nil), time: time_tooltip(a.question))
- if !a.question.author_is_anonymous && !a.question.direct - if !a.question.author_is_anonymous && !a.question.direct
· ·
%a{ href: question_path(a.question.user.screen_name, a.question.id) } %a{ href: question_path(a.question.user.screen_name, a.question.id) }
= pluralize(a.question.answer_count, t("voc.answer")) = t(".answers", count: a.question.answer_count)
.answerbox__question-text .answerbox__question-text
= question_markdown a.question.content = question_markdown a.question.content

View File

@ -3,7 +3,7 @@
%i.fa.fa-smile-o %i.fa.fa-smile-o
.media-body .media-body
- if a.smiles.all.count.zero? - if a.smiles.all.count.zero?
= t 'views.answerbox.no_smile' = t(".none")
- else - else
- a.smiles.all.each do |smile| - a.smiles.all.each do |smile|
%a{ href: user_path(smile.user), %a{ href: user_path(smile.user),

View File

@ -10,7 +10,7 @@
[...] [...]
%p %p
%a.btn.btn-primary{ href: answer_path(a.user.screen_name, a.id) } %a.btn.btn-primary{ href: answer_path(a.user.screen_name, a.id) }
= t 'views.answerbox.read' = t(".read")
- else - else
.answerbox__answer-text .answerbox__answer-text
= markdown a.content = markdown a.content
@ -23,16 +23,16 @@
%img.answerbox__answer-user-avatar.avatar-sm{ src: a.user.profile_picture.url(:medium) } %img.answerbox__answer-user-avatar.avatar-sm{ src: a.user.profile_picture.url(:medium) }
.media-body .media-body
%h6.media-heading.answerbox__answer-user %h6.media-heading.answerbox__answer-user
= raw t('views.answerbox.answered', hide: hidespan(t('views.answerbox.hide'), 'd-none d-sm-inline'), user: user_screen_name(a.user)) = raw t(".answered", hide: hidespan(t(".hide"), 'd-none d-sm-inline'), user: user_screen_name(a.user))
.answerbox__answer-date .answerbox__answer-date
= link_to(raw(t('views.answerbox.time', time: time_tooltip(a))), answer_path(a.user.screen_name, a.id)) = link_to(raw(t("time.distance_ago", time: time_tooltip(a))), answer_path(a.user.screen_name, a.id))
.col-md-6.d-flex.d-md-block.answerbox__actions .col-md-6.d-flex.d-md-block.answerbox__actions
= render 'answerbox/actions', a: a, display_all: display_all = render 'answerbox/actions', a: a, display_all: display_all
- else - else
.row .row
.col-md-6.text-left.text-muted .col-md-6.text-left.text-muted
%i.fa.fa-clock-o %i.fa.fa-clock-o
= link_to(raw(t('views.answerbox.time', time: time_tooltip(a))), answer_path(a.user.screen_name, a.id), class: 'answerbox__permalink') = link_to(raw(t("time.distance_ago", time: time_tooltip(a))), answer_path(a.user.screen_name, a.id), class: 'answerbox__permalink')
.col-md-6.d-md-flex.answerbox__actions .col-md-6.d-md-flex.answerbox__actions
= render 'answerbox/actions', a: a, display_all: display_all = render 'answerbox/actions', a: a, display_all: display_all
.card-footer{ id: "ab-comments-section-#{a.id}", class: display_all.nil? ? 'd-none' : nil } .card-footer{ id: "ab-comments-section-#{a.id}", class: display_all.nil? ? 'd-none' : nil }

View File

@ -80,6 +80,11 @@ en:
answerbox: answerbox:
header: header:
anon_hint: :inbox.entry.anon_hint anon_hint: :inbox.entry.anon_hint
answers:
zero: "0 answers"
one: "1 answer"
other: "%{count} answers"
asked: "%{user} asked %{time} ago"
actions: actions:
share: share:
twitter: "Share on Twitter" twitter: "Share on Twitter"
@ -89,9 +94,17 @@ en:
unsubscribe: "Unsubscribe" unsubscribe: "Unsubscribe"
return: "Return to Inbox" return: "Return to Inbox"
comments: comments:
none: "There are no comments yet."
placeholder: "Comment..."
actions: actions:
view_smiles: "View comment smiles" view_smiles: "View comment smiles"
smiles:
none: "No one smiled this yet."
application: application:
answerbox:
read: "Read the entire answer"
answered: "%{hide} %{user}" # resolves into "Answered by %{user}"
hide: "Answered by"
questionbox: questionbox:
title: "Ask something!" title: "Ask something!"
required: "This user does not want to get asked by strangers. Why don't you %{signup}?" required: "This user does not want to get asked by strangers. Why don't you %{signup}?"