[ Index ] |
PHP Cross Reference of MediaWiki-1.24.0 |
[Summary view] [Print] [Text view]
1 // moment.js locale configuration 2 // locale : Bengali (bn) 3 // author : Kaushik Gandhi : https://github.com/kaushikgandhi 4 5 (function (factory) { 6 if (typeof define === 'function' && define.amd) { 7 define(['moment'], factory); // AMD 8 } else if (typeof exports === 'object') { 9 module.exports = factory(require('../moment')); // Node 10 } else { 11 factory(window.moment); // Browser global 12 } 13 }(function (moment) { 14 var symbolMap = { 15 '1': '১', 16 '2': '২', 17 '3': '৩', 18 '4': '৪', 19 '5': '৫', 20 '6': '৬', 21 '7': '৭', 22 '8': '৮', 23 '9': '৯', 24 '0': '০' 25 }, 26 numberMap = { 27 '১': '1', 28 '২': '2', 29 '৩': '3', 30 '৪': '4', 31 '৫': '5', 32 '৬': '6', 33 '৭': '7', 34 '৮': '8', 35 '৯': '9', 36 '০': '0' 37 }; 38 39 return moment.defineLocale('bn', { 40 months : 'জানুয়ারী_ফেবুয়ারী_মার্চ_এপ্রিল_মে_জুন_জুলাই_অগাস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর'.split('_'), 41 monthsShort : 'জানু_ফেব_মার্চ_এপর_মে_জুন_জুল_অগ_সেপ্ট_অক্টো_নভ_ডিসেম্'.split('_'), 42 weekdays : 'রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পত্তিবার_শুক্রুবার_শনিবার'.split('_'), 43 weekdaysShort : 'রবি_সোম_মঙ্গল_বুধ_বৃহস্পত্তি_শুক্রু_শনি'.split('_'), 44 weekdaysMin : 'রব_সম_মঙ্গ_বু_ব্রিহ_শু_শনি'.split('_'), 45 longDateFormat : { 46 LT : 'A h:mm সময়', 47 L : 'DD/MM/YYYY', 48 LL : 'D MMMM YYYY', 49 LLL : 'D MMMM YYYY, LT', 50 LLLL : 'dddd, D MMMM YYYY, LT' 51 }, 52 calendar : { 53 sameDay : '[আজ] LT', 54 nextDay : '[আগামীকাল] LT', 55 nextWeek : 'dddd, LT', 56 lastDay : '[গতকাল] LT', 57 lastWeek : '[গত] dddd, LT', 58 sameElse : 'L' 59 }, 60 relativeTime : { 61 future : '%s পরে', 62 past : '%s আগে', 63 s : 'কএক সেকেন্ড', 64 m : 'এক মিনিট', 65 mm : '%d মিনিট', 66 h : 'এক ঘন্টা', 67 hh : '%d ঘন্টা', 68 d : 'এক দিন', 69 dd : '%d দিন', 70 M : 'এক মাস', 71 MM : '%d মাস', 72 y : 'এক বছর', 73 yy : '%d বছর' 74 }, 75 preparse: function (string) { 76 return string.replace(/[১২৩৪৫৬৭৮৯০]/g, function (match) { 77 return numberMap[match]; 78 }); 79 }, 80 postformat: function (string) { 81 return string.replace(/\d/g, function (match) { 82 return symbolMap[match]; 83 }); 84 }, 85 //Bengali is a vast language its spoken 86 //in different forms in various parts of the world. 87 //I have just generalized with most common one used 88 meridiem : function (hour, minute, isLower) { 89 if (hour < 4) { 90 return 'রাত'; 91 } else if (hour < 10) { 92 return 'শকাল'; 93 } else if (hour < 17) { 94 return 'দুপুর'; 95 } else if (hour < 20) { 96 return 'বিকেল'; 97 } else { 98 return 'রাত'; 99 } 100 }, 101 week : { 102 dow : 0, // Sunday is the first day of the week. 103 doy : 6 // The week that contains Jan 1st is the first week of the year. 104 } 105 }); 106 }));
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 14:03:12 2014 | Cross-referenced by PHPXref 0.7.1 |