Allow customization/localization of 'Last changed: ' text #11

Open
opened 2024-11-09 12:42:50 +00:00 by bartvanderwal · 0 comments
bartvanderwal commented 2024-11-09 12:42:50 +00:00 (Migrated from github.com)

The text Last changed: 2021-11-05 is fine as a default, but could it also be made configurable, so I can localize it for Dutch?

A last-changed-text. Ideally also with a variable position of the date. So you could also change it to a more verbose

This page was last changed on 2024-22-12

This is longer, but does make explicit that the date is per page, and not for the whole website which some users might assume.
It also allows a different place in the text of the date like in some languages/constructions like this German:

Diese Seite wurde zuletzt am 2024-22-12 geändert.

This feature request was split out from #10.

Optional: Allow different date formats

A level up of this feature would be an extra date-format option. Which you could set to also include the time, change separator character and/or have a date with for instance "day-month-year" order instead of the default "year-month-day". You could (internally) use the Crono crate to support date formats.

Here some examples (usable for unit tests!? 😉 )

  • : "%Y-%m-%d %H:%M"

This page was last changed on 2024-22-12 10:02

  • change separator character from - to / and have date with for instance day-month-year order: "%d//%m%Y"

This page was last changed on 22/12/2024

  • default year-month-day date : Don't use/set the setting (or use "%Y-%m-%d" to make explicit)

This page was last changed on 2024-11-05

The text `Last changed: 2021-11-05` is fine as a default, but could it also be made configurable, so I can localize it for Dutch? A `last-changed-text`. Ideally also with a variable position of the date. So you could also change it to a more verbose > This page was last changed on 2024-22-12 This is longer, but does make explicit that the date is per page, and not for the whole website which some users might assume. It also allows a different place in the text of the date like in some languages/constructions like this German: > Diese Seite wurde zuletzt am 2024-22-12 geändert. This feature request was split out from #10. ## Optional: Allow different date formats A level up of this feature would be an extra `date-format` option. Which you could set to also include the time, change separator character and/or have a date with for instance "day-month-year" order instead of the default "year-month-day". You could (internally) use the [Crono crate](https://rustjobs.dev/blog/date-time-formatting-in-rust/) to support date formats. Here some examples (usable for unit tests!? 😉 ) - : `"%Y-%m-%d %H:%M"` > This page was last changed on 2024-22-12 10:02 - change separator character from `-` to `/` and have date with for instance day-month-year order: `"%d//%m%Y"` > This page was last changed on 22/12/2024 - default year-month-day date : Don't use/set the setting (or use `"%Y-%m-%d"` to make explicit) > This page was last changed on 2024-11-05
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
jer/mdbook-last-changed#11
No description provided.