1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-21 22:32:41 +01:00

Add "pht_list()", a translation wrapper for lists of items

Summary: Ref T13603. This is just a small piece of cleanup I've wanted to do for a while: different languages might have different list separators and repeating this implosion manually all over the place is a bit ugly even if the beahvior is never a function of translation language.

Test Plan: See next change.

Maniphest Tasks: T13603

Differential Revision: https://secure.phabricator.com/D21814
This commit is contained in:
epriestley 2022-05-12 10:54:55 -07:00
parent fc5b228db5
commit 3cc486d5c1
2 changed files with 5 additions and 0 deletions

View file

@ -968,6 +968,7 @@ phutil_register_library_map(array(
'nonempty' => 'utils/utils.php',
'phlog' => 'error/phlog.php',
'pht' => 'internationalization/pht.php',
'pht_list' => 'internationalization/pht.php',
'phutil_build_http_querystring' => 'utils/utils.php',
'phutil_build_http_querystring_from_pairs' => 'utils/utils.php',
'phutil_censor_credentials' => 'utils/utils.php',

View file

@ -44,3 +44,7 @@ function phutil_count($countable) {
function phutil_person(PhutilPerson $person) {
return $person;
}
function pht_list(array $items) {
return implode(', ', $items);
}