{line}
- {/each}
- {line}
+ {/each}
+ Here due to an upgrade notification? Please review the version history. If you're satisfied, click the button. A new update will prompt this again.
`; + tmpDiv.innerHTML = `${$tf("obsidianLiveSyncSettingTab.msgNewVersionNote")}
` if (lastVersion > (this.editingSettings?.lastReadUpdates || 0)) { const informationButtonDiv = informationDivEl.appendChild(tmpDiv); informationButtonDiv.querySelector("button")?.addEventListener("click", () => { @@ -917,35 +898,33 @@ Store only the settings. **Caution: This may lead to data corruption**; database ); }); - void addPane(containerEl, "Setup", "🧙♂️", 110, false).then((paneEl) => { - void addPanel(paneEl, "Quick Setup").then((paneEl) => { + void addPane(containerEl, $tf("obsidianLiveSyncSettingTab.panelSetup"), "🧙♂️", 110, false).then((paneEl) => { + void addPanel(paneEl, $tf("obsidianLiveSyncSettingTab.titleQuickSetup")).then((paneEl) => { new Setting(paneEl) - .setName("Connect with Setup URI") - .setDesc("This is the recommended method to set up Self-hosted LiveSync with a Setup URI.") + .setName($tf("obsidianLiveSyncSettingTab.nameConnectSetupURI")) + .setDesc($tf("obsidianLiveSyncSettingTab.descConnectSetupURI")) .addButton((text) => { - text.setButtonText("Use").onClick(() => { + text.setButtonText($tf("obsidianLiveSyncSettingTab.btnUse")).onClick(() => { this.closeSetting(); eventHub.emitEvent(EVENT_REQUEST_OPEN_SETUP_URI); }); }); new Setting(paneEl) - .setName("Manual setup") - .setDesc("Not recommended, but useful if you don't have a Setup URI") + .setName($tf("obsidianLiveSyncSettingTab.nameManualSetup")) + .setDesc($tf("obsidianLiveSyncSettingTab.descManualSetup")) .addButton((text) => { - text.setButtonText("Start").onClick(async () => { + text.setButtonText($tf("obsidianLiveSyncSettingTab.btnStart")).onClick(async () => { await this.enableMinimalSetup(); }); }); new Setting(paneEl) - .setName("Enable LiveSync") - .setDesc( - "Only enable this after configuring either of the above two options or completing all configuration manually." - ) + .setName($tf("obsidianLiveSyncSettingTab.nameEnableLiveSync")) + .setDesc($tf("obsidianLiveSyncSettingTab.descEnableLiveSync")) .addOnUpdate(visibleOnly(() => !this.isConfiguredAs("isConfigured", true))) .addButton((text) => { - text.setButtonText("Enable").onClick(async () => { + text.setButtonText($tf("obsidianLiveSyncSettingTab.btnEnable")).onClick(async () => { this.editingSettings.isConfigured = true; await this.saveAllDirtySettings(); this.plugin.$$askReload(); @@ -955,29 +934,29 @@ Store only the settings. **Caution: This may lead to data corruption**; database void addPanel( paneEl, - "To setup other devices", + $tf("obsidianLiveSyncSettingTab.titleSetupOtherDevices"), undefined, visibleOnly(() => this.isConfiguredAs("isConfigured", true)) ).then((paneEl) => { new Setting(paneEl) - .setName("Copy the current settings to a Setup URI") - .setDesc("Perfect for setting up a new device!") + .setName($tf("obsidianLiveSyncSettingTab.nameCopySetupURI")) + .setDesc($tf("obsidianLiveSyncSettingTab.descCopySetupURI")) .addButton((text) => { - text.setButtonText("Copy").onClick(() => { + text.setButtonText($tf("obsidianLiveSyncSettingTab.btnCopy")).onClick(() => { // await this.plugin.addOnSetup.command_copySetupURI(); eventHub.emitEvent(EVENT_REQUEST_COPY_SETUP_URI); }); }); }); - void addPanel(paneEl, "Reset").then((paneEl) => { + void addPanel(paneEl, $tf("obsidianLiveSyncSettingTab.titleReset")).then((paneEl) => { new Setting(paneEl) - .setName("Discard existing settings and databases") + .setName($tf("obsidianLiveSyncSettingTab.nameDiscardSettings")) .addButton((text) => { - text.setButtonText("Discard") + text.setButtonText($tf("obsidianLiveSyncSettingTab.btnDiscard")) .onClick(async () => { if ( (await this.plugin.confirm.askYesNoDialog( - "Do you really want to discard existing settings and databases?", + $tf("obsidianLiveSyncSettingTab.msgDiscardConfirmation"), { defaultOption: "No" } )) == "yes" ) { @@ -993,9 +972,9 @@ Store only the settings. **Caution: This may lead to data corruption**; database .setWarning(); }) .addOnUpdate(visibleOnly(() => this.isConfiguredAs("isConfigured", true))); - // } }); - void addPanel(paneEl, "Enable extra and advanced features").then((paneEl) => { + + void addPanel(paneEl, $tf("obsidianLiveSyncSettingTab.titleExtraFeatures")).then((paneEl) => { new Setting(paneEl).autoWireToggle("useAdvancedMode"); new Setting(paneEl).autoWireToggle("usePowerUserMode"); @@ -1005,17 +984,18 @@ Store only the settings. **Caution: This may lead to data corruption**; database this.addOnSaved("usePowerUserMode", () => this.display()); this.addOnSaved("useEdgeCaseMode", () => this.display()); }); - void addPanel(paneEl, "Online Tips").then((paneEl) => { - // this.createEl(paneEl, "h3", { text: "Online Tips" }); + + void addPanel(paneEl, $tf("obsidianLiveSyncSettingTab.titleOnlineTips")).then((paneEl) => { + // this.createEl(paneEl, "h3", { text: $tf("obsidianLiveSyncSettingTab.titleOnlineTips") }); const repo = "vrtmrz/obsidian-livesync"; - const topPath = "/docs/troubleshooting.md"; + const topPath = $tf("obsidianLiveSyncSettingTab.linkTroubleshooting"); const rawRepoURI = `https://raw.githubusercontent.com/${repo}/main`; this.createEl( paneEl, "div", "", (el) => - (el.innerHTML = `Open in browser`) + (el.innerHTML = `${$tf("obsidianLiveSyncSettingTab.linkOpenInBrowser")}`) ); const troubleShootEl = this.createEl(paneEl, "div", { text: "", @@ -1035,7 +1015,7 @@ Store only the settings. **Caution: This may lead to data corruption**; database try { remoteTroubleShootMDSrc = await request(`${rawRepoURI}${basePath}/${filename}`); } catch (ex: any) { - remoteTroubleShootMDSrc = "An error occurred!!\n" + ex.toString(); + remoteTroubleShootMDSrc = `${$tf("obsidianLiveSyncSettingTab.logErrorOccurred")}\n${ex.toString()}`; } const remoteTroubleShootMD = remoteTroubleShootMDSrc.replace( /\((.*?(.png)|(.jpg))\)/g, @@ -1044,7 +1024,7 @@ Store only the settings. **Caution: This may lead to data corruption**; database // Render markdown await MarkdownRenderer.render( this.plugin.app, - ` [Tips and Troubleshooting](${topPath}) [PageTop](${filename})\n\n${remoteTroubleShootMD}`, + ` [${$tf("obsidianLiveSyncSettingTab.linkTipsAndTroubleshooting")}](${topPath}) [${$tf("obsidianLiveSyncSettingTab.linkPageTop")}](${filename})\n\n${remoteTroubleShootMD}`, troubleShootEl, `${rawRepoURI}`, this.plugin @@ -1097,10 +1077,10 @@ Store only the settings. **Caution: This may lead to data corruption**; database void loadMarkdownPage(topPath); }); }); - void addPane(containerEl, "General Settings", "⚙️", 20, false).then((paneEl) => { - void addPanel(paneEl, "Appearance").then((paneEl) => { + void addPane(containerEl, $tf("obsidianLiveSyncSettingTab.panelGeneralSettings"), "⚙️", 20, false).then((paneEl) => { + void addPanel(paneEl, $tf("obsidianLiveSyncSettingTab.titleAppearance")).then((paneEl) => { const languages = Object.fromEntries([ - ["", "Default"], + ["", $tf("obsidianLiveSyncSettingTab.defaultLanguage")], ...SUPPORTED_I18N_LANGS.map((e) => [e, $t(`lang-${e}`)]), ]) as Record