stable

Clone or download

Read-only

feat: i18n of timeframe dates

The timeframe dates in roadmap are displayed like "april 24, 2023". This is done by using the integrated Intl.DateTimeFormatter in the browser. For timeframe dates in tooltips, since they are generated by the backend we should use PHP's counterpart IntlDateFormatter. This will allow us to have "24 avril 2023" in french for example, as soon as we provide the pattern. Until now, we were relying of tab files to get the format of a date. Tab files are things of the past and we don't want to platform administrators to be able to customize the pattern. A new helper class is now available to provide the pattern according to current user's locale. This means that when Tuleap will support a new language (for example pt_BR), we will have to edit this file to insert the expected format. Ideally we should remove entries datefmt* from tab files to replace them with dedicated function in this new DateFormat helper. To test: have an artifact with a timeframe semantic displayed in the tooltip. The start/end dates of the semantic should respect user's locale. Part of story #26777: have artifact tooltips on roadmap Change-Id: I4ba0418447746a763493a13b24a590f7751c1472

Modified Files

Name
M plugins/tracker/include/Tracker/Semantic/Tooltip/OtherSemantic/TimeframeTooltipEntry.php +5 −2 Go to diff View file
A src/common/language/DateFormat.php +45 −0 Go to diff View file
A tests/unit/common/language/DateFormatTest.php +42 −0 Go to diff View file