Skip to content

Localization support for date and time displayΒ #3937

@infinitail

Description

@infinitail

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 ))

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions