mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-12-01 03:06:17 +00:00
5d419682f5
Add moment.js ( http://momentjs.com/ ) as a ResourceLoader module and use it to parse and format date strings. Moment.js seems to be the least bad option right now; eventually it should be replaced by i18n functionality in core Javascript modules. Change-Id: I332655778be3d694781b83fa5dea1e59770d8866
72 lines
2.6 KiB
JavaScript
72 lines
2.6 KiB
JavaScript
// moment.js language configuration
|
|
// language : german (de)
|
|
// author : lluchs : https://github.com/lluchs
|
|
// author: Menelion Elensúle: https://github.com/Oire
|
|
|
|
(function (factory) {
|
|
if (typeof define === 'function' && define.amd) {
|
|
define(['moment'], factory); // AMD
|
|
} else if (typeof exports === 'object') {
|
|
module.exports = factory(require('../moment')); // Node
|
|
} else {
|
|
factory(window.moment); // Browser global
|
|
}
|
|
}(function (moment) {
|
|
function processRelativeTime(number, withoutSuffix, key, isFuture) {
|
|
var format = {
|
|
'm': ['eine Minute', 'einer Minute'],
|
|
'h': ['eine Stunde', 'einer Stunde'],
|
|
'd': ['ein Tag', 'einem Tag'],
|
|
'dd': [number + ' Tage', number + ' Tagen'],
|
|
'M': ['ein Monat', 'einem Monat'],
|
|
'MM': [number + ' Monate', number + ' Monaten'],
|
|
'y': ['ein Jahr', 'einem Jahr'],
|
|
'yy': [number + ' Jahre', number + ' Jahren']
|
|
};
|
|
return withoutSuffix ? format[key][0] : format[key][1];
|
|
}
|
|
|
|
return moment.lang('de', {
|
|
months : "Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),
|
|
monthsShort : "Jan._Febr._Mrz._Apr._Mai_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),
|
|
weekdays : "Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),
|
|
weekdaysShort : "So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),
|
|
weekdaysMin : "So_Mo_Di_Mi_Do_Fr_Sa".split("_"),
|
|
longDateFormat : {
|
|
LT: "H:mm [Uhr]",
|
|
L : "DD.MM.YYYY",
|
|
LL : "D. MMMM YYYY",
|
|
LLL : "D. MMMM YYYY LT",
|
|
LLLL : "dddd, D. MMMM YYYY LT"
|
|
},
|
|
calendar : {
|
|
sameDay: "[Heute um] LT",
|
|
sameElse: "L",
|
|
nextDay: '[Morgen um] LT',
|
|
nextWeek: 'dddd [um] LT',
|
|
lastDay: '[Gestern um] LT',
|
|
lastWeek: '[letzten] dddd [um] LT'
|
|
},
|
|
relativeTime : {
|
|
future : "in %s",
|
|
past : "vor %s",
|
|
s : "ein paar Sekunden",
|
|
m : processRelativeTime,
|
|
mm : "%d Minuten",
|
|
h : processRelativeTime,
|
|
hh : "%d Stunden",
|
|
d : processRelativeTime,
|
|
dd : processRelativeTime,
|
|
M : processRelativeTime,
|
|
MM : processRelativeTime,
|
|
y : processRelativeTime,
|
|
yy : processRelativeTime
|
|
},
|
|
ordinal : '%d.',
|
|
week : {
|
|
dow : 1, // Monday is the first day of the week.
|
|
doy : 4 // The week that contains Jan 4th is the first week of the year.
|
|
}
|
|
});
|
|
}));
|