Create a utility function to translate ordinals dates

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

We currently have no way at GitLab to have a function that finds an ordinal based on a number that supports translation. This means that if we receive a number that can change and we need use an ordinal, we can't.

Each language as its own ordinals and this can become impossible to do. We will need to use some library to support this function.

Suggestion:

We could have a util function that returns the right orignal for each number and then the translator would translate each of these per language. The helper would probably need language-specific code to generate the correct ordinal for the language, and this is where Intl.PluralRules would be used, though it would require polyfilling:

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/PluralRules/PluralRules#Using_options

Context This could have been used in the schedule cron page and we had to do a workaround to get a decent phrasing. This is why it could be useful for the CI group to look into this.

Edited by 🤖 GitLab Bot 🤖