2 * Transfer of month names from messages into mw.language.
4 * Loading this module also ensures the availability of appropriate messages via mw.msg.
9 'january', 'february', 'march', 'april',
10 'may_long', 'june', 'july', 'august',
11 'september', 'october', 'november', 'december'
14 'january-gen', 'february-gen', 'march-gen', 'april-gen',
15 'may-gen', 'june-gen', 'july-gen', 'august-gen',
16 'september-gen', 'october-gen', 'november-gen', 'december-gen'
18 monthAbbrevMessages = [
19 'jan', 'feb', 'mar', 'apr',
20 'may', 'jun', 'jul', 'aug',
21 'sep', 'oct', 'nov', 'dec'
24 // Function suitable for passing to Array.prototype.map
25 // Can't use mw.msg directly because Array.prototype.map passes element index as second argument
26 function mwMsgMapper( key ) {
27 // eslint-disable-next-line mediawiki/msg-doc
32 * @typedef {Object} mw.language~Months
33 * @property {Array} names Month names (in nominative case in languages which have the
34 * distinction), zero-indexed
35 * @property {Array} genitive Month names in genitive case, zero-indexed
36 * @property {Array} abbrev Three-letter-long abbreviated month names, zero-indexed
37 * @property {Object} key Object with three keys like the above, containing zero-indexed arrays
38 * of message keys for appropriate messages which can be passed to mw.msg
42 * Information about month names in current UI language.
46 mw.language.months = {
49 genitive: monthGenMessages,
50 abbrev: monthAbbrevMessages
52 names: monthMessages.map( mwMsgMapper ),
53 genitive: monthGenMessages.map( mwMsgMapper ),
54 abbrev: monthAbbrevMessages.map( mwMsgMapper )