about summary refs log tree commit diff
path: root/app/views/admin
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2017-04-12 17:11:49 +0200
committerEugen <eugen@zeonfederated.com>2017-04-12 17:11:49 +0200
commitd90d23699ca611f05d8def40109505251507fa46 (patch)
treee3ffdab55a7d5f5456732d03b827ee2bd140f896 /app/views/admin
parent1f5ff46fd92f679cdb548c93c47920786f2dcc33 (diff)
Make Reporting admin section translatable (#1549)
* Make Reporting admin section translatable

And translate it into english and french

Signed-off-by: Thomas Citharel <tcit@tcit.fr>

* Make subject of emails translatable and improve french translation

Signed-off-by: Thomas Citharel <tcit@tcit.fr>

* Make error pages translatable and translate them in english and french

Signed-off-by: Thomas Citharel <tcit@tcit.fr>

* Translate site setting section

* Insert instance in registration emails and improve them a bit

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'app/views/admin')
-rw-r--r--app/views/admin/reports/index.html.haml18
-rw-r--r--app/views/admin/reports/show.html.haml19
-rw-r--r--app/views/admin/settings/index.html.haml42
3 files changed, 34 insertions, 45 deletions
diff --git a/app/views/admin/reports/index.html.haml b/app/views/admin/reports/index.html.haml
index 9c5c78935..68dc07016 100644
--- a/app/views/admin/reports/index.html.haml
+++ b/app/views/admin/reports/index.html.haml
@@ -1,12 +1,12 @@
 - content_for :page_title do
-  Reports
+  = t('reports.reports')
 
 .filters
   .filter-subset
-    %strong Status
+    %strong= t('reports.status')
     %ul
-      %li= filter_link_to 'Unresolved', action_taken: nil
-      %li= filter_link_to 'Resolved', action_taken: '1'
+      %li= filter_link_to t('reports.unresolved'), action_taken: nil
+      %li= filter_link_to t('reports.resolved'), action_taken: '1'
 
 = form_tag do
 
@@ -14,10 +14,10 @@
     %thead
       %tr
         %th
-        %th ID
-        %th Target
-        %th Reported by
-        %th Comment
+        %th= t('reports.id')
+        %th= t('reports.target')
+        %th= t('reports.reported_by')
+        %th= t('reports.comment.label')
         %th
     %tbody
       - @reports.each do |report|
@@ -27,6 +27,6 @@
           %td= link_to report.target_account.acct, admin_account_path(report.target_account.id)
           %td= link_to report.account.acct, admin_account_path(report.account.id)
           %td= truncate(report.comment, length: 30, separator: ' ')
-          %td= table_link_to 'circle', 'View', admin_report_path(report)
+          %td= table_link_to 'circle', t('reports.view'), admin_report_path(report)
 
 = paginate @reports
diff --git a/app/views/admin/reports/show.html.haml b/app/views/admin/reports/show.html.haml
index caa8415df..1143c2c2e 100644
--- a/app/views/admin/reports/show.html.haml
+++ b/app/views/admin/reports/show.html.haml
@@ -1,18 +1,19 @@
 - content_for :page_title do
-  = "Report ##{@report.id}"
+  = t('reports.report', id: @report.id)
 
 .report-accounts
   .report-accounts__item
-    %strong Reported account:
+    %strong= t('reports.reported_account')
     = render partial: 'authorize_follow/card', locals: { account: @report.target_account }
   .report-accounts__item
-    %strong Reported by:
+    %strong= t('reports.reported_by')
     = render partial: 'authorize_follow/card', locals: { account: @report.account }
 
 %p
-  %strong Comment:
+  %strong= t('reports.comment.label')
+  \:
   - if @report.comment.blank?
-    None
+    = t('reports.comment.none')
   - else
     = @report.comment
 
@@ -24,7 +25,7 @@
       .activity-stream.activity-stream-headless
         .entry= render partial: 'stream_entries/simple_status', locals: { status: status }
       .report-status__actions
-        = link_to remove_admin_report_path(@report, status_id: status.id), method: :post, class: 'icon-button', style: 'font-size: 24px; width: 24px; height: 24px', title: 'Delete' do
+        = link_to remove_admin_report_path(@report, status_id: status.id), method: :post, class: 'icon-button', style: 'font-size: 24px; width: 24px; height: 24px', title: t('reports.delete') do
           = fa_icon 'trash'
 
 - if !@report.action_taken?
