diff --git a/src/langs/en.json b/src/langs/en.json index d6f8797..b71dd5e 100644 --- a/src/langs/en.json +++ b/src/langs/en.json @@ -7,17 +7,17 @@ "sometext": "Here are some texts.", "syncrun_alreadyrunning": "{{pluginName}} already running in stage {{syncStatus}}!", "syncrun_syncingribbon": "{{pluginName}}: syncing from {{triggerSource}}", - "syncrun_step0": "0/{{maxSteps}} Remotely Save running in dry mode, not actual file changes would happen.", - "syncrun_step1": "1/{{maxSteps}} Remotely Save Sync Preparing ({{serviceType}})", - "syncrun_step2": "2/{{maxSteps}} Starting to fetch remote meta data.", - "syncrun_step3": "3/{{maxSteps}} Checking password correct or not.", + "syncrun_step0": "0/8 Remotely Save running in dry mode, not actual file changes would happen.", + "syncrun_step1": "1/8 Remotely Save Sync Preparing ({{serviceType}})", + "syncrun_step2": "2/8 Starting to fetch remote meta data.", + "syncrun_step3": "3/8 Checking password correct or not.", "syncrun_passworderr": "Something goes wrong while checking password.", - "syncrun_step4": "4/{{maxSteps}} Trying to fetch extra meta data from remote.", - "syncrun_step5": "5/{{maxSteps}} Starting to fetch local meta data.", - "syncrun_step6": "6/{{maxSteps}} Starting to generate sync plan.", - "syncrun_step7": "7/{{maxSteps}} Remotely Save Sync data exchanging!", - "syncrun_step7skip": "7/{{maxSteps}} Remotely Save real sync is skipped in dry run mode.", - "syncrun_step8": "8/{{maxSteps}} Remotely Save finish!", + "syncrun_step4": "4/8 Trying to fetch extra meta data from remote.", + "syncrun_step5": "5/8 Starting to fetch local meta data.", + "syncrun_step6": "6/8 Starting to generate sync plan.", + "syncrun_step7": "7/8 Remotely Save Sync data exchanging!", + "syncrun_step7skip": "7/8 Remotely Save real sync is skipped in dry run mode.", + "syncrun_step8": "8/8 Remotely Save finish!", "syncrun_abort": "{{manifestID}}-{{theDate}}: abort sync, triggerSource={{triggerSource}}, error while {{syncStatus}}", "protocol_saveqr": "New not-oauth2 settings for {{manifestName}} saved. Reopen the plugin Settings to the effect.", "protocol_callbacknotsupported": "Your uri call a callback that's not supported yet: {{params}}", diff --git a/src/langs/zh_cn.json b/src/langs/zh_cn.json index 809bb83..33f52a0 100644 --- a/src/langs/zh_cn.json +++ b/src/langs/zh_cn.json @@ -7,17 +7,17 @@ "sometext": "这里有一段文字。", "syncrun_alreadyrunning": "{{pluginName}} 正处于此阶段:{{syncStatus}}!", "syncrun_syncingribbon": "{{pluginName}}:正在由 {{triggerSource}} 触发运行", - "syncrun_step0": "0/{{maxSteps}} Remotely Save 在空跑(dry run)模式,不会发生实际的文件交换。", - "syncrun_step1": "1/{{maxSteps}} Remotely Save 准备同步({{serviceType}})", - "syncrun_step2": "2/{{maxSteps}} 正在获取远端的元数据。", - "syncrun_step3": "3/{{maxSteps}} 正在检查密码正确与否。", + "syncrun_step0": "0/8 Remotely Save 在空跑(dry run)模式,不会发生实际的文件交换。", + "syncrun_step1": "1/8 Remotely Save 准备同步({{serviceType}})", + "syncrun_step2": "2/8 正在获取远端的元数据。", + "syncrun_step3": "3/8 正在检查密码正确与否。", "syncrun_passworderr": "检查密码时候出错。", - "syncrun_step4": "4/{{maxSteps}} 正在获取远端的额外的元数据。", - "syncrun_step5": "5/{{maxSteps}} 正在获取本地的元数据。", - "syncrun_step6": "6/{{maxSteps}} 正在生成同步计划。", - "syncrun_step7": "7/{{maxSteps}} Remotely Save 开始发生数据交换!", - "syncrun_step7skip": "7/{{maxSteps}} Remotely Save 在空跑模式,跳过实际数据交换步骤。", - "syncrun_step8": "8/{{maxSteps}} Remotely Save 已完成同步!", + "syncrun_step4": "4/8 正在获取远端的额外的元数据。", + "syncrun_step5": "5/8 正在获取本地的元数据。", + "syncrun_step6": "6/8 正在生成同步计划。", + "syncrun_step7": "7/8 Remotely Save 开始发生数据交换!", + "syncrun_step7skip": "7/8 Remotely Save 在空跑模式,跳过实际数据交换步骤。", + "syncrun_step8": "8/8 Remotely Save 已完成同步!", "syncrun_abort": "{{manifestID}}-{{theDate}}:中断同步,同步来源={{triggerSource}},出错阶段={{syncStatus}}", "protocol_saveqr": " {{manifestName}} 新的非 oauth2 设置保存完成。请重启插件设置页使之生效。", "protocol_callbacknotsupported": "您的 uri callback 暂不支持: {{params}}", diff --git a/src/langs/zh_tw.json b/src/langs/zh_tw.json index 93357b3..85f9618 100644 --- a/src/langs/zh_tw.json +++ b/src/langs/zh_tw.json @@ -7,17 +7,17 @@ "sometext": "這裡有一段文字。", "syncrun_alreadyrunning": "{{pluginName}} 正處於此階段:{{syncStatus}}!", "syncrun_syncingribbon": "{{pluginName}}:正在由 {{triggerSource}} 觸發執行", - "syncrun_step0": "0/{{maxSteps}} Remotely Save 在空跑(dry run)模式,不會發生實際的檔案交換。", - "syncrun_step1": "1/{{maxSteps}} Remotely Save 準備同步({{serviceType}})", - "syncrun_step2": "2/{{maxSteps}} 正在獲取遠端的元資料。", - "syncrun_step3": "3/{{maxSteps}} 正在檢查密碼正確與否。", + "syncrun_step0": "0/8 Remotely Save 在空跑(dry run)模式,不會發生實際的檔案交換。", + "syncrun_step1": "1/8 Remotely Save 準備同步({{serviceType}})", + "syncrun_step2": "2/8 正在獲取遠端的元資料。", + "syncrun_step3": "3/8 正在檢查密碼正確與否。", "syncrun_passworderr": "檢查密碼時候出錯。", - "syncrun_step4": "4/{{maxSteps}} 正在獲取遠端的額外的元資料。", - "syncrun_step5": "5/{{maxSteps}} 正在獲取本地的元資料。", - "syncrun_step6": "6/{{maxSteps}} 正在生成同步計劃。", - "syncrun_step7": "7/{{maxSteps}} Remotely Save 開始發生資料交換!", - "syncrun_step7skip": "7/{{maxSteps}} Remotely Save 在空跑模式,跳過實際資料交換步驟。", - "syncrun_step8": "8/{{maxSteps}} Remotely Save 已完成同步!", + "syncrun_step4": "4/8 正在獲取遠端的額外的元資料。", + "syncrun_step5": "5/8 正在獲取本地的元資料。", + "syncrun_step6": "6/8 正在生成同步計劃。", + "syncrun_step7": "7/8 Remotely Save 開始發生資料交換!", + "syncrun_step7skip": "7/8 Remotely Save 在空跑模式,跳過實際資料交換步驟。", + "syncrun_step8": "8/8 Remotely Save 已完成同步!", "syncrun_abort": "{{manifestID}}-{{theDate}}:中斷同步,同步來源={{triggerSource}},出錯階段={{syncStatus}}", "protocol_saveqr": " {{manifestName}} 新的非 oauth2 設定儲存完成。請重啟外掛設定頁使之生效。", "protocol_callbacknotsupported": "您的 uri callback 暫不支援: {{params}}", diff --git a/src/main.ts b/src/main.ts index 52a3d0f..0a49af1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -192,30 +192,19 @@ export default class RemotelySavePlugin extends Plugin { ); } - const MAX_STEPS = 8; - if (triggerSource === "dry") { - getNotice( - t("syncrun_step0", { - maxSteps: `${MAX_STEPS}`, - }) - ); + getNotice(t("syncrun_step0")); } //log.info(`huh ${this.settings.password}`) getNotice( t("syncrun_step1", { - maxSteps: `${MAX_STEPS}`, serviceType: this.settings.serviceType, }) ); this.syncStatus = "preparing"; - getNotice( - t("syncrun_step2", { - maxSteps: `${MAX_STEPS}`, - }) - ); + getNotice(t("syncrun_step2")); this.syncStatus = "getting_remote_files_list"; const self = this; const client = new RemoteClient( @@ -230,11 +219,7 @@ export default class RemotelySavePlugin extends Plugin { const remoteRsp = await client.listFromRemote(); // log.debug(remoteRsp); - getNotice( - t("syncrun_step3", { - maxSteps: `${MAX_STEPS}`, - }) - ); + getNotice(t("syncrun_step3")); this.syncStatus = "checking_password"; const passwordCheckResult = await isPasswordOk( remoteRsp.Contents, @@ -245,11 +230,7 @@ export default class RemotelySavePlugin extends Plugin { throw Error(passwordCheckResult.reason); } - getNotice( - t("syncrun_step4", { - maxSteps: `${MAX_STEPS}`, - }) - ); + getNotice(t("syncrun_step4")); this.syncStatus = "getting_remote_extra_meta"; const { remoteStates, metadataFile } = await parseRemoteItems( remoteRsp.Contents, @@ -265,11 +246,7 @@ export default class RemotelySavePlugin extends Plugin { this.settings.password ); - getNotice( - t("syncrun_step5", { - maxSteps: `${MAX_STEPS}`, - }) - ); + getNotice(t("syncrun_step5")); this.syncStatus = "getting_local_meta"; const local = this.app.vault.getAllLoadedFiles(); const localHistory = await loadFileHistoryTableByVault( @@ -287,11 +264,7 @@ export default class RemotelySavePlugin extends Plugin { // log.info(local); // log.info(localHistory); - getNotice( - t("syncrun_step6", { - maxSteps: `${MAX_STEPS}`, - }) - ); + getNotice(t("syncrun_step6")); this.syncStatus = "generating_plan"; const { plan, sortedKeys, deletions, sizesGoWrong } = await getSyncPlan( remoteStates, @@ -316,11 +289,7 @@ export default class RemotelySavePlugin extends Plugin { // The operations below begins to write or delete (!!!) something. if (triggerSource !== "dry") { - getNotice( - t("syncrun_step7", { - maxSteps: `${MAX_STEPS}`, - }) - ); + getNotice(t("syncrun_step7")); this.syncStatus = "syncing"; await doActualSync( @@ -351,18 +320,10 @@ export default class RemotelySavePlugin extends Plugin { ); } else { this.syncStatus = "syncing"; - getNotice( - t("syncrun_step7skip", { - maxSteps: `${MAX_STEPS}`, - }) - ); + getNotice(t("syncrun_step7skip")); } - getNotice( - t("syncrun_step8", { - maxSteps: `${MAX_STEPS}`, - }) - ); + getNotice(t("syncrun_step8")); this.syncStatus = "finish"; this.syncStatus = "idle";