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 jQuery.map
25 // Can't use mw.msg directly because jQuery.map passes element index as second argument
26 function mwMsgMapper( key
) {
31 * Information about month names in current UI language.
35 * - `names`: array of month names (in nominative case in languages which have the distinction),
37 * - `genitive`: array of month names in genitive case, zero-indexed
38 * - `abbrev`: array of three-letter-long abbreviated month names, zero-indexed
39 * - `keys`: object with three keys like the above, containing zero-indexed arrays of message keys
40 * for appropriate messages which can be passed to mw.msg.
45 mw
.language
.months
= {
48 genitive
: monthGenMessages
,
49 abbrev
: monthAbbrevMessages
51 names
: $.map( monthMessages
, mwMsgMapper
),
52 genitive
: $.map( monthGenMessages
, mwMsgMapper
),
53 abbrev
: $.map( monthAbbrevMessages
, mwMsgMapper
)
56 }( mediaWiki
, jQuery
) );