From 47cb5d3cc3ebfdf3bc4d44c2dc04dc6b02b5e637 Mon Sep 17 00:00:00 2001 From: Andrew Gallagher Date: Thu, 28 Jun 2012 18:08:59 -0700 Subject: [PATCH] Revert "Revert "Mark date and time format translatable"" This reverts commit 24a025becbf6780389d24b0a8bccb4ad68317c45. --- src/view/viewutils.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/view/viewutils.php b/src/view/viewutils.php index c1e63e700b..880d11653d 100644 --- a/src/view/viewutils.php +++ b/src/view/viewutils.php @@ -54,21 +54,21 @@ function phabricator_time($epoch, $user) { return phabricator_format_local_time( $epoch, $user, - 'g:i A'); + pht('g:i A')); } - function phabricator_datetime($epoch, $user) { +function phabricator_datetime($epoch, $user) { return phabricator_format_local_time( $epoch, $user, - _phabricator_date_format($epoch).', g:i A'); + pht('%s, g:i A', _phabricator_date_format($epoch))); } function _phabricator_date_format($epoch) { - $format = 'M j Y'; + $format = pht('M j Y'); $now = time(); if ($epoch <= $now && $epoch > $now - 30 * 24 * 60 * 60) { - $format = 'D, M j'; + $format = pht('D, M j'); } return $format; } @@ -115,7 +115,7 @@ function phabricator_format_local_time($epoch, $user, $format) { $date->setTimeZone($zone); - return $date->format($format); + return PhutilTranslator::getInstance()->translateDate($format, $date); } function phabricator_format_relative_time($duration) {