allow user-specified buttonText to override buttonIcons

This commit is contained in:
Adam Shaw
2014-05-21 17:00:51 -07:00
parent 107cf134f2
commit dda017efe2
44 changed files with 89 additions and 84 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("ar", {
buttonText: {
defaultButtonText: {
month: "شهر",
week: "أسبوع",
day: "يوم",
list: "أجندة"
},
allDayText: "اليوم كله"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("bg", {
buttonText: {
defaultButtonText: {
month: "Месец",
week: "Седмица",
day: "Ден",
list: "График"
},
allDayText: "Цял ден"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("ca", {
buttonText: {
defaultButtonText: {
month: "Mes",
week: "Setmana",
day: "Dia",
list: "Agenda"
},
allDayText: "Tot el dia"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("cs", {
buttonText: {
defaultButtonText: {
month: "Měsíc",
week: "Týden",
day: "Den",
list: "Agenda"
},
allDayText: "Celý den"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("da", {
buttonText: {
defaultButtonText: {
month: "Måned",
week: "Uge",
day: "Dag",
list: "Agenda"
},
allDayText: "Hele dagen"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("de", {
buttonText: {
defaultButtonText: {
month: "Monat",
week: "Woche",
day: "Tag",
list: "Terminübersicht"
},
allDayText: "Ganztägig"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("el", {
buttonText: {
defaultButtonText: {
month: "Μήνας",
week: "Εβδομάδα",
day: "Ημέρα",
list: "Ατζέντα"
},
allDayText: "Ολοήμερο"
});
});
+1 -1
View File
@@ -3,4 +3,4 @@ $.fullCalendar.lang("en-gb", {
columnFormat: {
week: 'ddd D/M'
}
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("es", {
buttonText: {
defaultButtonText: {
month: "Mes",
week: "Semana",
day: "Día",
list: "Agenda"
},
allDayText: "Todo el día"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("fa", {
buttonText: {
defaultButtonText: {
month: "ماه",
week: "هفته",
day: "روز",
list: "برنامه"
},
allDayText: "تمام روز"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("fi", {
buttonText: {
defaultButtonText: {
month: "Kuukausi",
week: "Viikko",
day: "Päivä",
list: "Tapahtumat"
},
allDayText: "Koko päivä"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("fr", {
buttonText: {
defaultButtonText: {
month: "Mois",
week: "Semaine",
day: "Jour",
list: "Mon planning"
},
allDayHTML: "Toute la journée" // allDayHTML is discouraged but used here as a hack to get the breaking correct
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("hi", {
buttonText: {
defaultButtonText: {
month: "महीना",
week: "सप्ताह",
day: "दिन",
list: "कार्यसूची"
},
allDayText: "सभी दिन"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("hr", {
buttonText: {
defaultButtonText: {
month: "Mjesec",
week: "Tjedan",
day: "Dan",
list: "Raspored"
},
allDayText: "Cijeli dan"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("hu", {
buttonText: {
defaultButtonText: {
month: "Hónap",
week: "Hét",
day: "Nap",
list: "Napló"
},
allDayText: "Egész nap"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("in", {
buttonText: {
defaultButtonText: {
month: "Bulan",
week: "Minggu",
day: "Hari",
list: "Agenda"
},
allDayText: "Sepanjang hari"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("it", {
buttonText: {
defaultButtonText: {
month: "Mese",
week: "Settimana",
day: "Giorno",
list: "Agenda"
},
allDayText: "Tutto il giorno"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("iw", {
buttonText: {
defaultButtonText: {
month: "חודש",
week: "שבוע",
day: "יום",
list: "סדר יום"
},
allDayText: "כל היום"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("ja", {
buttonText: {
defaultButtonText: {
month: "月",
week: "週",
day: "日",
list: "予定リスト"
},
allDayText: "終日"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("ko", {
buttonText: {
defaultButtonText: {
month: "월",
week: "주",
day: "일",
list: "일정목록"
},
allDayText: "종일"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("lt", {
buttonText: {
defaultButtonText: {
month: "Mėnuo",
week: "Savaitė",
day: "Diena",
list: "Darbotvarkė"
},
allDayText: "Visą dieną"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("lv", {
buttonText: {
defaultButtonText: {
month: "Mēnesis",
week: "Nedēļa",
day: "Diena",
list: "Dienas kārtība"
},
allDayText: "Visu dienu"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("nl", {
buttonText: {
defaultButtonText: {
month: "Maand",
week: "Week",
day: "Dag",
list: "Agenda"
},
allDayText: "Hele dag"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("no", {
buttonText: {
defaultButtonText: {
month: "Måned",
week: "Uke",
day: "Dag",
list: "Agenda"
},
allDayText: "Hele dagen"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("pl", {
buttonText: {
defaultButtonText: {
month: "Miesiąc",
week: "Tydzień",
day: "Dzień",
list: "Plan dnia"
},
allDayText: "Cały dzień"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("pt-br", {
buttonText: {
defaultButtonText: {
month: "Mês",
week: "Semana",
day: "Dia",
list: "Compromissos"
},
allDayText: "dia inteiro"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("pt", {
buttonText: {
defaultButtonText: {
month: "Mês",
week: "Semana",
day: "Dia",
list: "Agenda"
},
allDayText: "Todo o dia"
});
});
+2 -2
View File
@@ -1,6 +1,6 @@
$.fullCalendar.lang("ro", {
buttonText: {
defaultButtonText: {
prev: "precedentă", // override JQUI's translations, which contains the word "month"
next: "următoare", // "
month: "Lună",
@@ -9,4 +9,4 @@ $.fullCalendar.lang("ro", {
list: "Agendă"
},
allDayText: "Toată ziua"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("ru", {
buttonText: {
defaultButtonText: {
month: "Месяц",
week: "Неделя",
day: "День",
list: "Повестка дня"
},
allDayText: "Весь день"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("sk", {
buttonText: {
defaultButtonText: {
month: "Mesiac",
week: "Týždeň",
day: "Deň",
list: "Rozvrh"
},
allDayText: "Celý deň"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("sl", {
buttonText: {
defaultButtonText: {
month: "Mesec",
week: "Teden",
day: "Dan",
list: "Dnevni red"
},
allDayText: "Ves dan"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("sr", {
buttonText: {
defaultButtonText: {
month: "Месец",
week: "Недеља",
day: "Дан",
list: "Планер"
},
allDayText: "Цео дан"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("sv", {
buttonText: {
defaultButtonText: {
month: "Månad",
week: "Vecka",
day: "Dag",
list: "Program"
},
allDayText: "Heldag"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("th", {
buttonText: {
defaultButtonText: {
month: "เดือน",
week: "สัปดาห์",
day: "วัน",
list: "แผนงาน"
},
allDayText: "ตลอดวัน"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("tl", {
buttonText: {
defaultButtonText: {
month: "Buwan",
week: "Linggo",
day: "Araw",
list: "Pakay"
},
allDayText: "Lahat ng araw"
});
});
+2 -2
View File
@@ -1,6 +1,6 @@
$.fullCalendar.lang("tr", {
buttonText: {
defaultButtonText: {
next: "ileri", // override JQUI's, which has a non-closing HTML entity in it
month: "Ay",
week: "Hafta",
@@ -8,4 +8,4 @@ $.fullCalendar.lang("tr", {
list: "Ajanda"
},
allDayText: "Tüm gün"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("uk", {
buttonText: {
defaultButtonText: {
month: "Місяць",
week: "Тиждень",
day: "День",
list: "Порядок денний"
},
allDayText: "Увесь день"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("vi", {
buttonText: {
defaultButtonText: {
month: "Tháng",
week: "Tuần",
day: "Ngày",
list: "Lịch biểu"
},
allDayText: "Cả ngày"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("zh-cn", {
buttonText: {
defaultButtonText: {
month: "月",
week: "周",
day: "日",
list: "日程"
},
allDayText: "全天"
});
});
+2 -2
View File
@@ -1,10 +1,10 @@
$.fullCalendar.lang("zh-tw", {
buttonText: {
defaultButtonText: {
month: "月",
week: "週",
day: "天",
list: "待辦事項"
},
allDayText: "全天"
});
});
+7 -3
View File
@@ -72,17 +72,21 @@ function Header(calendar, options) {
// smartProperty allows different text per view button (ex: "Agenda Week" vs "Basic Week")
var themeIcon = smartProperty(options.themeButtonIcons, buttonName);
var normalIcon = smartProperty(options.buttonIcons, buttonName);
var text = smartProperty(options.buttonText, buttonName);
var defaultText = smartProperty(options.defaultButtonText, buttonName);
var customText = smartProperty(options.buttonText, buttonName);
var html;
if (themeIcon && options.theme) {
if (customText) {
html = htmlEscape(customText);
}
else if (themeIcon && options.theme) {
html = "<span class='ui-icon ui-icon-" + themeIcon + "'></span>";
}
else if (normalIcon && !options.theme) {
html = "<span class='fc-icon fc-icon-" + normalIcon + "'></span>";
}
else {
html = htmlEscape(text || buttonName);
html = htmlEscape(defaultText || buttonName);
}
var button = $(
+1 -1
View File
@@ -49,7 +49,7 @@ var defaults = {
// locale
isRTL: false,
buttonText: {
defaultButtonText: {
prev: "prev",
next: "next",
prevYear: "prev year",
+1 -1
View File
@@ -23,7 +23,7 @@ fc.datepickerLang = function(langCode, datepickerLangCode, options) {
'YYYY[' + options.yearSuffix + '] MMMM' :
'MMMM YYYY[' + options.yearSuffix + ']'
},
buttonText: {
defaultButtonText: {
// the translations sometimes wrongly contain HTML entities
prev: stripHTMLEntities(options.prevText),
next: stripHTMLEntities(options.nextText),
+1
View File
@@ -159,6 +159,7 @@ function arrayMax(a) {
function smartProperty(obj, name) { // get a camel-cased/namespaced property of an object
obj = obj || {};
if (obj[name] !== undefined) {
return obj[name];
}