diff --git a/.tx/config b/.tx/config new file mode 100644 index 0000000..68e1f1f --- /dev/null +++ b/.tx/config @@ -0,0 +1,10 @@ +[main] +host = https://www.transifex.com + +[o:silverstripe:p:silverstripe-crontask:r:master] +file_filter = lang/.yml +source_file = lang/en.yml +source_lang = en +type = YML + + diff --git a/lang/_manifest_exclude b/lang/_manifest_exclude new file mode 100644 index 0000000..e69de29 diff --git a/lang/en.yml b/lang/en.yml new file mode 100644 index 0000000..c7778a0 --- /dev/null +++ b/lang/en.yml @@ -0,0 +1,18 @@ +en: + SilverStripe\CronTask\Controllers\CronTaskController: + NO_IMPLEMENTERS: 'There are no implementators of CronTask to run' + WILL_RUN_AT: '{task} will run at {time}.' + WILL_START_NOW: '{task} will start now.' + SilverStripe\CronTask\CronTaskController: + NO_IMPLEMENTERS: 'There are no implementators of CronTask to run' + WILL_RUN_AT: '{task} will run at {time}.' + WILL_START_NOW: '{task} will start now.' + SilverStripe\CronTask\CronTaskStatus: + PLURALNAME: 'Cron Task Statuss' + PLURALS: + one: 'A Cron Task Status' + other: '{count} Cron Task Statuss' + SINGULARNAME: 'Cron Task Status' + db_LastChecked: 'Last checked' + db_LastRun: 'Last run' + db_TaskClass: 'Task class' diff --git a/src/Controllers/CronTaskController.php b/src/Controllers/CronTaskController.php index 60d6023..a71bbe8 100644 --- a/src/Controllers/CronTaskController.php +++ b/src/Controllers/CronTaskController.php @@ -133,7 +133,7 @@ public function index(HTTPRequest $request) // Check each task $tasks = ClassInfo::implementorsOf(CronTask::class); if (empty($tasks)) { - $this->output("There are no implementators of CronTask to run", 2); + $this->output(_t(self::class . '.NO_IMPLEMENTERS', 'There are no implementators of CronTask to run'), 2); return; } foreach ($tasks as $subclass) { @@ -157,10 +157,17 @@ public function runTask(CronTask $task) // Update status of this task prior to execution in case of interruption CronTaskStatus::update_status(get_class($task), $isDue); if ($isDue) { - $this->output(get_class($task) . ' will start now.'); + $this->output(_t(self::class . '.WILL_START_NOW', '{task} will start now.', ['task' => get_class($task)])); $task->process(); } else { - $this->output(get_class($task) . ' will run at ' . $cron->getNextRunDate()->format('Y-m-d H:i:s') . '.', 2); + $this->output( + _t( + self::class . '.WILL_RUN_AT', + '{task} will run at {time}.', + ['task' => get_class($task), 'time' => $cron->getNextRunDate()->format('Y-m-d H:i:s')] + ), + 2 + ); } }