diff --git a/auto-i18n.project.yaml b/auto-i18n.project.yaml
new file mode 100644
index 0000000..7f6607d
--- /dev/null
+++ b/auto-i18n.project.yaml
@@ -0,0 +1,30 @@
+# * `i18n_dir`: The directory for storing translation files
+# * `main_file`: The translation file for the main language
+# * `code_files`: The types of code files to scan
+# * `i18n_pattern`: The pattern to mark text that needs to be translated in the code
+# * `dict`: A dictionary of specific terms for translation; you can place specific translations for your project here
+# * `strategy`: The translation strategy
+# * `"diff"` means only translating new content
+# * `"full"` means translating all content
+# * `i18n_var_prefix`: The prefix used for replacement variables in the code
+# * `export_dir`: The export directory. If set, it will be used as the output directory for the export command.
+# * `i18n_var_mid`: The strategy for generating the middle part of the i18n key. Options are:
+# * `"filename"`: Uses the full filename, e.g. `testts`
+# * `"filename_noext"`: Uses the filename without its extension
+# * `"pathname"`: Uses the relative path of the file, replacing '/' with '_'
+#
+code_files:
+ - src/**/*.ts
+ - src/**/*.svelte
+dict:
+ 思源: SiYuan
+ 日记: daily note
+export_dir: src/types
+i18n_dir: src/i18n
+i18n_pattern: \(\(`(.+?)`\)\)
+i18n_var_mid: filename
+i18n_var_prefix: i18n
+main_file: zh_CN.yaml
+strategy: diff
+global_config:
+ lang: zh_CN
diff --git a/package.json b/package.json
index e6aab23..d708470 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "siyuan-dailynote-today",
- "version": "1.7.1",
+ "version": "1.7.2",
"description": "",
"main": ".src/index.js",
"keywords": [],
diff --git a/plugin.json b/plugin.json
index 3700524..cc76cc8 100644
--- a/plugin.json
+++ b/plugin.json
@@ -6,7 +6,7 @@
"en_US": "Daily Note Today"
},
"url": "https://github.com/frostime/siyuan-dailynote-today",
- "version": "1.7.1",
+ "version": "1.7.2",
"minAppVersion": "3.1.7",
"description": {
"zh_CN": "自动创建日记 + 快速打开日记 + 日程 TODO 管理 + 移动块功能",
diff --git a/src/components/setting-gui.svelte b/src/components/setting-gui.svelte
index f13744d..d4ef84c 100644
--- a/src/components/setting-gui.svelte
+++ b/src/components/setting-gui.svelte
@@ -14,8 +14,8 @@
let groups = {
enable: [
{
- name: "OpenOnStart",
- type: "checkbox",
+ name: "OpenOnStart",
+ type: "checkbox",
},
{
name: "EnableMove",
@@ -28,7 +28,7 @@
{
name: "EnableResvDock",
type: "checkbox",
- }
+ },
],
interact: [
{
@@ -41,8 +41,8 @@
},
{
name: "ReplaceAlt5Hotkey",
- type: "checkbox"
- }
+ type: "checkbox",
+ },
],
dailynote: [
{
@@ -51,24 +51,24 @@
},
{
name: "NotebookBlacklist",
- type: "button"
+ type: "button",
},
{
name: "DisableAutoCreateOnMobile",
- type: "checkbox"
+ type: "checkbox",
},
{
name: "SetPastDailyNoteAttr",
- type: "button"
- },
- {
- name: "AutoOpenAfterSync",
- type: "checkbox"
+ type: "button",
},
+ // {
+ // name: "AutoOpenAfterSync",
+ // type: "checkbox",
+ // },
{
name: "AutoHandleDuplicateMethod",
- type: "select"
- }
+ type: "select",
+ },
],
reservation: [
{
@@ -85,9 +85,9 @@
},
{
name: "HighlightResv",
- type: "checkbox"
- }
- ]
+ type: "checkbox",
+ },
+ ],
};
let allSettingPanels: {
@@ -123,7 +123,7 @@
function onClick({ detail }) {
console.log(detail);
let key = detail.key;
- if (key === 'NotebookBlacklist') {
+ if (key === "NotebookBlacklist") {
let dialog = new Dialog({
title: i18n.Blacklist.name,
content: `
`,
@@ -138,7 +138,7 @@
},
},
});
- } else if (key === 'SetPastDailyNoteAttr') {
+ } else if (key === "SetPastDailyNoteAttr") {
setDNAttrDialog();
}
}
@@ -146,4 +146,4 @@
-
+
diff --git a/src/func/index.ts b/src/func/index.ts
index 0eb3cf2..8f4f217 100644
--- a/src/func/index.ts
+++ b/src/func/index.ts
@@ -34,7 +34,7 @@ export class RoutineEventHandler {
hasOpened: false,
openOnStart: false,
- autoOpenAfterSync: false,
+ // autoOpenAfterSync: false,
isSyncChecked: false,
hasCheckSyncFor: 0,
@@ -47,7 +47,7 @@ export class RoutineEventHandler {
this.eventBus = plugin.eventBus;
this.flag.openOnStart = settings.get('OpenOnStart');
- this.flag.autoOpenAfterSync = settings.get('AutoOpenAfterSync');
+ // this.flag.autoOpenAfterSync = settings.get('AutoOpenAfterSync');
this.checkDuplicateDiary_Debounce = debouncer.debounce(
this.checkDuplicateDiary.bind(this), 2000, 'CheckDuplicateDiary'
@@ -71,13 +71,10 @@ export class RoutineEventHandler {
if (!SYNC_ENABLED) {
//Case 1: 如果思源没有开启同步, 就直接创建, 并无需绑定同步事件
await this.tryAutoOpenDN();
- } else if (this.flag.autoOpenAfterSync === false) {
- //Case 2: 如果思源开启了同步, 但是用户没有设置在同步后打开, 就直接创建
- this.bindSyncEvent();
- await this.tryAutoOpenDN();
} else {
- //Case 3: 如果思源开启了同步, 并且用户设置了在同步后打开, 就绑定同步事件
+ //Case 2: 如果思源开启了同步, 就直接创建并绑定同步事件
this.bindSyncEvent();
+ await this.tryAutoOpenDN();
}
}
public onPluginUnload() {
@@ -85,12 +82,10 @@ export class RoutineEventHandler {
this.plugin.eventBus.off('closed-notebook', this.onNotebookChangedBindThis);
}
- async onSyncEnd({ detail }) {
- console.debug('on-sync-end');
-
- if (this.flag.hasOpened === false && this.flag.autoOpenAfterSync === true) {
- this.tryAutoOpenDN();
- }
+ async onSyncEnd() {
+ // if (this.flag.hasOpened === false && this.flag.autoOpenAfterSync === true) {
+ // this.tryAutoOpenDN();
+ // }
if (!this.flag.isSyncChecked) {
this.checkDuplicateDiary_Debounce();
diff --git a/src/global-notebooks.ts b/src/global-notebooks.ts
index 7b785cb..2139bd6 100644
--- a/src/global-notebooks.ts
+++ b/src/global-notebooks.ts
@@ -3,12 +3,14 @@
* @Author : Yp Z
* @Date : 2023-06-03 23:36:46
* @FilePath : /src/global-notebooks.ts
- * @LastEditTime : 2023-08-06 18:07:20
+ * @LastEditTime : 2024-11-28 23:05:56
* @Description :
*/
+import { confirm } from 'siyuan';
import { queryNotebooks } from './func';
import { settings } from './global-status';
-
+import { getBlockByID } from './serverApi';
+import { i18n } from './utils';
class Notebooks {
notebooks: Array;
@@ -76,12 +78,34 @@ class Notebooks {
} else {
// confirm(i18n.Name, `${notebookId} ${i18n.InvalidDefaultNotebook}`);
this.default = undefined;
+ this.checkCorrectNotebookId(notebookId).then(notebook => {
+ if (notebook) {
+ this.default = notebook;
+ settings.set('DefaultNotebook', notebook.id);
+ } else {
+ confirm(i18n.Name, `${notebookId} ${i18n.InvalidDefaultNotebook}`);
+ }
+ });
}
} else {
this.default = this.get(0);
}
}
+ private async checkCorrectNotebookId(notebookId: string) {
+ const block: Block = await getBlockByID(notebookId);
+ if (!block) {
+ return null;
+ }
+
+ let notebook = this.find(block.box);
+ if (notebook) {
+ confirm(`${i18n.Name} Warning`, i18n.global_notebooks_ts.invalid_notebook_id_config.replace('{0}', block.content).replace('{1}', notebookId).replace('{2}', block.box));
+ return notebook;
+ }
+ return null;
+ }
+
}
const notebooks = new Notebooks();
diff --git a/src/global-status.ts b/src/global-status.ts
index fdfa071..3edbb35 100644
--- a/src/global-status.ts
+++ b/src/global-status.ts
@@ -3,7 +3,7 @@
* @Author : frostime
* @Date : 2024-05-21 14:14:08
* @FilePath : /src/global-status.ts
- * @LastEditTime : 2024-09-26 16:21:06
+ * @LastEditTime : 2025-01-21 15:01:51
* @Description :
*/
import { eventBus } from './event-bus';
@@ -26,7 +26,7 @@ class SettingManager {
settings: any = {
OpenOnStart: true as boolean, //启动的时候自动打开日记
- AutoOpenAfterSync: false as boolean, //在第一次同步之后再自动打开日记
+ // AutoOpenAfterSync: false as boolean, //在第一次同步之后再自动打开日记
DefaultNotebook: '', //默认笔记本的 ID
DisableAutoCreateOnMobile: false as boolean, //移动端自动创建日记
IconPosition: 'left' as IconPosition, //图标放置位置
diff --git a/src/i18n/en_US.yaml b/src/i18n/en_US.yaml
index 6136390..dfe73ba 100644
--- a/src/i18n/en_US.yaml
+++ b/src/i18n/en_US.yaml
@@ -1,237 +1,231 @@
----
+Blacklist:
+ name: Blacklist
+ toggle: Add to blacklist
+ update: Update blacklist
+ChangeLog:
+ file: CHANGELOG_en_US
+ name: ChangeLog
+CompleteMsg:
+ AllMerge: All duplicate diaries have been merged into the main diary
+ DeleteDup: All duplicate diaries have been deleted
+ SmartMerge: Duplicate diaries have been smartly merged into the main diary
+ TrashDup: Duplicate diaries have been moved to the trash bin
+ConflictDiary:
+ AutoMerge: Auto merge
+ CompleteMsg:
+ AllMerge: Merge all duplicate diaries into the main diary
+ DeleteDup: Deleted all duplicate diaries
+ SmartMerge: Intelligently merge duplicate diaries into the main diary
+ TrashDup: Moved the duplicate diaries to the recycle bin
+ HeadingMarkdown: '# Duplicate diaries are listed below'
+ fail: Fail due to unknown reason, please merge them manually
+ part1:
+ - '#### Note: Duplicate daily notes detected'
+ - Conflict files are listed below, the last line, indicated in bold, represents
+ the earliest dailynote and will be treated as the main dailynote for auto-handeling
+ - '| Document ID | Title | Created | Updated | Notebook |'
+ - '| --- | --- | --- | --- | --- |'
+ part2:
+ - '- **Why does this happen?**'
+ - ' You may have created a daily note on another device before and then created
+ a daily note on this device, resulting in a synchronization conflict.'
+ - '- **How to solve it manually?**'
+ - ' Please merge and delete redundant diaries manually: Open today''s daily note,
+ locate the daily note document, and the conflicting document will be nearby.'
+ - '- **What do the following buttons mean?**'
+ - ' Auto-handeling method, please refer to the plugin documentation for details.'
+ part3:
+ - ''
+ - We found that in addition to the dailynote document conflict, the parent document
+ at the upper level seems to be in conflict as well, the "Auto Handler" cannot
+ handle this complexity of merging document trees.
+ -
+ - ''
+ - You can still to use the "Auto Handler" feature, while it is recommended
+ that you manually deal with duplicate parent documents after auto-handling.
+ -
+ success: Success
+ContextMenu:
+ PruneResv: Prune bad reservation
+Create: Create daily note
+DeReserveMenu:
+ Success: Cancel reservation success!
+ name: Cancel Reservation
+DockReserve:
+ PopupResv: Inspect reservations
+ arial: Daily Note Today Reservations
+ collapse: collapse
+ emptyContent: No related content found
+ expand: expand
+ min: minimize
+ refresh: refresh
+ title: Reservations
+InvalidDefaultNotebook: |-
+ Sory, but the plugin was unable to find the default notebook; it may be due to an incorrect ID configuration, or the corresponding notebook has been closed by you.
+ We suggest that you carefully check the settings of the plugin.
+MoveMenu:
+ Move: Move to
+ NotLi: Only support moving entrie list, instead of signle list item!
+ NotMoveDiary: Don't move daily note itself!
+ VerIssue: Current version dose not support "Move Blocks" function (≥ 2.8.8))
+Msg:
+ PruneResv: Pruned
+ Resv404: Ooops!??
It should have been reservation blocks here, but the
+ blocks are not found
Maybe they were deleted or the notebook is closed
Name: Daily Note Today
-NewVer: " new version"
+NewDay:
+- 'Today is '
+- plugin up to date
+NewVer: ' new version'
+Open: Open daily note
+ReserveMenu:
+ Date404: No date time found for reserving!
+ DateInvalid: is not a valid date!
+ DatePast: Can not reserve for past time!
+ Match: Matched date
+ Success: Reservation success!
+ Title: Reserve this block to
+ name: Reserve this block
+SetPastDN:
+ button:
+ end: 🎉 Exit!
+ start: 🚀 Start setting!
+ hint:
+ end: ✅ All settings complete!
+ going: 🕑 Setting in progress...
+ initial: 📚 The plugin has automatically detected the earliest date of the diaries
+ in all notebooks.
🚀 You can now click the 'Start' button to add custom
+ attributes to all diaries within this time range.
⚙️ If you think the automatically
+ detected start date is incorrect, you can manually set it by clicking on the
+ cell in the 'Start Date' column.
+ setdate:
+ error: Incorrect date format
+ title: Manually set the start date
+ thead:
+ - Notebook
+ - 'Start Date(click to set manually)'
+ - Number of DNs
+ - Enable
+ title: Add document attribute to past daily notes
Setting:
- name: Setting
- OpenOnStart:
- title: Auto-open Daily Note
- text: Open Today's daily note automatically when the plugin is loaded
+ AutoHandleDuplicateMethod:
+ options:
+ AllMerge: Merge all
+ DeleteDup: Delete directly
+ None: Manually handle
+ SmartMerge: Merge smartly
+ TrashDup: Move to trash
+ text: |-
+ Automatically handel with duplicate daily notes while detected, without popup dialog
+ Default: Popup dialog and let user manually choose the method.
+ If not 'Manually handle', auto-handle with the duplicate daily notes with the selected method.
+ title: Auto-handle duplicates' method
AutoOpenAfterSync:
- title:
- "Auto create DN only after synchronization \U0001F9EAExperimental Features"
- text:
- To solve the document conflict problem caused by synchronization + automatic
+ text: To solve the document conflict problem caused by synchronization + automatic
opening of DN, try opening DN automatically after synchronization.
This
feature is experimental and lacks sufficient testing, so please
use it at your discretion.
Practical tests shown it not very useful,
not recommended
+ title: 'Auto create DN only after synchronization 🧪Experimental Features'
DefaultNotebook:
- title: Default Notebook ID
- text:
- The notebook where the daily note is created by default, use the first notebook
- if blank
placeholder: Please copy from notebook's ID
+ text: The notebook where the daily note is created by default, use the first notebook
+ if blank
+ title: Default Notebook ID
DisableAutoCreateOnMobile:
- title: Disable Auto Create Diary On Mobile
- text:
- This feature is mainly to avoid the problem of inconvenient handling when
+ text: This feature is mainly to avoid the problem of inconvenient handling when
generating conflict diaries in mobile; if this option is turned on, "Open Today's
Diary Automatically" will not work on mobile.
- NotebookBlacklist:
- title: Notebook Blacklist
- text:
- Notebook in the blacklist will not be shown in the dropdown menu. Default
- notebook can not be in the blacklist
- button: Set it
- update:
- title: Update Status
- text: Update the status of the notebook when the notebook configuration changes
- button: Update
- NotebookSort:
- title: Notebook Sorting Scheme
- text:
- 1. Same what document tree shows 2. Same the order defined in custom sorting
- mode
- options:
- doc-tree: Same as document tree
- custom-sort: Same as custom sorting
- IconPosition:
- title: Icon Position
- text: Take effect after reloading
- options:
- left: Topbar left
- right: Topbar right
+ title: Disable Auto Create Diary On Mobile
EnableMove:
- title: Enable "Move Block" in menu
- text:
- When enabled, the "Move Block" item will be added to the menu after clicking
+ text: When enabled, the "Move Block" item will be added to the menu after clicking
on the block icon
+ title: Enable "Move Block" in menu
EnableReserve:
- title: Enable "Reserve Block" in menu
- text:
- When enabled, the "Reserve Block" item will be added to the menu after clicking
+ text: When enabled, the "Reserve Block" item will be added to the menu after clicking
on the block icon
+ title: Enable "Reserve Block" in menu
EnableResvDock:
- title: Enable "Show reservations" in dock menu
- text:
- When enabled, the "Show reservations" pannel will be added to the dock menu
+ text: When enabled, the "Show reservations" pannel will be added to the dock menu
at the right bottom side of the dock bar
+ title: Enable "Show reservations" in dock menu
ExpandGutterMenu:
- title: Expand all block menu items
- text:
- When enabled, the plugin's block menu items are expanded to appear as a
+ text: When enabled, the plugin's block menu items are expanded to appear as a
separate secondary menu under the plugin menu
+ title: Expand all block menu items
+ HighlightResv:
+ text: Highlight reservation icon in dock bar when there is a reservation on the
+ day
+ title: Highlight reservation icon
+ IconPosition:
+ options:
+ left: Topbar left
+ right: Topbar right
+ text: Take effect after reloading
+ title: Icon Position
+ NotebookBlacklist:
+ button: Set it
+ text: Notebook in the blacklist will not be shown in the dropdown menu. Default
+ notebook can not be in the blacklist
+ title: Notebook Blacklist
+ NotebookSort:
+ options:
+ custom-sort: Same as custom sorting
+ doc-tree: Same as document tree
+ text: 1. Same what document tree shows 2. Same the order defined in custom sorting
+ mode
+ title: Notebook Sorting Scheme
+ OpenOnStart:
+ text: Open Today's daily note automatically when the plugin is loaded
+ title: Auto-open Daily Note
PopupReserveDialog:
- title: Popup Confirmation Window When Reserving a Block
- text:
- Automatically displays a confirmation window when reserving a block to ensure
+ text: Automatically displays a confirmation window when reserving a block to ensure
the date is correct.
+ title: Popup Confirmation Window When Reserving a Block
+ ReplaceAlt5Hotkey:
+ text: The plugin will override the default Alt+5 hotKey behavior in SiYuan, fixing
+ it to open only the daily note of the default notebook set by the plugin.
+ title: Override Alt+5 hotKey
ResvEmbedAt:
- title: Insert reservations at
- text: Insert reservations at top or bottom of today's daily note
options:
- top: Top of the document
bottom: Bottom of the document
+ top: Top of the document
+ text: Insert reservations at top or bottom of today's daily note
+ title: Insert reservations at
RetvType:
- title: Insert reservations as
- text: Target block's type for reservations, could be embed block, link, or reference
options:
embed: Embed
link: Link
ref: Ref
+ text: Target block's type for reservations, could be embed block, link, or reference
+ title: Insert reservations as
SetPastDailyNoteAttr:
- title: Add document attribute to past daily notes
- text:
- '✨ Adding the custom-dailynote attribute to past daily notes for compatibility
+ button: GO!
+ empty: 'Can not find daily notes under notebook: {{notebook}}'
+ text: '✨ Adding the custom-dailynote attribute to past daily notes for compatibility
with SiYuan versions prior to 2.11.1.
If
you don''t understand what this button is for, it is recommended that you press
it, and it won''t bring you any extra trouble!
Note: Clicking this button
once is enough.'
- button: GO!
- empty: 'Can not find daily notes under notebook: {{notebook}}'
- HighlightResv:
- title: Highlight reservation icon
- text:
- Highlight reservation icon in dock bar when there is a reservation on the
- day
- AutoHandleDuplicateMethod:
- title: Auto-handle duplicates' method
- text: |-
- Automatically handel with duplicate daily notes while detected, without popup dialog
- Default: Popup dialog and let user manually choose the method.
- If not 'Manually handle', auto-handle with the duplicate daily notes with the selected method.
- options:
- None: Manually handle
- AllMerge: Merge all
- TrashDup: Move to trash
- SmartMerge: Merge smartly
- DeleteDup: Delete directly
- ReplaceAlt5Hotkey:
- title: Override Alt+5 hotKey
- text: The plugin will override the default Alt+5 hotKey behavior in SiYuan, fixing it to open only the daily note of the default notebook set by the plugin.
-
+ title: Add document attribute to past daily notes
+ name: Setting
+ update:
+ button: Update
+ text: Update the status of the notebook when the notebook configuration changes
+ title: Update Status
SettingGroups:
+ dailynote: Daily Note
enable: Enable
interact: Interact
- dailynote: Daily Note
reservation: Reservation
TrashBinDocContent: |-
- This is a trash bin document created by the "Daily Note Today" plugin.
- The reason you see this document is that you used the "Move to Trash" feature in the plugin to automatically handle duplicate daily note documents.
- All documents under this document are daily notes that were previously detected as duplicate documents by the "Daily Note Today" plugin.
- If you find this trash bin document bothersome, you can delete it entirely. The plugin will recreate the trash bin document when needed.
-Open: Open daily note
-Create: Create daily note
UpdateAll: Notebook status updated
-InvalidDefaultNotebook: |-
- Sory, but the plugin was unable to find the default notebook; it may be due to an incorrect ID configuration, or the corresponding notebook has been closed by you.
- We suggest that you carefully check the settings of the plugin.
-
-ContextMenu:
- PruneResv: Prune bad reservation
-MoveMenu:
- Move: Move to
- NotLi: Only support moving entrie list, instead of signle list item!
- VerIssue: Current version dose not support "Move Blocks" function (≥ 2.8.8))
- NotMoveDiary: Don't move daily note itself!
-ReserveMenu:
- name: Reserve this block
- Match: Matched date
- Title: Reserve this block to
- Date404: No date time found for reserving!
- DateInvalid: is not a valid date!
- DatePast: Can not reserve for past time!
- Success: Reservation success!
-DeReserveMenu:
- name: Cancel Reservation
- Success: Cancel reservation success!
-NewDay:
- - "Today is "
- - plugin up to date
-ChangeLog:
- name: ChangeLog
- file: CHANGELOG_en_US
-Msg:
- PruneResv: Pruned
- Resv404:
- "Ooops!??
It should have been reservation blocks here, but the
- blocks are not found
Maybe they were deleted or the notebook is closed
"
-ConflictDiary:
- part1:
- - "#### Note: Duplicate daily notes detected"
- - Conflict files are listed below, the last line, indicated in bold, represents
- the earliest dailynote and will be treated as the main dailynote for auto-handeling
- - "| Document ID | Title | Created | Updated | Notebook |"
- - "| --- | --- | --- | --- | --- |"
- part2:
- - "- **Why does this happen?**"
- - " You may have created a daily note on another device before and then created
- a daily note on this device, resulting in a synchronization conflict."
- - "- **How to solve it manually?**"
- - " Please merge and delete redundant diaries manually: Open today's daily note,
- locate the daily note document, and the conflicting document will be nearby."
- - "- **What do the following buttons mean?**"
- - " Auto-handeling method, please refer to the plugin documentation for details."
- part3:
- - ''
- - We found that in addition to the dailynote document conflict, the parent document
- at the upper level seems to be in conflict as well, the "Auto Handler" cannot
- handle this complexity of merging document trees.
- - "
"
- - ''
- - You can still to use the "Auto Handler" feature, while it is recommended
- that you manually deal with duplicate parent documents after auto-handling.
- - "
"
- AutoMerge: Auto merge
- HeadingMarkdown: "# Duplicate diaries are listed below"
- success: Success
- fail: Fail due to unknown reason, please merge them manually
-CompleteMsg:
- AllMerge: All duplicate diaries have been merged into the main diary
- TrashDup: Duplicate diaries have been moved to the trash bin
- SmartMerge: Duplicate diaries have been smartly merged into the main diary
- DeleteDup: All duplicate diaries have been deleted
-DockReserve:
- arial: Daily Note Today Reservations
- title: Reservations
- refresh: refresh
- expand: expand
- collapse: collapse
- min: minimize
- emptyContent: No related content found
- PopupResv: Inspect reservations
-Blacklist:
- name: Blacklist
- toggle: Add to blacklist
- update: Update blacklist
-SetPastDN:
- title: Add document attribute to past daily notes
- thead:
- - Notebook
- - 'Start Date(click to set manually)'
- - Number of DNs
- - Enable
- hint:
- initial: >-
- 📚 The plugin has automatically detected the earliest date of the diaries in all notebooks.
- 🚀 You can now click the 'Start' button to add custom attributes to all diaries within this time range.
- ⚙️ If you think the automatically detected start date is incorrect, you can manually set it by clicking on the cell in the 'Start Date' column.
- going: 🕑 Setting in progress...
- end: ✅ All settings complete!
- button:
- start: 🚀 Start setting!
- end: 🎉 Exit!
- setdate:
- title: Manually set the start date
- error: Incorrect date format
+global_notebooks_ts:
+ invalid_notebook_id_config: You wrongly configured the notebook ID as the ID {1}
+ of block "{0}""; the plugin has automatically adjusted the default notebook
+ to the notebook where the block is located {2}
diff --git a/src/i18n/zh_CN.yaml b/src/i18n/zh_CN.yaml
index 9527a4d..661b654 100644
--- a/src/i18n/zh_CN.yaml
+++ b/src/i18n/zh_CN.yaml
@@ -1,198 +1,195 @@
----
+Blacklist:
+ name: 黑名单
+ toggle: 加入黑名单
+ update: 更新黑名单
+ChangeLog:
+ file: CHANGELOG_zh_CN
+ name: 更新日志
+ConflictDiary:
+ AutoMerge: 自动合并
+ CompleteMsg:
+ AllMerge: 将重复日记全部合并到主日记中
+ DeleteDup: 删除了所有重复的日记
+ SmartMerge: 将重复日记智能合并到主日记中
+ TrashDup: 将重复的日记移动到回收站
+ HeadingMarkdown: '# 以下为其他重复的日记'
+ fail: 由于未知原因, 自动处理失败, 请手动处理
+ part1:
+ - '#### 注意: 检测到重复的日记'
+ - '冲突文件如下, 其中最后一行加粗的项目为最早的日记, 将被视为主日记来处理:'
+ - '| 文档 ID | 标题 | 创建时间 | 更新时间 | 笔记本 |'
+ - '| --- | --- | --- | --- | --- |'
+ part2:
+ - '- **为什么会出现这种情况?**'
+ - ' 你可能之前已经在别的设备上创建了日记, 然后在这个设备尚又创建了日记,从而导致同步冲突'
+ - '- **应该如何处理?**'
+ - ' 请自行合并删除多余的日记: 打开今日的日记, 然后定位日记文档, 冲突的文档就在一旁'
+ - '- **以下几个按钮是什么意思?**'
+ - ' 几个不同的自动处理方法, 详情请查看插件文档'
+ part3:
+ - ''
+ - 我们发现除了日记文档冲突外,上层的父文档似乎也出现了冲突,「自动处理」功能无法处理这种涉及合并文档树的复杂情况
+ -
+ - ''
+ - 你还是可以继续使用「自动处理」功能,但是建议你在自动合并后手动处理一下重复的父文档
+ -
+ success: 自动处理成功
+ContextMenu:
+ PruneResv: 清理无效预约
+Create: 创建日记
+DeReserveMenu:
+ Success: 成功取消预约!
+ name: 取消预约
+DockReserve:
+ PopupResv: 查看当日预约
+ arial: 今日笔记预约
+ collapse: 折叠
+ emptyContent: 未找到相关内容
+ expand: 展开
+ min: 最小化
+ refresh: 刷新
+ title: 预约
+InvalidDefaultNotebook: |-
+ 很抱歉, 插件没有找默认的笔记本; 可能是 ID 配置不正确, 或对应的笔记本被你关闭了。
+ 建议你仔细检查插件的设置。
+MoveMenu:
+ Move: 移动到
+ NotLi: 不可以移动单独的列表项,请移动整个列表!
+ NotMoveDiary: 请不要移动日记本身!
+ VerIssue: 当前版本不支持移动块功能(≥ 2.8.8)
+Msg:
+ PruneResv: 清理完成
+ Resv404: 咦!??
本来今天是有预约的, 但是我们发现预约块都不见了
可能是被删除了或者对应的笔记本已经关闭
你可以在顶栏图标中选择清理无用的预约
Name: 今日笔记
+NewDay:
+- 今天是
+- 笔记状态已更新
NewVer: 新版本
+Open: 打开日记
+ReserveMenu:
+ Date404: 没有找到可用于预约的日期!
+ DateInvalid: 不是一个合法的日期!
+ DatePast: 预约日期只能是未来!
+ Match: 匹配到日期
+ Success: 预约成功!
+ Title: 确认将目标块预约到
+ name: 预约此块
+SetPastDN:
+ button:
+ end: 🎉 退出!
+ start: 🚀 开始设置!
+ hint:
+ end: ✅ 全部设置完成!
+ going: 🕑 设置中...
+ initial: 📚 插件已经自动探寻到所有笔记本中最早的日记的日期。
🚀 你现在可以点击「开始」按钮来为所有在这个时间范围内的日记添加自定义属性。
+ ⚙️ 如果你认为自动探查到的开始日期不正确,你可以点击「开始日期」列中的单元手动进行设置。
+ setdate:
+ error: 日期格式错误
+ title: 手动设置开始日期
+ thead:
+ - 笔记本
+ - '开始日期(点击可手动设置)'
+ - 日记数量
+ - 启用
+ title: 为过去的 Daily Note 补充文档属性
Setting:
- name: 设置
- OpenOnStart:
- title: 自动打开 Daily Note
- text: 插件启动后自动打开当日的 Daily Note
+ AutoHandleDuplicateMethod:
+ options:
+ AllMerge: 全部合并
+ DeleteDup: 直接删除
+ None: 手动处理
+ SmartMerge: 智能合并
+ TrashDup: 移动到回收站
+ text: |-
+ 当检测到重复的日记时,不弹出合并对话框,而是直接指定某个默认处理方案自动处理
+ 默认选项为:不进行任何处理,即弹出对话框由用户手动处理
+ 当前选择除了「手动处理」之外的选项时,在检测到重复日记的时候将采用指定的处理方案自动处理
+ title: 自动处理重复日记方案
AutoOpenAfterSync:
- title: "同步后再创建日记 \U0001F9EA实验性功能"
- text:
- 为了解决同步+自动打开日记造成的文件冲突问题,尝试在同步之后在自动打开日记。
本功能为实验性功能,缺少足够的测试,请斟酌使用
+ text: 为了解决同步+自动打开日记造成的文件冲突问题,尝试在同步之后在自动打开日记。
本功能为实验性功能,缺少足够的测试,请斟酌使用
实际测试作用不大,不推荐。
+ title: '同步后再创建日记 🧪实验性功能'
DefaultNotebook:
- title: 设置默认笔记本 ID
- text: 设置默认的笔记本 ID, 留空时表示选择排位第一的笔记本
placeholder: 请复制笔记本 ID
+ text: 设置默认的笔记本 ID, 留空时表示选择排位第一的笔记本
+ title: 设置默认笔记本 ID
DisableAutoCreateOnMobile:
- title: 移动端强制关闭「自动打开日记」功能
text: 本功能主要为了避免在移动端遇到生成冲突日记的时候不方便处理的问题; 如果将本选项关闭,则「自动打开 Daily Note」在移动端将不会生效
- NotebookBlacklist:
- title: 笔记本黑名单
- text: 加入黑名单后, 该笔记本将不会再下拉框当中显示, 默认笔记本不能加入黑名单
- button: 设置
- update:
- title: 更新状态
- text: 在笔记本配置发生变化的时候更新其状态
- button: 更新
- NotebookSort:
- title: 笔记本排序方案
- text: 1. 和当前文档树的显示保持一致 2. 和在自定义排序中的设置保持一致
- options:
- doc-tree: 和文档树一致
- custom-sort: 和自定义排序一致
- IconPosition:
- title: 图标位置
- text: 下次重启后生效
- options:
- left: 顶栏左侧
- right: 顶栏右侧
+ title: 移动端强制关闭「自动打开日记」功能
EnableMove:
- title: 启用「移动块」菜单
text: 启用后, 点击块 icon 后的菜单里会加入相应菜单
+ title: 启用「移动块」菜单
EnableReserve:
- title: 启用「预约块」菜单
text: 启用后, 点击块 icon 后的菜单里会加入相应菜单
+ title: 启用「预约块」菜单
EnableResvDock:
- title: 启用「查看预约」侧边栏
text: 启用后, 右边栏下方添加图标, 点开后可以查看未来的预约
+ title: 启用「查看预约」侧边栏
ExpandGutterMenu:
- title: 将所有块菜单项目展开
text: 启用后, 插件的块菜单项目都会展开到插件菜单下作为独立的二级菜单显示
+ title: 将所有块菜单项目展开
+ HighlightResv:
+ text: 如果当日存在预约,则高亮预约列表的侧边栏图标
+ title: 高亮当日预约
+ IconPosition:
+ options:
+ left: 顶栏左侧
+ right: 顶栏右侧
+ text: 下次重启后生效
+ title: 图标位置
+ NotebookBlacklist:
+ button: 设置
+ text: 加入黑名单后, 该笔记本将不会再下拉框当中显示, 默认笔记本不能加入黑名单
+ title: 笔记本黑名单
+ NotebookSort:
+ options:
+ custom-sort: 和自定义排序一致
+ doc-tree: 和文档树一致
+ text: 1. 和当前文档树的显示保持一致 2. 和在自定义排序中的设置保持一致
+ title: 笔记本排序方案
+ OpenOnStart:
+ text: 插件启动后自动打开当日的 Daily Note
+ title: 自动打开 Daily Note
PopupReserveDialog:
- title: 预约块时弹出确认窗口
text: 预约块的时候自动弹出确认窗口, 确保日期无误
+ title: 预约块时弹出确认窗口
+ ReplaceAlt5Hotkey:
+ text: 插件将覆盖思源默认的 Alt+5 快捷键行为,固定只打开插件设置的默认笔记本的日记
+ title: 覆盖 Alt+5 快捷键
ResvEmbedAt:
- title: 将预约插入到
- text: 将今日的预约块插入到文档的开头还是结尾
options:
- top: 文档开头
bottom: 文档结尾
+ top: 文档开头
+ text: 将今日的预约块插入到文档的开头还是结尾
+ title: 将预约插入到
RetvType:
- title: 将预约插入为
- text: 预约插入的类型, 可以为嵌入块, 链接或引用
options:
embed: 嵌入块
link: 链接块
ref: 引用块
+ text: 预约插入的类型, 可以为嵌入块, 链接或引用
+ title: 将预约插入为
SetPastDailyNoteAttr:
- title: 为过去的 Daily Note 补充文档属性
- text:
- '✨ 为过去的日记添加 custom-dailynote 属性,以兼容
- 2.11.1 版本前的思源。
你不必理解具体的细节, 点一下这个按钮, 不会给你带来任何额外的麻烦。
注: 这个按钮点一次就够了'
button: 开始
empty: 未找到笔记本 「{{notebook}}」 下的日记
- HighlightResv:
- title: 高亮当日预约
- text: 如果当日存在预约,则高亮预约列表的侧边栏图标
- AutoHandleDuplicateMethod:
- title: 自动处理重复日记方案
- text: |-
- 当检测到重复的日记时,不弹出合并对话框,而是直接指定某个默认处理方案自动处理
- 默认选项为:不进行任何处理,即弹出对话框由用户手动处理
- 当前选择除了「手动处理」之外的选项时,在检测到重复日记的时候将采用指定的处理方案自动处理
- options:
- None: 手动处理
- AllMerge: 全部合并
- TrashDup: 移动到回收站
- SmartMerge: 智能合并
- DeleteDup: 直接删除
- ReplaceAlt5Hotkey:
- title: 覆盖 Alt+5 快捷键
- text: 插件将覆盖思源默认的 Alt+5 快捷键行为,固定只打开插件设置的默认笔记本的日记
+ text: '✨ 为过去的日记添加 custom-dailynote 属性,以兼容
+ 2.11.1 版本前的思源。
你不必理解具体的细节, 点一下这个按钮, 不会给你带来任何额外的麻烦。
注: 这个按钮点一次就够了'
+ title: 为过去的 Daily Note 补充文档属性
+ name: 设置
+ update:
+ button: 更新
+ text: 在笔记本配置发生变化的时候更新其状态
+ title: 更新状态
SettingGroups:
+ dailynote: 日记
enable: 启用
interact: 交互
- dailynote: 日记
reservation: 预约
TrashBinDocContent: |-
- 这是一个回收站文档,由「今日笔记」插件创建
- 您会看到这个文档的原因是,你在插件中使用「移动到回收站」方案来自动处理重复日记文档
- 这个文档下属的所有文档,都是之前被「今日笔记」插件检测为重复文档的日记
- 如果你觉得这个回收站文档很碍眼,也完全可以将其删除,插件在需要的时候会重新创建回收站文档
-Open: 打开日记
-Create: 创建日记
UpdateAll: 笔记本状态已更新
-InvalidDefaultNotebook: |-
- 很抱歉, 插件没有找默认的笔记本; 可能是 ID 配置不正确, 或对应的笔记本被你关闭了。
- 建议你仔细检查插件的设置。
-ContextMenu:
- PruneResv: 清理无效预约
-MoveMenu:
- Move: 移动到
- NotLi: 不可以移动单独的列表项,请移动整个列表!
- VerIssue: 当前版本不支持移动块功能(≥ 2.8.8)
- NotMoveDiary: 请不要移动日记本身!
-ReserveMenu:
- name: 预约此块
- Match: 匹配到日期
- Title: 确认将目标块预约到
- Date404: 没有找到可用于预约的日期!
- DateInvalid: 不是一个合法的日期!
- DatePast: 预约日期只能是未来!
- Success: 预约成功!
-DeReserveMenu:
- name: 取消预约
- Success: 成功取消预约!
-NewDay:
- - 今天是
- - 笔记状态已更新
-ChangeLog:
- name: 更新日志
- file: CHANGELOG_zh_CN
-Msg:
- PruneResv: 清理完成
- Resv404: "咦!??
本来今天是有预约的, 但是我们发现预约块都不见了
可能是被删除了或者对应的笔记本已经关闭
你可以在顶栏图标中选择清理无用的预约
"
-ConflictDiary:
- part1:
- - "#### 注意: 检测到重复的日记"
- - "冲突文件如下, 其中最后一行加粗的项目为最早的日记, 将被视为主日记来处理:"
- - "| 文档 ID | 标题 | 创建时间 | 更新时间 | 笔记本 |"
- - "| --- | --- | --- | --- | --- |"
- part2:
- - "- **为什么会出现这种情况?**"
- - " 你可能之前已经在别的设备上创建了日记, 然后在这个设备尚又创建了日记,从而导致同步冲突"
- - "- **应该如何处理?**"
- - " 请自行合并删除多余的日记: 打开今日的日记, 然后定位日记文档, 冲突的文档就在一旁"
- - "- **以下几个按钮是什么意思?**"
- - " 几个不同的自动处理方法, 详情请查看插件文档"
- part3:
- - ''
- - 我们发现除了日记文档冲突外,上层的父文档似乎也出现了冲突,「自动处理」功能无法处理这种涉及合并文档树的复杂情况
- - "
"
- - ''
- - "你还是可以继续使用「自动处理」功能,但是建议你在自动合并后手动处理一下重复的父文档"
- - "
"
- AutoMerge: 自动合并
- HeadingMarkdown: "# 以下为其他重复的日记"
- success: 自动处理成功
- fail: 由于未知原因, 自动处理失败, 请手动处理
- CompleteMsg:
- AllMerge: 将重复日记全部合并到主日记中
- TrashDup: 将重复的日记移动到回收站
- SmartMerge: 将重复日记智能合并到主日记中
- DeleteDup: 删除了所有重复的日记
-DockReserve:
- arial: 今日笔记预约
- title: 预约
- refresh: 刷新
- expand: 展开
- collapse: 折叠
- min: 最小化
- emptyContent: 未找到相关内容
- PopupResv: 查看当日预约
-Blacklist:
- name: 黑名单
- toggle: 加入黑名单
- update: 更新黑名单
-SetPastDN:
- title: 为过去的 Daily Note 补充文档属性
- thead:
- - 笔记本
- - '开始日期(点击可手动设置)'
- - 日记数量
- - 启用
- hint:
- initial: >-
- 📚 插件已经自动探寻到所有笔记本中最早的日记的日期。
- 🚀 你现在可以点击「开始」按钮来为所有在这个时间范围内的日记添加自定义属性。
- ⚙️ 如果你认为自动探查到的开始日期不正确,你可以点击「开始日期」列中的单元手动进行设置。
- going: 🕑 设置中...
- end: ✅ 全部设置完成!
- button:
- start: 🚀 开始设置!
- end: 🎉 退出!
- setdate:
- title: 手动设置开始日期
- error: 日期格式错误
+global_notebooks_ts:
+ invalid_notebook_id_config: 你将笔记本 ID 错误地配置为了块 "{0}" 的 ID {1}; 插件已经自动将默认笔记本调整为块所在的笔记本 {2}
diff --git a/src/index.ts b/src/index.ts
index 601835f..3b17c3b 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -201,8 +201,8 @@ export default class DailyNoteTodayPlugin extends Plugin {
//@ts-ignore
title: `${this.i18n.Name}`,
content: ``,
- width: '50%',
- height: '27rem',
+ width: '54rem',
+ height: '36rem',
destroyCallback: () => {
pannel.$destroy();
}
diff --git a/src/types/i18n.d.ts b/src/types/i18n.d.ts
new file mode 100644
index 0000000..532f91b
--- /dev/null
+++ b/src/types/i18n.d.ts
@@ -0,0 +1,204 @@
+interface I18n {
+ Blacklist: {
+ name: string;
+ toggle: string;
+ update: string;
+ };
+ ChangeLog: {
+ file: string;
+ name: string;
+ };
+ ConflictDiary: {
+ AutoMerge: string;
+ CompleteMsg: {
+ AllMerge: string;
+ DeleteDup: string;
+ SmartMerge: string;
+ TrashDup: string;
+ };
+ HeadingMarkdown: string;
+ fail: string;
+ part1: string[];
+ part2: string[];
+ part3: string[];
+ success: string;
+ };
+ ContextMenu: {
+ PruneResv: string;
+ };
+ Create: string;
+ DeReserveMenu: {
+ Success: string;
+ name: string;
+ };
+ DockReserve: {
+ PopupResv: string;
+ arial: string;
+ collapse: string;
+ emptyContent: string;
+ expand: string;
+ min: string;
+ refresh: string;
+ title: string;
+ };
+ InvalidDefaultNotebook: string;
+ MoveMenu: {
+ Move: string;
+ NotLi: string;
+ NotMoveDiary: string;
+ VerIssue: string;
+ };
+ Msg: {
+ PruneResv: string;
+ Resv404: string;
+ };
+ Name: string;
+ NewDay: string[];
+ NewVer: string;
+ Open: string;
+ ReserveMenu: {
+ Date404: string;
+ DateInvalid: string;
+ DatePast: string;
+ Match: string;
+ Success: string;
+ Title: string;
+ name: string;
+ };
+ SetPastDN: {
+ button: {
+ end: string;
+ start: string;
+ };
+ hint: {
+ end: string;
+ going: string;
+ initial: string;
+ };
+ setdate: {
+ error: string;
+ title: string;
+ };
+ thead: string[];
+ title: string;
+ };
+ Setting: {
+ AutoHandleDuplicateMethod: {
+ options: {
+ AllMerge: string;
+ DeleteDup: string;
+ None: string;
+ SmartMerge: string;
+ TrashDup: string;
+ };
+ text: string;
+ title: string;
+ };
+ AutoOpenAfterSync: {
+ text: string;
+ title: string;
+ };
+ DefaultNotebook: {
+ placeholder: string;
+ text: string;
+ title: string;
+ };
+ DisableAutoCreateOnMobile: {
+ text: string;
+ title: string;
+ };
+ EnableMove: {
+ text: string;
+ title: string;
+ };
+ EnableReserve: {
+ text: string;
+ title: string;
+ };
+ EnableResvDock: {
+ text: string;
+ title: string;
+ };
+ ExpandGutterMenu: {
+ text: string;
+ title: string;
+ };
+ HighlightResv: {
+ text: string;
+ title: string;
+ };
+ IconPosition: {
+ options: {
+ left: string;
+ right: string;
+ };
+ text: string;
+ title: string;
+ };
+ NotebookBlacklist: {
+ button: string;
+ text: string;
+ title: string;
+ };
+ NotebookSort: {
+ options: {
+ "custom-sort": string;
+ "doc-tree": string;
+ };
+ text: string;
+ title: string;
+ };
+ OpenOnStart: {
+ text: string;
+ title: string;
+ };
+ PopupReserveDialog: {
+ text: string;
+ title: string;
+ };
+ ReplaceAlt5Hotkey: {
+ text: string;
+ title: string;
+ };
+ ResvEmbedAt: {
+ options: {
+ bottom: string;
+ top: string;
+ };
+ text: string;
+ title: string;
+ };
+ RetvType: {
+ options: {
+ embed: string;
+ link: string;
+ ref: string;
+ };
+ text: string;
+ title: string;
+ };
+ SetPastDailyNoteAttr: {
+ button: string;
+ empty: string;
+ text: string;
+ title: string;
+ };
+ name: string;
+ update: {
+ button: string;
+ text: string;
+ title: string;
+ };
+ };
+ SettingGroups: {
+ dailynote: string;
+ enable: string;
+ interact: string;
+ reservation: string;
+ };
+ TrashBinDocContent: string;
+ UpdateAll: string;
+ global_notebooks_ts: {
+ invalid_notebook_id_config: string;
+ };
+}
diff --git a/src/types/index.d.ts b/src/types/index.d.ts
index 2f94a05..37547d5 100644
--- a/src/types/index.d.ts
+++ b/src/types/index.d.ts
@@ -104,14 +104,35 @@ type doOperation = {
retData: null;
}
-type SettingKey = (
- 'OpenOnStart' | 'DefaultNotebook' | 'IconPosition' |
- 'PluginVersion' | "EnableMove" | 'EnableReserve' |
- "ExpandGutterMenu" | 'PopupReserveDialog' | 'ResvEmbedAt' |
- 'RetvType' | 'EnableResvDock' | 'DisableAutoCreateOnMobile' |
- 'NotebookBlacklist' | 'AutoOpenAfterSync' | 'HighlightResv' |
- 'AutoHandleDuplicateMethod' | 'ReplaceAlt5Hotkey'
-);
+type SettingKey =
+ // App behavior settings
+ | 'OpenOnStart'
+ // | 'AutoOpenAfterSync'
+ | 'DisableAutoCreateOnMobile'
+
+ // Notebook settings
+ | 'DefaultNotebook'
+ | 'NotebookBlacklist'
+
+ // UI settings
+ | 'IconPosition'
+ | 'ExpandGutterMenu'
+ | 'PopupReserveDialog'
+ | 'HighlightResv'
+
+ // Feature toggles
+ | 'EnableMove'
+ | 'EnableReserve'
+ | 'EnableResvDock'
+
+ // Reservation settings
+ | 'ResvEmbedAt'
+ | 'RetvType'
+
+ // System settings
+ | 'PluginVersion'
+ | 'ReplaceAlt5Hotkey'
+ | 'AutoHandleDuplicateMethod';
interface ISettingItem {
type: string;
diff --git a/src/utils.ts b/src/utils.ts
index 1cd81f5..ae06d51 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -1,13 +1,13 @@
// import zh_Hans from "./i18n/zh_CN.json";
// // import en_US from "./i18n/en_US.json";
-import zh_Hans from '../dev/i18n/zh_CN.json';
+// import zh_Hans from '../dev/i18n/zh_CN.json';
import { App, Plugin } from "siyuan";
//@ts-ignore
export const lute = window.Lute!.New();
-export type I18N = typeof zh_Hans;
+// export type I18N = typeof zh_Hans;
// export type I18N = any;
const _fn = (fn: Function, ...args: any[]) => {
@@ -44,7 +44,7 @@ export async function repeatRun(fn: Function, wait: number, maxTimes: number): P
return res;
}
-export let i18n: I18N;
+export let i18n: I18n;
export function setI18n(i18n_: any) {
i18n = i18n_;
}