mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-25 08:35:29 +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
94 lines
2.7 KiB
JavaScript
94 lines
2.7 KiB
JavaScript
// moment.js language configuration
|
||
// language : turkish (tr)
|
||
// authors : Erhan Gundogan : https://github.com/erhangundogan,
|
||
// Burak Yiğit Kaya: https://github.com/BYK
|
||
|
||
(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) {
|
||
|
||
var suffixes = {
|
||
1: "'inci",
|
||
5: "'inci",
|
||
8: "'inci",
|
||
70: "'inci",
|
||
80: "'inci",
|
||
|
||
2: "'nci",
|
||
7: "'nci",
|
||
20: "'nci",
|
||
50: "'nci",
|
||
|
||
3: "'üncü",
|
||
4: "'üncü",
|
||
100: "'üncü",
|
||
|
||
6: "'ncı",
|
||
|
||
9: "'uncu",
|
||
10: "'uncu",
|
||
30: "'uncu",
|
||
|
||
60: "'ıncı",
|
||
90: "'ıncı"
|
||
};
|
||
|
||
return moment.lang('tr', {
|
||
months : "Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),
|
||
monthsShort : "Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),
|
||
weekdays : "Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),
|
||
weekdaysShort : "Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),
|
||
weekdaysMin : "Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),
|
||
longDateFormat : {
|
||
LT : "HH:mm",
|
||
L : "DD.MM.YYYY",
|
||
LL : "D MMMM YYYY",
|
||
LLL : "D MMMM YYYY LT",
|
||
LLLL : "dddd, D MMMM YYYY LT"
|
||
},
|
||
calendar : {
|
||
sameDay : '[bugün saat] LT',
|
||
nextDay : '[yarın saat] LT',
|
||
nextWeek : '[haftaya] dddd [saat] LT',
|
||
lastDay : '[dün] LT',
|
||
lastWeek : '[geçen hafta] dddd [saat] LT',
|
||
sameElse : 'L'
|
||
},
|
||
relativeTime : {
|
||
future : "%s sonra",
|
||
past : "%s önce",
|
||
s : "birkaç saniye",
|
||
m : "bir dakika",
|
||
mm : "%d dakika",
|
||
h : "bir saat",
|
||
hh : "%d saat",
|
||
d : "bir gün",
|
||
dd : "%d gün",
|
||
M : "bir ay",
|
||
MM : "%d ay",
|
||
y : "bir yıl",
|
||
yy : "%d yıl"
|
||
},
|
||
ordinal : function (number) {
|
||
if (number === 0) { // special case for zero
|
||
return number + "'ıncı";
|
||
}
|
||
var a = number % 10,
|
||
b = number % 100 - a,
|
||
c = number >= 100 ? 100 : null;
|
||
|
||
return number + (suffixes[a] || suffixes[b] || suffixes[c]);
|
||
},
|
||
week : {
|
||
dow : 1, // Monday is the first day of the week.
|
||
doy : 7 // The week that contains Jan 1st is the first week of the year.
|
||
}
|
||
});
|
||
}));
|