diff --git a/app/views/inbox/_entry.haml b/app/views/inbox/_entry.haml index 3b2268de..b3cb71f3 100644 --- a/app/views/inbox/_entry.haml +++ b/app/views/inbox/_entry.haml @@ -1,4 +1,4 @@ -.card.inbox-entry{ class: i.new? ? 'inbox-entry--new' : '', data: { id: i.id } } +.card.inbox-entry{ class: i.new? ? "inbox-entry--new" : "", data: { id: i.id } } .card-header .media - unless i.question.author_is_anonymous @@ -6,11 +6,11 @@ %img.answerbox__question-user-avatar.avatar-md{ src: i.question.user.profile_picture.url(:medium) } .media-body %h6.text-muted.media-heading.answerbox__question-user - = raw t('views.inbox.entry.asked', user: user_screen_name(i.question.user, anonymous: i.question.author_is_anonymous), time: time_tooltip(i.question)) + = t(".asked_html", user: user_screen_name(i.question.user, anonymous: i.question.author_is_anonymous), time: time_tooltip(i.question)) - if !i.question.author_is_anonymous && i.question.answer_count.positive? · %a{ href: show_user_question_path(i.question.user.screen_name, i.question.id) } - = pluralize(i.question.answer_count, t('views.inbox.entry.response')) + = t(".answers", count: i.question.answer_count) .answerbox__question-text= question_markdown i.question.content - if i.question.user_id != current_user.id || current_user.has_role?(:administrator) .pull-right @@ -19,32 +19,32 @@ %span.caret .dropdown-menu.dropdown-menu-right{ role: :menu } - if i.question.user_id != current_user.id - %a.dropdown-item{ name: 'ib-report', data: { q_id: i.question.id } } + %a.dropdown-item{ name: "ib-report", data: { q_id: i.question.id } } %i.fa.fa-warning - = t 'views.actions.report' + = t("voc.report") - if current_user.has_role? :administrator %a.dropdown-item{ href: rails_admin_path_for_resource(i) } %i.fa.fa-gears - View in Kontrollzentrum + = t("voc.view_in_rails_admin") .card-body - %textarea.form-control{ name: 'ib-answer', placeholder: t('views.placeholder.inbox'), data: { id: i.id } } + %textarea.form-control{ name: "ib-answer", placeholder: t(".placeholder"), data: { id: i.id } } %br/ - %button.btn.btn-success{ name: 'ib-answer', data: { ib_id: i.id } } - = t 'views.actions.answer' - %button.btn.btn-danger{ name: 'ib-destroy', data: { ib_id: i.id } } - = t 'views.actions.delete' - %button.btn.btn-default{ name: 'ib-options', data: { ib_id: i.id, state: :hidden } } + %button.btn.btn-success{ name: "ib-answer", data: { ib_id: i.id } } + = t("voc.answer") + %button.btn.btn-danger{ name: "ib-destroy", data: { ib_id: i.id } } + = t("voc.delete") + %button.btn.btn-default{ name: "ib-options", data: { ib_id: i.id, state: :hidden } } %i.fa.fa-cog - %span.sr-only= t 'views.actions.options' + %span.sr-only= t(".options") .card-footer.d-none{ id: "ib-options-#{i.id}" } - %h4= t 'views.inbox.entry.sharing.title' + %h4= t(".sharing.heading") - if current_user.services.count.positive? .row - current_user.services.each do |service| .col-md-3.col-sm-4.col-xs-6 %label - %input{ type: 'checkbox', name: 'ib-share', checked: :checked, data: { ib_id: i.id, service: service.provider } } - = raw t('views.inbox.entry.sharing.post', service: service.provider.capitalize) + %input{ type: "checkbox", name: "ib-share", checked: :checked, data: { ib_id: i.id, service: service.provider } } + = raw t(".sharing.post_to", service: service.provider.capitalize) - else - %p= raw t('views.inbox.entry.sharing.none', settings: link_to(t('views.inbox.entry.sharing.settings'), services_path)) + %p= t(".sharing.none_html", settings: link_to(t(".sharing.settings"), services_path)) diff --git a/config/locales/views.en.yml b/config/locales/views.en.yml index dddf401e..a11dd5da 100644 --- a/config/locales/views.en.yml +++ b/config/locales/views.en.yml @@ -30,6 +30,18 @@ en: features: title: "Feature Requests – Feedback" inbox: + entry: + asked_html: "%{user} asked %{time} ago" + answers: + one: "1 answer" + other: "%{count} answers" + options: "Options" + placeholder: "Write your answer here..." + sharing: + heading: "Sharing" + post_to: "Post to %{service}" + none_html: "You have not connected any services yet. Visit your %{settings} to connect one." + settings: "service settings" show: empty: "Nothing to see here." sidebar: diff --git a/config/locales/voc.en.yml b/config/locales/voc.en.yml index b01067be..383b890c 100644 --- a/config/locales/voc.en.yml +++ b/config/locales/voc.en.yml @@ -1,15 +1,19 @@ en: voc: + answer: "Answer" cancel: "Cancel" close: "Close" confirm: "Are you sure?" delete: "Delete" edit: "Edit" + load: "Load more" login: "Sign in" save: "Save changes" register: "Sign up" + report: "Report" terms: "Terms of Service" update: "Update" + view_in_rails_admin: "View in Rails Admin" messages: noauth: "You must be signed in to do this." time: