Template:Date
This is a translatable template to show dates. The purpose is to write dates once (e.g. in worksheet update logs) and be able to present them in different languages. Dates will be presented in a short format, following the Wikipedia Manual of Style regarding dates.
Usage
The template takes three anonymous (unnamed) parameters: year, month and day. Example:
{{Date|2022|05|06}}
will render as 6 May 2022 in English. To have the output translated use
{{Translatable template|Date|2022|05|06}}
This will render as 06.05.2022 in a German translation.
Translation
The benefit of this approach is that this template needs to be translated just once and then all dates will be displayed consistently and localized into this language. The two translation units define how exactly the date should be formatted:
- Formatting string
Examples:j M Y(English),d.m.Y(German).
See MediaWiki #time parser function documentation for a list of all possible codes - Language code
Examples:en(English),de(German).
If the date format has text (like the abbreviation of the month), define which language it should be displayed in. This is the language code parameter of the #time parser function.