improve task i18n (affects foodcoops#137)

This commit is contained in:
wvengen 2013-12-10 17:58:32 +01:00
parent b05c75aef3
commit e42e27957d
5 changed files with 18 additions and 21 deletions

View file

@ -13,4 +13,8 @@ module TasksHelper
title: I18n.t('helpers.tasks.required_users', :count => task.still_required_users) title: I18n.t('helpers.tasks.required_users', :count => task.still_required_users)
end end
end end
def task_title(task)
I18n.t('helpers.tasks.task_title', name: task.name, duration: task.duration)
end
end end

View file

@ -5,13 +5,13 @@
%table.table.table-striped %table.table.table-striped
%thead %thead
%tr %tr
%th= t '.due_date' %th= heading_helper Task, :due_date
%th= t '.task' %th= heading_helper Task, :name
%th= t '.who' %th= heading_helper Task, :user_list
%th %th
%tbody %tbody
- @tasks.each do |task| - @tasks.each do |task|
%tr %tr
%td= task.due_date unless task.due_date.nil? %td= task.due_date unless task.due_date.nil?
%td= link_to t('.task_format', name: task.name, duration: task.duration), task_path(task) %td= link_to task_title(task), task_path(task)
%td= task_assignments task %td= task_assignments task

View file

@ -1,9 +1,9 @@
%table.table.table-striped %table.table.table-striped
%thead %thead
%tr %tr
%th= t '.due_date' %th= heading_helper Task, :due_date
%th %th
%th= t '.task' %th= heading_helper Task, :name
%th{:colspan => '2'} %th{:colspan => '2'}
= t '.who' = t '.who'
%small= t '.who_hint' %small= t '.who_hint'
@ -15,7 +15,7 @@
%td %td
- if task.periodic? - if task.periodic?
%i.icon-repeat{title: t('tasks.repeated')} %i.icon-repeat{title: t('tasks.repeated')}
%td= link_to t('.task_format', name: task.name, duration: task.duration), task_path(task) %td= link_to task_title(task), task_path(task)
%td %td
= task_assignments task = task_assignments task
= highlighted_required_users task = highlighted_required_users task

View file

@ -3,22 +3,22 @@
%section %section
%dl.dl-horizontal %dl.dl-horizontal
%dt= Task.human_attribute_name(:name) %dt= heading_helper Task, :name
%dd= @task.name %dd= @task.name
- if @task.description.present? - if @task.description.present?
%dt= Task.human_attribute_name(:description) %dt= heading_helper Task, :description
%dd= simple_format(@task.description) %dd= simple_format(@task.description)
- if @task.due_date.present? - if @task.due_date.present?
%dt= Task.human_attribute_name(:due_date) %dt= heading_helper Task, :due_date
%dd %dd
= format_date(@task.due_date) = format_date(@task.due_date)
- if @task.periodic? - if @task.periodic?
%i.icon-repeat{title: t('tasks.repeated')} %i.icon-repeat{title: t('tasks.repeated')}
%dt= Task.human_attribute_name(:duration) %dt= heading_helper Task, :duration
%dd= t('.hours', count: @task.duration) %dd= t('.hours', count: @task.duration)
%dt= Task.human_attribute_name(:user_list) %dt= heading_helper Task, :user_list
%dd= task_assignments(@task) %dd= task_assignments(@task)
%dt= Task.human_attribute_name(:workgroup) %dt= heading_helper Task, :workgroup
%dd %dd
- if @task.workgroup - if @task.workgroup
= link_to @task.workgroup.name, workgroup_tasks_path(workgroup_id: @task.workgroup_id) = link_to @task.workgroup.name, workgroup_tasks_path(workgroup_id: @task.workgroup_id)

View file

@ -802,6 +802,7 @@ en:
message: message:
create: send message create: send message
tasks: tasks:
task_title: ! '%{name} (%{duration}h)'
required_users: ! '%{count} members are still needed!' required_users: ! '%{count} members are still needed!'
home: home:
apple_bar: apple_bar:
@ -1491,11 +1492,6 @@ en:
notice: You have accepted the task notice: You have accepted the task
archive: archive:
title: Task archive title: Task archive
archive_tasks:
due_date: Due date
task: Subject
task_format: ! '%{name} (%{duration}h)'
who: People in charge
create: create:
notice: Task has been created notice: Task has been created
destroy: destroy:
@ -1519,11 +1515,8 @@ en:
accept_task: Accept task accept_task: Accept task
done: Done done: Done
done_q: Done? done_q: Done?
due_date: Due date
mark_done: Mark task as done mark_done: Mark task as done
reject_task: Reject task reject_task: Reject task
task: subject
task_format: ! '%{name} (%{duration}h)'
who: Who is doing it? who: Who is doing it?
who_hint: (How much are still needed?) who_hint: (How much are still needed?)
nav: nav: