@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Mark date and time format translatable

Summary:
This allows translations to specify custom date and time format.
We will need to call `setlocale()` or build system independent on it at some point but I guess it is good for now.

Test Plan: Translated 'D, M j, g:i A', saw it in diff.

Reviewers: btrahan, epriestley

Reviewed By: btrahan

CC: aran, Korvin

Maniphest Tasks: T1139, T1321

Differential Revision: https://secure.phabricator.com/D2809

vrana e3eb8d55 a7a978d1

+6 -6
+6 -6
src/view/viewutils.php
··· 54 54 return phabricator_format_local_time( 55 55 $epoch, 56 56 $user, 57 - 'g:i A'); 57 + pht('g:i A')); 58 58 } 59 59 60 - function phabricator_datetime($epoch, $user) { 60 + function phabricator_datetime($epoch, $user) { 61 61 return phabricator_format_local_time( 62 62 $epoch, 63 63 $user, 64 - _phabricator_date_format($epoch).', g:i A'); 64 + pht('%s, g:i A', _phabricator_date_format($epoch))); 65 65 } 66 66 67 67 function _phabricator_date_format($epoch) { 68 - $format = 'M j Y'; 68 + $format = pht('M j Y'); 69 69 $now = time(); 70 70 if ($epoch <= $now && $epoch > $now - 30 * 24 * 60 * 60) { 71 - $format = 'D, M j'; 71 + $format = pht('D, M j'); 72 72 } 73 73 return $format; 74 74 } ··· 115 115 116 116 $date->setTimeZone($zone); 117 117 118 - return $date->format($format); 118 + return PhutilTranslator::getInstance()->translateDate($format, $date); 119 119 } 120 120 121 121 function phabricator_format_relative_time($duration) {