Skip to content

Commit

Permalink
feat: 1. Merge PR from rishacha (https://github.com/rishacha) 2. Add …
Browse files Browse the repository at this point in the history
…a setting for the calendar local, currently support "zh-cn" and "en-us" [#47]
  • Loading branch information
hujj committed Aug 6, 2024
1 parent a3a02c8 commit fa612bc
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 26 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,9 @@

## v1.3.2
### feat:
1. 在设置界面中增加是否显示农历的选项 [#48]
1. 在设置界面中增加是否显示农历的选项 [#48]

## v1.3.3
### feat:
1. Merge PR from rishacha (https://github.com/rishacha)
2. 在设置界面中增加日历显示语言的选项,目前支持简体中文和英文 [#47]
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# Schedule Manager

## Updates
1. Add the lunar calendar display switch in the settings
2. Add a setting for the calendar local

<b><font color="#dd0000">Note: Upgrading from version "1.0. x" to version "1.1. x" may require reopening the plugin to update the format of the schedule records</font></b>

## Introduction
Expand Down
3 changes: 2 additions & 1 deletion README_zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# 日程管理

## 本次更新
1. 添加节假日显示
1. 在设置中增加是否显示农历的选项
2. 在设置中增加日历显示语言的选项

<b><font color="#4096ff">最近事情比较多,先更新比较简单的功能吧,正在研究实现跨平台日程提醒,目前的思路是通过iCal、CalDav、Google Calendar等连接第三方日历应用(比如可以连接手机自带日历),将日程添加到这些日历应用中,不知道大家有没有更好的想法,可以在链滴上发帖子讨论,或者到github上提issue</font></b>

Expand Down
3 changes: 1 addition & 2 deletions i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,5 @@
"gregorianCalendar": "Gregorian calendar",
"lunarCalendar": "Lunar calendar",
"showLunarCalendar": "Show chinese lunar calendar",
"selectLocale": "Select your locale",
"localeOptions":["en-us","zh-cn"]
"selectLocale": "Select your calendar locale"
}
6 changes: 1 addition & 5 deletions i18n/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,5 @@
"gregorianCalendar": "公历",
"lunarCalendar": "农历",
"showLunarCalendar": "显示农历",
"selectLocale": "Select your locale",
"localeOptions": [
"zh-cn",
"en-us"
]
"selectLocale": "日历语言设置"
}
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "siyuan-plugin-schedule-manager",
"author": "RogerHuHu",
"url": "https://github.com/RogerHuHu/siyuan-plugin-schedule-manager",
"version": "1.3.2",
"version": "1.3.3",
"minAppVersion": "2.10.6",
"backends": ["all"],
"frontends": ["all"],
Expand Down
2 changes: 1 addition & 1 deletion src/ScheduleManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ export class ScheduleManager {
globalData.archiveTime = doc.archiveTime === undefined ? 7 : parseInt(doc.archiveTime, 10);
globalData.selectedFirstDayOfWeek = doc.firstDayOfWeek === undefined ? 0 : doc.firstDayOfWeek;
globalData.showLunarCalendar = doc.showLunarCalendar;
globalData.userLocale = doc.userLocale;
globalData.userLocale = doc.userLocale === undefined ? "zh-cn" : doc.userLocale;
})
}
}
Expand Down
20 changes: 12 additions & 8 deletions src/components/Settings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
<n-gi>
<n-switch v-model:value="isShowLunarCalendar" @update:value="handleUpdateShowLunarCalendar"/>
</n-gi>
<n-gi :span="6">
<n-gi :span="2">
<div class="sm-schedule-item-header" style="margin-top: 3px;">{{ selectLocaleText }}</div>
</n-gi>
<n-gi>
<n-gi :span="5">
<n-select :options="localeOptions" size="tiny" v-model:value="selectedLocale" />
</n-gi>
<n-gi>
Expand Down Expand Up @@ -110,12 +110,16 @@ export default defineComponent({
}
],
localeOptions: i18n.localeOptions.map((locale,idx)=>{
return {
value: idx,
label: locale
localeOptions: [
{
label: "简体中文",
value: "zh-cn"
},
{
label: "English(US)",
value: "en-us"
}
}),
],
isShowLunarCalendar: ref(true)
};
Expand All @@ -130,7 +134,7 @@ export default defineComponent({
mounted() {
this.archiveTime = globalData.archiveTime;
this.isShowLunarCalendar = globalData.showLunarCalendar;
// this.selectedLocale = globalData.userLocale;
this.selectedLocale = globalData.userLocale;
},
methods: {
Expand Down
3 changes: 1 addition & 2 deletions src/i18n/en_US.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,5 @@
"gregorianCalendar": "Gregorian calendar",
"lunarCalendar": "Lunar calendar",
"showLunarCalendar": "Show chinese lunar calendar",
"selectLocale": "Select your locale",
"localeOptions":["en-us","zh-cn"]
"selectLocale": "Select your calendar locale"
}
6 changes: 1 addition & 5 deletions src/i18n/zh_CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,5 @@
"gregorianCalendar": "公历",
"lunarCalendar": "农历",
"showLunarCalendar": "显示农历",
"selectLocale": "Select your locale",
"localeOptions": [
"zh-cn",
"en-us"
]
"selectLocale": "日历语言设置"
}

0 comments on commit fa612bc

Please sign in to comment.