Open Susko3 opened 2 years ago
(continuation from https://github.com/ppy/osu-framework/pull/5538#discussion_r1039044155)
osu-web
uses custom date format strings for some usages, defined per-language: Japanese, English.
I don't know from where it gets regular date format strings, but they are (mostly) appropriate for the currently selected language. Example:
Not using culture-appropriate format:
There is also this formatter for relative time.
Using regular .NET date time format strings doesn't work, as they don't exactly match osu-web
.
en
uses month/day/year and not day/month/year format that osu!web uses.D
usually has the weekday (dddd
): Monday, 15 June 2009
Y
does exist, there is no 'short' versionSomeone using en-US
might expect their dates to be formatted as June 15, 2009
and not 15 June 2009
.
osu! mostly uses the long date format with month names (where there is no ambiguity, at least in English), but there is one usage of the short date yyyy-MM-dd
where the user might confuse the month and day.
So I though that re-using the existing localisation infrastructure and providing a custom format provider that formatted dates the same as osu-web could work. Using a format provider that respects not only the selected language in osu!, but also respects the user's date format (within reason) seemed like a good idea.
Type
Cosmetic
Bug description
Noticed while investigating https://github.com/ppy/osu/issues/21146.
Date formats are hardcoded throughout the code:
https://github.com/ppy/osu/blob/f8830c6850128456266c82de83273204f8b74ac0/osu.Game/Graphics/DateTooltip.cs#L72-L73
Using standard date format strings and properly utilising
TranslatableString
should help with this.Screenshots or videos
Game:
Web:
Version
2022.1101.0
Logs
performance.log runtime.log updater.log database.log input.log network.log