Template:Month

Permanently protected template
From Meta, a Wikimedia project coordination wiki

April 2024

Template documentation


Usage

This correctly format the combination of a month name and a year number according to the language code passed in parameter, or (if it's not defined or empty) according to the page content language, or (not recommanded) the user language if the page has no defined content language.

Then the actual language used will depend on fallback languages supported by the #time: parser function if the language selected above has no specific support, and it may fallback to the English format.

Parameters

The two positional parameters, normally required, are the month number, and the year number (in Gregorian calendar), in that order.

The lang parameter is optional, if it is set, it should be a standard language code supported by MediaWiki translations

Technical notes

This template uses special code to generate the appropriate format to use with #time:, as some languages need different separators or order of elements (such as Korean, Japanese and Chinese), or need a different year numbering (such as Thai not using the chistian era), or some complex number format for years (such as Latin, using Roman numbers written with capital Latin letters).

Note that #time automatically supports the conversion of numbers using national digits (such as those used in Arabic, Persian by default, not in Hebrew, or in most Indic scripts).

The order of elements is month then year for most languages, including in RTL scripts (the month name will be displayed to the right, i.e. still at the begining of the returned string). except Korean, Japanese and Chinese (and the numeric-only ISO 8601 format YYYY-MM with ASCII digits, a format not generated here as it is not used natively in any language).

As of now, only 6 languages require specific formats not matching the default format "F Y" used for most languages, these are: Hungarian (hu), Latin (la), Thai (th), Korean (ko), Japanese (ja) and Chinese (zh), and their script variants (or languages falling back to them).

The template will work also when the user language is set dynamically (it should not alter the format of digits, unless this language is the actual language used).

Some languages may be supported without still having enough resources to translate their month names, so these languages may still display month names in English: you fix that by helping localizing MediaWiki on Translatewiki.net ; at least all supported languages with a localized version of a Wikimedia wiki project are supported to be able to insert dates with user signatures in talk pages).

Examples

Using by default the page content language (or the user language if it's not available, as in this documentation)
  • {{Month|01|2014}}: January 2014
Some LTR languages using the default format "F Y" (with ASCII digits)
  • with lang=en (English): January 2014
  • with lang=fr (French): Janvier 2014
  • with lang=el (Greek): Ιανουάριος 2014
  • with lang=ru (Russian): Январь 2014
  • with lang=bg (Bulgarian): Януари 2014
  • with lang=sr (Serbian): Јануар 2014
  • with lang=hy (Armenian): Հունվար 2014
  • with lang=ka (Georgian): იანვარი 2014
  • with lang=ta (Tamil): சனவரி 2014 (traditional Tamil numbers (not decimal digits as there's no zero) exist too, but are not used here with the Gregorian era)
  • with lang=te (Telugu): జనవరి 2014 (FIXME: traditional Telugu decimal digits exist too, but are not used here with the Gregorian era)
  • with lang=ml (Malayalam): ജനുവരി 2014 (FIXME:traditional Malayalam decimal digits exist too, but are not used here with the Gregorian era)
  • with lang=am (Amharic): ጃንዩዌሪ 2014
  • with lang=iu (Inuktitut): ᔭᓐᓄᐊᓕ 2014
Some LTR languages using national digits (but still not requiring special formats)
  • with lang=hi (Hindi): जनवरी २०१४
  • with lang=ne (Nepali): जनवरी २०१४
  • with lang=as (Assamese): জানুৱাৰী ২০১৪
  • with lang=bn (Bangla): জানুয়ারি ২০১৪
  • with lang=pa (Punjabi): ਜਨਵਰੀ 2014
  • with lang=gu (Gujarati): જાન્યુઆરી ૨૦૧૪
  • with lang=or (Odia): ଜାନୁଆରୀ ୨୦୧୪
  • with lang=kn (Kannada): ಜನವರಿ ೨೦೧೪
  • with lang=km (Khmer): ខែមករា ២០១៤
  • with lang=lo (Lao): ມັງກອນ ໒໐໑໔
  • with lang=bo (Tibetan): ཟླ་བ་དང་པོ། ༢༠༡༤
  • with lang=dz (Dzongkha): སྤྱི་ཟླ་དང་པ། ༢༠༡༤
Some RTL languages (still using ASCII digits and same format, read in logical order)
  • with lang=he (Hebrew): ינואר 2014 (traditional Hebrew decimal digits exist too, but are not used here with the Gregorian era)
  • with lang=yi (Yiddish): יאַנואַר 2014 (traditional Hebrew decimal digits exist too, but are not used here with the Gregorian era)
  • with lang=ur (Urdu): جنوری 2014 (FIXME: traditional Perso-Arabic decimal digits exist too, but are not used with the Gregorian era)
  • with lang=ps (Pashto): جنوري ۲۰۱۴ (FIXME: traditional Perso-Arabic decimal digits exist too, but are not used with the Gregorian era)
  • with lang=dv (Divehi): ޖަނަވަރީ 2014
Some RTL languages using also national digits (but still not requiring special formats)
  • with lang=ar (Arabic): يناير ٢٠١٤
  • with lang=ckb (Central Kurdish): کانوونی دووەمی ٢٠١٤
  • with lang=fa (Persian): ژانویه ۲۰۱۴
Some LTR languages needing with special year numbering format
  • with lang=la (Latin): Ianuarius MMXIV (this should use Roman numbers)
  • with lang=th (Thai): มกราคม 2557 (FIXME: traditional Thai decimal digits exist too and should probably be used for the traditional era, but ASCII digits are used like with the Gregorian era. Using ASCII digits for year numbering in the traditional Thai calendar currently matches the practice in Thai Wikipedia, but it may contradict usage in other Thai medias and could create confusion for historical dates in the 16th Gregorian century or before, if the era is not explicitly specified.)
Some LTR languages needing with special formats requiring specific suffixes for year, possibly without separator, and with different logical order (but that can still be using ASCII digits with these suffixes)
  • with lang=hu (Hungarian): 2014. január
  • with lang=ko (Korean): 2014년 1월 (traditional sinographic numbers (not decimal digits) exist too, but are not used here with the Gregorian era)
  • with lang=ja (Japanese): 2014年1月 (traditional sinographic numbers (not decimal digits) exist too, but are not used here with the Gregorian era)
  • with lang=zh (Chinese): 2014年1月 (traditional sinographic numbers (not decimal digits) exist too, but are not used here with the Gregorian era)
  • with lang=zh-hant (Traditional Chinese): 2014年1月 (traditional sinographic numbers (not decimal digits) exist too, but are not used here with the Gregorian era)