diff --git a/src/assets/locales/zh-CN.json b/src/assets/locales/zh-CN.json index dbdb10aa..cd3bbebd 100644 --- a/src/assets/locales/zh-CN.json +++ b/src/assets/locales/zh-CN.json @@ -1062,11 +1062,15 @@ "You have reached the device limit for your account. Please install the latest mobile version of Koodo Reader to remove unused device by visiting Settings - Account - Device Management. ": "您的账户已达到设备数量上限。请安装最新 Koodo Reader 移动版,移除未使用的设备,请前往 设置 - 账户 - 设备管理。", "Relink": "重新链接", "The text is empty": "文本为空", - "Model assignment": "模型分配" - , - "Auto sync reading progress to KOReader sync server": "自动同步阅读进度到 KOReader 同步服务器", - "After enabling it, clicking the sync button will compare reading progress between Koodo Reader and the KOReader sync server by book MD5 and keep the faster progress": "启用后,点击同步按钮会根据图书 MD5 比较 Koodo Reader 与 KOReader 同步服务器中的阅读进度,并保留进度更快的一方", + "Model assignment": "模型分配", + "Auto sync reading progress to KOReader sync server": "自动将阅读进度同步到 KOReader 同步服务器", + "After enabling it, clicking the sync button will sync reading progress between Koodo Reader and KOReader with KOReader sync server. A faster reading progress will override the slower one.": "启用后,点击同步按钮将通过 KOReader 同步服务器在 Koodo Reader 和 KOReader 之间同步阅读进度。较快的阅读进度将覆盖较慢的阅读进度。", + "Please fill in all fields": "请填写所有字段", + "Validating server info...": "正在验证服务器信息...", "Enter username": "输入用户名", + "Enter password": "输入密码", "Leave blank to keep the current password": "留空以保留当前密码", + "Validation successful": "验证成功", + "Validation failed": "验证失败", "Please configure the KOReader sync server first": "请先配置 KOReader 同步服务器" } diff --git a/src/constants/settingList.tsx b/src/constants/settingList.tsx index 163bdd16..50553f0f 100644 --- a/src/constants/settingList.tsx +++ b/src/constants/settingList.tsx @@ -124,7 +124,7 @@ export const dataSettingList = [ { isElectron: false, title: "Auto sync reading progress to KOReader sync server", - desc: "After enabling it, clicking the sync button will compare reading progress between Koodo Reader and the KOReader sync server by book MD5 and keep the faster progress", + desc: "After enabling it, clicking the sync button will sync reading progress between Koodo Reader and KOReader with KOReader sync server. A faster reading progress will override the slower one.", propName: "isEnableKoReaderSync", }, ]; diff --git a/src/containers/settings/dataSetting/component.tsx b/src/containers/settings/dataSetting/component.tsx index 4dbfca32..dc90ac72 100644 --- a/src/containers/settings/dataSetting/component.tsx +++ b/src/containers/settings/dataSetting/component.tsx @@ -90,7 +90,8 @@ class DataSetting extends React.Component { return; } - const savedConfig = ConfigService.getReaderConfig("koReaderSyncConfig") || {}; + const savedConfig = + ConfigService.getReaderConfig("koReaderSyncConfig") || {}; const labels = { serverUrl: this.props.t("Server address"), username: this.props.t("Username"), @@ -100,7 +101,7 @@ class DataSetting extends React.Component { { serverUrl: { value: savedConfig.serverUrl || "", - placeholder: "https://your-koreader-sync-server.com", + placeholder: "https://sync.koreader.rocks", type: "text", }, username: { @@ -135,6 +136,9 @@ class DataSetting extends React.Component { } try { + toast.loading(this.props.t("Validating server info..."), { + id: "ko-reader-sync", + }); const verifiedConfig = await verifyAndBuildKOReaderSyncConfig({ serverUrl: result.serverUrl, username: result.username, @@ -147,10 +151,17 @@ class DataSetting extends React.Component { ConfigService.setReaderConfig("koReaderSyncConfig", verifiedConfig); this.setState({ isEnableKoReaderSync: true }); ConfigService.setReaderConfig("isEnableKoReaderSync", "yes"); - toast.success(this.props.t("Change successful")); + toast.success(this.props.t("Validation successful"), { + id: "ko-reader-sync", + }); } catch (error) { toast.error( - error instanceof Error ? error.message : this.props.t("Binding failed") + error instanceof Error + ? error.message + : this.props.t("Validation failed"), + { + id: "ko-reader-sync", + } ); } };