Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
add translation for buttons: calendar
Nriverb99510ad4f98
diff --git a/src/public/app/widgets/buttons/calendar.js b/src/public/app/widgets/buttons/calendar.jsindex f05aedd9ae..3980ca8b33 100644--- a/src/public/app/widgets/buttons/calendar.js+++ b/src/public/app/widgets/buttons/calendar.js@@ -1,3 +1,4 @@+import { t } from "../../services/i18n.js";import libraryLoader from "../../services/library_loader.js";import utils from "../../services/utils.js";import dateNoteService from "../../services/date_notes.js";@@ -23,7 +24,7 @@ const DROPDOWN_TPL = `</div><div class="calendar-week">- <span>Mon</span> <span>Tue</span><span>Wed</span> <span>Thu</span> <span>Fri</span> <span>Sat</span> <span>Sun</span>+ <span>${t("calendar.mon")}</span> <span>${t("calendar.tue")}</span><span>${t("calendar.wed")}</span> <span>${t("calendar.thu")}</span> <span>${t("calendar.fri")}</span> <span>${t("calendar.sat")}</span> <span>${t("calendar.sun")}</span></div><div class="calendar-body" data-calendar-area="month"></div></div>`;@@ -63,7 +64,7 @@ export default class CalendarWidget extends RightDropdownButtonWidget {this.hideDropdown();}else {- toastService.showError("Cannot find day note");+ toastService.showError(t("calendar.cannot_find_day_note"));}});}@@ -153,23 +154,23 @@ export default class CalendarWidget extends RightDropdownButtonWidget {this.date.setDate(1);this.date.setMonth(this.date.getMonth() - 1);- this.$label.html(`${this.monthsAsString(this.date.getMonth())} ${this.date.getFullYear()}`);+ this.$label.html(`${t(this.monthsAsString(this.date.getMonth()).toLowerCase())} ${this.date.getFullYear()}`);}monthsAsString(monthIndex) {return [- 'January',- 'Febuary',- 'March',- 'April',- 'May',- 'June',- 'July',- 'August',- 'September',- 'October',- 'November',- 'December'+ t("calendar.january"),+ t("calendar.febuary"),+ t("calendar.march"),+ t("calendar.april"),+ t("calendar.may"),+ t("calendar.june"),+ t("calendar.july"),+ t("calendar.august"),+ t("calendar.september"),+ t("calendar.october"),+ t("calendar.november"),+ t("calendar.december")][monthIndex];}}diff --git a/src/public/translations/cn/translation.json b/src/public/translations/cn/translation.jsonindex 3cbf4f3a0e..dc4c58b8dd 100644--- a/src/public/translations/cn/translation.json+++ b/src/public/translations/cn/translation.json@@ -527,5 +527,27 @@"convert_confirm": "您确定要将附件 '{{title}}' 转换为单独的笔记吗?","convert_success": "附件 '{{title}}' 已转换为笔记。","enter_new_name": "请输入附件的新名称"+ },+ "calendar": {+ "mon": "一",+ "tue": "二",+ "wed": "三",+ "thu": "四",+ "fri": "五",+ "sat": "六",+ "sun": "日",+ "cannot_find_day_note": "无法找到日记",+ "january": "一月",+ "febuary": "二月",+ "march": "三月",+ "april": "四月",+ "may": "五月",+ "june": "六月",+ "july": "七月",+ "august": "八月",+ "september": "九月",+ "october": "十月",+ "november": "十一月",+ "december": "十二月"}}diff --git a/src/public/translations/en/translation.json b/src/public/translations/en/translation.jsonindex 1caa1fef14..5e18cad106 100644--- a/src/public/translations/en/translation.json+++ b/src/public/translations/en/translation.json@@ -528,5 +528,27 @@"convert_success": "Attachment '{{title}}' has been converted to note.","rename_attachment": "Rename attachment","enter_new_name": "Please enter new attachment's name"+ },+ "calendar": {+ "mon": "Mon",+ "tue": "Tue",+ "wed": "Wed",+ "thu": "Thu",+ "fri": "Fri",+ "sat": "Sat",+ "sun": "Sun",+ "cannot_find_day_note": "Cannot find day note",+ "january": "January",+ "febuary": "Febuary",+ "march": "March",+ "april": "April",+ "may": "May",+ "june": "June",+ "july": "July",+ "august": "August",+ "september": "September",+ "october": "October",+ "november": "November",+ "december": "December"}}