@@ -32,10 +33,10 @@
 
   %div{ style: 'overflow: hidden' }
     %div{ style: 'float: right' }
-      = link_to 'Silence account', silence_admin_report_path(@report), method: :post, class: 'button'
-      = link_to 'Suspend account', suspend_admin_report_path(@report), method: :post, class: 'button'
+      = link_to t('reports.silence_account'), silence_admin_report_path(@report), method: :post, class: 'button'
+      = link_to t('reports.suspend_account'), suspend_admin_report_path(@report), method: :post, class: 'button'
     %div{ style: 'float: left' }
-      = link_to 'Mark as resolved', resolve_admin_report_path(@report), method: :post, class: 'button'
+      = link_to t('reports.mark_as_resolved'), resolve_admin_report_path(@report), method: :post, class: 'button'
 - elsif !@report.action_taken_by_account.nil?
   %hr/
 
diff --git a/app/views/admin/settings/index.html.haml b/app/views/admin/settings/index.html.haml
index 02faac8c2..b00e75a16 100644
--- a/app/views/admin/settings/index.html.haml
+++ b/app/views/admin/settings/index.html.haml
@@ -1,52 +1,40 @@
 - content_for :page_title do
-  Site Settings
+  = t('admin.settings.title')
 
 %table.table
   %colgroup
     %col{ width: '35%' }/
   %thead
     %tr
-      %th Setting
-      %th Click to edit
+      %th= t('admin.settings.setting')
+      %th= t('admin.settings.click_to_edit')
   %tbody
     %tr
       %td{ rowspan: 2 }
-        %strong Contact information
-      %td= best_in_place @settings['site_contact_username'], :value, url: admin_setting_path(@settings['site_contact_username']), place_holder: 'Enter a username'
+        %strong= t('admin.settings.contact_information.label')
+      %td= best_in_place @settings['site_contact_username'], :value, url: admin_setting_path(@settings['site_contact_username']), place_holder: t('admin.settings.contact_information.username')
     %tr
-      %td= best_in_place @settings['site_contact_email'], :value, url: admin_setting_path(@settings['site_contact_email']), place_holder: 'Enter a public e-mail address'
+      %td= best_in_place @settings['site_contact_email'], :value, url: admin_setting_path(@settings['site_contact_email']), place_holder: t('admin.settings.contact_information.email')
     %tr
       %td
-        %strong Site title
+        %strong= t('admin.settings.site_title')
       %td= best_in_place @settings['site_title'], :value, url: admin_setting_path(@settings['site_title'])
     %tr
       %td
-        %strong Site description
-        %br/
-        Displayed as a paragraph on the frontpage and used as a meta tag.
-        %br/
-        You can use HTML tags, in particular
-        %code= '<a>'
-        and
-        %code= '<em>'
+        %strong= t('admin.settings.site_description.title')
+        %p= t('admin.settings.site_description.desc_html')
       %td= best_in_place @settings['site_description'], :value, as: :textarea, url: admin_setting_path(@settings['site_description'])
     %tr
       %td
-        %strong Extended site description
-        %br/
-        Displayed on extended information page
-        %br/
-        You can use HTML tags
+        %strong= t('admin.settings.site_description_extended.title')
+        %p= t('admin.settings.site_description_extended.desc_html')
       %td= best_in_place @settings['site_extended_description'], :value, as: :textarea, url: admin_setting_path(@settings['site_extended_description'])
     %tr
       %td
-        %strong Open registration
-      %td= best_in_place @settings['open_registrations'], :value, as: :checkbox, collection: { false: 'Disabled', true: 'Enabled'}, url: admin_setting_path(@settings['open_registrations'])
+        %strong= t('admin.settings.registrations.open.title')
+      %td= best_in_place @settings['open_registrations'], :value, as: :checkbox, collection: { false: t('admin.settings.registrations.open.disabled'), true: t('admin.settings.registrations.open.enabled')}, url: admin_setting_path(@settings['open_registrations'])
     %tr
       %td
-        %strong Closed registration message
-        %br/
-        Displayed on frontpage when registrations are closed
-        %br/
-        You can use HTML tags
+        %strong= t('admin.settings.registrations.closed_message.title')
+        %p= t('admin.settings.registrations.closed_message.desc_html')
       %td= best_in_place @settings['closed_registrations_message'], :value, as: :textarea, url: admin_setting_path(@settings['closed_registrations_message'])