Merge pull request #779 from oenhu/main

refactor: replace hardcoded strings with i18n keys
This commit is contained in:
vorotamoroz
2026-02-02 13:38:01 +09:00
committed by GitHub
3 changed files with 14 additions and 14 deletions
@@ -48,7 +48,7 @@ export function paneHatch(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement,
.setDesc($msg("Setting.TroubleShooting.Doctor.Desc")) .setDesc($msg("Setting.TroubleShooting.Doctor.Desc"))
.addButton((button) => .addButton((button) =>
button button
.setButtonText("Run Doctor") .setButtonText($msg("Run Doctor"))
.setCta() .setCta()
.setDisabled(false) .setDisabled(false)
.onClick(() => { .onClick(() => {
@@ -69,9 +69,9 @@ export function paneHatch(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement,
eventHub.emitEvent(EVENT_REQUEST_RUN_FIX_INCOMPLETE); eventHub.emitEvent(EVENT_REQUEST_RUN_FIX_INCOMPLETE);
}) })
); );
new Setting(paneEl).setName("Prepare the 'report' to create an issue").addButton((button) => new Setting(paneEl).setName($msg("Prepare the 'report' to create an issue")).addButton((button) =>
button button
.setButtonText("Copy Report to clipboard") .setButtonText($msg("Copy Report to clipboard"))
.setCta() .setCta()
.setDisabled(false) .setDisabled(false)
.onClick(async () => { .onClick(async () => {
@@ -189,20 +189,20 @@ ${stringifyYaml({
}) })
); );
new Setting(paneEl) new Setting(paneEl)
.setName("Analyse database usage") .setName($msg("Analyse database usage"))
.setDesc( .setDesc($msg(
"Analyse database usage and generate a TSV report for diagnosis yourself. You can paste the generated report with any spreadsheet you like." "Analyse database usage and generate a TSV report for diagnosis yourself. You can paste the generated report with any spreadsheet you like."
) ))
.addButton((button) => .addButton((button) =>
button.setButtonText("Analyse").onClick(() => { button.setButtonText($msg("Analyse")).onClick(() => {
eventHub.emitEvent(EVENT_ANALYSE_DB_USAGE); eventHub.emitEvent(EVENT_ANALYSE_DB_USAGE);
}) })
); );
new Setting(paneEl) new Setting(paneEl)
.setName("Reset notification threshold and check the remote database usage") .setName($msg("Reset notification threshold and check the remote database usage"))
.setDesc("Reset the remote storage size threshold and check the remote storage size again.") .setDesc($msg("Reset the remote storage size threshold and check the remote storage size again."))
.addButton((button) => .addButton((button) =>
button.setButtonText("Check").onClick(() => { button.setButtonText($msg("Check")).onClick(() => {
eventHub.emitEvent(EVENT_REQUEST_CHECK_REMOTE_SIZE); eventHub.emitEvent(EVENT_REQUEST_CHECK_REMOTE_SIZE);
}) })
); );
@@ -92,7 +92,7 @@ export function paneRemoteConfig(
} }
{ {
void addPanel(paneEl, $msg("obsidianLiveSyncSettingTab.titleRemoteServer"), () => {}).then((paneEl) => { void addPanel(paneEl, $msg("obsidianLiveSyncSettingTab.titleRemoteServer"), () => {}).then((paneEl) => {
const setting = new Setting(paneEl).setName("Active Remote Configuration"); const setting = new Setting(paneEl).setName($msg("Active Remote Configuration"));
const el = setting.controlEl.createDiv({}); const el = setting.controlEl.createDiv({});
el.setText(`${remoteNameMap[this.editingSettings.remoteType] || " - "}`); el.setText(`${remoteNameMap[this.editingSettings.remoteType] || " - "}`);
@@ -31,10 +31,10 @@ export function paneSetup(
}); });
new Setting(paneEl) new Setting(paneEl)
.setName("Rerun Onboarding Wizard") .setName($msg("Rerun Onboarding Wizard"))
.setDesc("Rerun the onboarding wizard to set up Self-hosted LiveSync again.") .setDesc($msg("Rerun the onboarding wizard to set up Self-hosted LiveSync again."))
.addButton((text) => { .addButton((text) => {
text.setButtonText("Rerun Wizard").onClick(async () => { text.setButtonText($msg("Rerun Wizard")).onClick(async () => {
const setupManager = this.plugin.getModule(SetupManager); const setupManager = this.plugin.getModule(SetupManager);
await setupManager.onOnboard(UserMode.ExistingUser); await setupManager.onOnboard(UserMode.ExistingUser);
// await this.plugin.moduleSetupObsidian.onBoardingWizard(true); // await this.plugin.moduleSetupObsidian.onBoardingWizard(true);