diff --git a/lib/Application.php b/lib/Application.php index a90a712..0836d7e 100644 --- a/lib/Application.php +++ b/lib/Application.php @@ -31,6 +31,7 @@ use Horde\Cache\Cache as HordeCache; use Horde\Cache\FileStorage; +use Horde\Core\LanguageContext; use Horde\Date\Format as DateFormat; use Horde\Util\Variables; use Horde\Whups\Domain\AttributeRepositoryInterface; @@ -431,6 +432,7 @@ protected function _downloadTicket(Variables|Horde_Variables $vars) $ticket->setDetails($vars); $title = '[#' . $ticket->getId() . '] ' . $ticket->get('summary'); $filter = $injector->getInstance('Horde_Core_Factory_TextFilter'); + $locale = $injector->getInstance(LanguageContext::class)->getLocale(); $obfuscate = $conf['prefs']['obfuscate_email']; $conf['prefs']['obfuscate_email'] = false; @@ -517,10 +519,12 @@ protected function _downloadTicket(Variables|Horde_Variables $vars) ); $time = DateFormat::formatDate( $transaction['timestamp'], - $prefs->getValue('date_format') + $prefs->getValue('date_format'), + $locale ) . ' ' . DateFormat::formatDate( $transaction['timestamp'], - $prefs->getValue('time_format') + $prefs->getValue('time_format'), + $locale ); echo << diff --git a/lib/Form/Renderer/Comment.php b/lib/Form/Renderer/Comment.php index 364f952..e7a46ec 100644 --- a/lib/Form/Renderer/Comment.php +++ b/lib/Form/Renderer/Comment.php @@ -8,6 +8,7 @@ * * @package Whups */ +use Horde\Core\LanguageContext; use Horde\Date\Format as DateFormat; class Whups_Form_Renderer_Comment extends Horde_Form_Renderer @@ -27,7 +28,7 @@ public function begin($title) public function render($transaction, $vars) { - global $prefs, $conf, $registry; + global $prefs, $conf, $registry, $injector; static $canUpdate, $comment_count = 0; if (!isset($canUpdate)) { @@ -38,6 +39,7 @@ public function render($transaction, $vars) $comment = ''; $private = false; $changes = []; + $locale = $injector->getInstance(LanguageContext::class)->getLocale(); $changelist = $vars->get('changes'); if (!$changelist) { @@ -258,7 +260,7 @@ public function render($transaction, $vars)
- +
get('timestamp'), $prefs->getValue('date_format')) . ' ' . DateFormat::formatDate($vars->get('timestamp'), $prefs->getValue('time_format')) ?>get('timestamp'), $prefs->getValue('date_format'), $locale) . ' ' . DateFormat::formatDate($vars->get('timestamp'), $prefs->getValue('time_format'), $locale) ?> get('user_id') ? Whups::formatUser($vars->get('user_id'), false, true, true) : ' ' ?> ', $changes) ?>