Don't link to PHP @ php.net when running HHVM
[mediawiki.git] / resources / src / mediawiki.language / mediawiki.language.months.js
blob5a1a5cb64ad556d676da896c10c9f66aceccdb10
1 /*
2 * Transfer of month names from messages into mw.language.
4 * Loading this module also ensures the availability of appropriate messages via mw.msg.
5 */
6 ( function ( mw, $ ) {
7 var
8 monthMessages = [
9 'january', 'february', 'march', 'april',
10 'may_long', 'june', 'july', 'august',
11 'september', 'october', 'november', 'december'
13 monthGenMessages = [
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 ) {
27 return mw.msg( key );
30 /**
31 * Information about month names in current UI language.
33 * Object keys:
35 * - `names`: array of month names (in nominative case in languages which have the distinction),
36 * zero-indexed
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.
42 * @property
43 * @member mw.language
45 mw.language.months = {
46 keys: {
47 names: monthMessages,
48 genitive: monthGenMessages,
49 abbrev: monthAbbrevMessages
51 names: $.map( monthMessages, mwMsgMapper ),
52 genitive: $.map( monthGenMessages, mwMsgMapper ),
53 abbrev: $.map( monthAbbrevMessages, mwMsgMapper )
56 }( mediaWiki, jQuery ) );