YOURLS
YOURLS copied to clipboard
Localization support for date and time display
Proposed functionality
In YOURLS, values like "M d, Y H:i" are passed as arguments to the yourls_date_i18n() function. I would like these arguments to be treated as localization targets using the yourls__() function. While it may be possible to handle this through filters, I believe addressing it through localization is more natural.
Use case
Site users will be able to use date formats that follow their locale.
Potential solution
Rewrite code like below. No potential impact for the current user.
- yourls_date_i18n( yourls_get_datetime_format('M d, Y H:i'), yourls_get_timestamp( $timestamp ))
+ yourls_date_i18n( yourls_get_datetime_format( yourls__('M d, Y H:i') ), yourls_get_timestamp( $timestamp ))
Indeed. We translate individual words like day and month, but not the whole date format.