From c53bee4a08f9c1b38e2861815e4bc5a68ddced78 Mon Sep 17 00:00:00 2001 From: Jack Williams <30068301+WilliamsJack@users.noreply.github.com> Date: Tue, 12 Jul 2022 13:45:06 +1000 Subject: [PATCH] Translate subtask status on demand Fixes #4476 --- app/Controller/SubtaskRestrictionController.php | 4 ++-- app/Export/SubtaskExport.php | 2 +- app/Model/SubtaskModel.php | 6 +++--- app/Template/event/subtask_create.php | 2 +- app/Template/event/subtask_update.php | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/Controller/SubtaskRestrictionController.php b/app/Controller/SubtaskRestrictionController.php index e777b1dca..f4dec982e 100644 --- a/app/Controller/SubtaskRestrictionController.php +++ b/app/Controller/SubtaskRestrictionController.php @@ -24,8 +24,8 @@ class SubtaskRestrictionController extends BaseController $this->response->html($this->template->render('subtask_restriction/show', array( 'status_list' => array( - SubtaskModel::STATUS_TODO => t('Todo'), - SubtaskModel::STATUS_DONE => t('Done'), + SubtaskModel::STATUS_TODO => 'Todo', + SubtaskModel::STATUS_DONE => 'Done', ), 'subtask_inprogress' => $this->subtaskStatusModel->getSubtaskInProgress($this->userSession->getId()), 'subtask' => $subtask, diff --git a/app/Export/SubtaskExport.php b/app/Export/SubtaskExport.php index 0939838f9..64af35756 100644 --- a/app/Export/SubtaskExport.php +++ b/app/Export/SubtaskExport.php @@ -77,7 +77,7 @@ class SubtaskExport extends Base $values = array(); $values[] = $subtask['id']; $values[] = $subtask['title']; - $values[] = $this->subtask_status[$subtask['status']]; + $values[] = t($this->subtask_status[$subtask['status']]); $values[] = $subtask['assignee_name'] ?: $subtask['assignee_username']; $values[] = $subtask['time_estimated']; $values[] = $subtask['time_spent']; diff --git a/app/Model/SubtaskModel.php b/app/Model/SubtaskModel.php index 440f49d2f..cd4792b6e 100644 --- a/app/Model/SubtaskModel.php +++ b/app/Model/SubtaskModel.php @@ -64,9 +64,9 @@ class SubtaskModel extends Base public function getStatusList() { return array( - self::STATUS_TODO => t('Todo'), - self::STATUS_INPROGRESS => t('In progress'), - self::STATUS_DONE => t('Done'), + self::STATUS_TODO => 'Todo', + self::STATUS_INPROGRESS => 'In progress', + self::STATUS_DONE => 'Done', ); } diff --git a/app/Template/event/subtask_create.php b/app/Template/event/subtask_create.php index 5f3c76b79..53f1b3ee5 100644 --- a/app/Template/event/subtask_create.php +++ b/app/Template/event/subtask_create.php @@ -10,7 +10,7 @@