Symfony4 uses ICU for translations. I want a rich display of time values in my translation - in French. For instance, 1.25 hours should display "One hour and a quarter" - pardon my french.
Yet, i found no way to escape dots, or wrap my "key" value with quotes. The following example always returns a U_PATTERN_SYNTAX_ERROR if i try any way of escaping the dot:
messages+intl-icu.fr.yml
durationHours: >-
{n, select,
0 {Non précisé}
1 {1 heure}
1.25 {1 heure et quart}
other {{n} heures}
}
TaskService.php
$this->tl->trans('task.durationHours', ['n' => $task->getDurationInHours()]);
The docs i based my research upon: