localize actions

This commit is contained in:
pixeldesu 2015-05-27 03:53:53 +02:00
parent 74bbbdf4ca
commit 7905fe8372
6 changed files with 23 additions and 13 deletions

View file

@ -16,12 +16,12 @@
%li.text-danger %li.text-danger
%a{href: '#', tabindex: -1, data: { action: 'ab-question-destroy', q_id: a.question.id }} %a{href: '#', tabindex: -1, data: { action: 'ab-question-destroy', q_id: a.question.id }}
%i.fa.fa-trash-o %i.fa.fa-trash-o
Delete Question = t 'views.actions.delete'
- unless a.question.user == current_user - unless a.question.user == current_user
%li %li
%a{href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: a.question.id }} %a{href: '#', tabindex: -1, data: { action: 'ab-question-report', q_id: a.question.id }}
%i.fa.fa-exclamation-triangle %i.fa.fa-exclamation-triangle
Report = t 'views.actions.report'
%h6.text-muted.media-heading.answerbox--question-user %h6.text-muted.media-heading.answerbox--question-user
= raw t('views.answerbox.asked', user: user_screen_name(a.question.user, a.question.author_is_anonymous), time: time_tooltip(a.question)) = raw t('views.answerbox.asked', user: user_screen_name(a.question.user, a.question.author_is_anonymous), time: time_tooltip(a.question))
- unless a.question.author_is_anonymous - unless a.question.author_is_anonymous

View file

@ -27,19 +27,19 @@
-# fun joke should subscribe? -# fun joke should subscribe?
%a{href: '#', data: { a_id: a.id, action: 'ab-submarine', torpedo: "no" }} %a{href: '#', data: { a_id: a.id, action: 'ab-submarine', torpedo: "no" }}
%i.fa.fa-anchor %i.fa.fa-anchor
Unsubscribe = t 'views.actions.unsubscribe'
- else - else
%li %li
%a{href: '#', data: { a_id: a.id, action: 'ab-submarine', torpedo: "yes" }} %a{href: '#', data: { a_id: a.id, action: 'ab-submarine', torpedo: "yes" }}
%i.fa.fa-anchor %i.fa.fa-anchor
Subscribe = t 'views.actions.subscribe'
- if privileged? a.user - if privileged? a.user
%li.text-danger %li.text-danger
%a{href: '#', data: { a_id: a.id, action: 'ab-destroy' }} %a{href: '#', data: { a_id: a.id, action: 'ab-destroy' }}
%i.fa.fa-trash-o %i.fa.fa-trash-o
Return to Inbox = t 'views.actions.return'
- unless a.user == current_user - unless a.user == current_user
%li %li
%a{href: '#', data: { a_id: a.id, action: 'ab-report' }} %a{href: '#', data: { a_id: a.id, action: 'ab-report' }}
%i.fa.fa-exclamation-triangle %i.fa.fa-exclamation-triangle
Report = t 'views.actions.report'

View file

@ -5,10 +5,10 @@
%button.close{"data-dismiss" => "modal", :type => "button"} %button.close{"data-dismiss" => "modal", :type => "button"}
%span{"aria-hidden" => "true"} × %span{"aria-hidden" => "true"} ×
%span.sr-only Close %span.sr-only Close
%h4#modal-ask-followers-label.modal-title People who smiled this comment %h4#modal-ask-followers-label.modal-title= t 'views.answerbox.commentsmile'
.modal-body .modal-body
- if comment.smiles.all.count == 0 - if comment.smiles.all.count == 0
No one smiled this, yet. = t 'views.answerbox.no_smile'
- else - else
%ul.user-list.user-list-smiles %ul.user-list.user-list-smiles
- comment.smiles.all.each do |smile| - comment.smiles.all.each do |smile|

View file

@ -1,5 +1,5 @@
- if a.comments.all.count == 0 - if a.comments.all.count == 0
There are no comments yet. = t 'views.answerbox.no_comment'
- else - else
%ul.comments %ul.comments
- a.comments.order(:created_at).each do |comment| - a.comments.order(:created_at).each do |comment|
@ -36,17 +36,17 @@
%li %li
%a{href: '#', type: :button, data: { target: "#modal-view-comment#{comment.id}-smiles", toggle: :modal}} %a{href: '#', type: :button, data: { target: "#modal-view-comment#{comment.id}-smiles", toggle: :modal}}
%i.fa.fa-smile-o %i.fa.fa-smile-o
View comment smiles = t 'views.actions.view'
- if privileged?(comment.user) or privileged?(a.user) - if privileged?(comment.user) or privileged?(a.user)
%li.text-danger %li.text-danger
%a{href: '#', data: { action: 'ab-comment-destroy', c_id: comment.id }} %a{href: '#', data: { action: 'ab-comment-destroy', c_id: comment.id }}
%i.fa.fa-trash-o %i.fa.fa-trash-o
Delete = t 'views.actions.delete'
- unless comment.user == current_user - unless comment.user == current_user
%li %li
%a{href: '#', data: { action: 'ab-comment-report', c_id: comment.id }} %a{href: '#', data: { action: 'ab-comment-report', c_id: comment.id }}
%i.fa.fa-exclamation-triangle %i.fa.fa-exclamation-triangle
Report = t 'views.acions.report'
.comments--content .comments--content
= markdown comment.content = markdown comment.content
- if user_signed_in? - if user_signed_in?

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 == 0 - if a.smiles.all.count == 0
No one smiled this, yet. = t 'views.answerbox.no_smile'
- else - else
- a.smiles.all.each do |smile| - a.smiles.all.each do |smile|
%a{href: show_user_profile_path(smile.user.screen_name), title: smile.user.screen_name, data: { toggle: :tooltip, placement: :top, smile_id: smile.id }} %a{href: show_user_profile_path(smile.user.screen_name), title: smile.user.screen_name, data: { toggle: :tooltip, placement: :top, smile_id: smile.id }}

View file

@ -28,6 +28,13 @@ en:
smile: "smile" smile: "smile"
follower: "follower" follower: "follower"
following: "following" following: "following"
actions:
delete: "Delete"
report: "Report"
return: "Return to Inbox"
subscribe: "Subscribe"
unsubscribe: "Unsubscribe"
view: "View comment smiles"
sessions: sessions:
destroy: "Logout" destroy: "Logout"
create: "Sign in" create: "Sign in"
@ -111,4 +118,7 @@ en:
answered: "%{hide} %{user}" answered: "%{hide} %{user}"
hide: "Answered by" hide: "Answered by"
time: "%{time} ago" time: "%{time} ago"
no_smile: "No one smiled this, yet."
no_comment: "There are no comments yet."
commentsmile: "People who smiled this comment"
hello: "Hello world" hello: "Hello world"