refactor: replace hardcoded strings with i18n keys

This commit is contained in:
oenhu
2026-01-09 00:29:40 +08:00
parent 02aa9319c3
commit a9f1bbff9f
3 changed files with 14 additions and 14 deletions

View File

@@ -48,7 +48,7 @@ export function paneHatch(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement,
.setDesc($msg("Setting.TroubleShooting.Doctor.Desc"))
.addButton((button) =>
button
.setButtonText("Run Doctor")
.setButtonText($msg("Run Doctor"))
.setCta()
.setDisabled(false)
.onClick(() => {
@@ -69,9 +69,9 @@ export function paneHatch(this: ObsidianLiveSyncSettingTab, paneEl: HTMLElement,
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
.setButtonText("Copy Report to clipboard")
.setButtonText($msg("Copy Report to clipboard"))
.setCta()
.setDisabled(false)
.onClick(async () => {
@@ -189,20 +189,20 @@ ${stringifyYaml({
})
);
new Setting(paneEl)
.setName("Analyse database usage")
.setDesc(
.setName($msg("Analyse database usage"))
.setDesc($msg(
"Analyse database usage and generate a TSV report for diagnosis yourself. You can paste the generated report with any spreadsheet you like."
)
))
.addButton((button) =>
button.setButtonText("Analyse").onClick(() => {
button.setButtonText($msg("Analyse")).onClick(() => {
eventHub.emitEvent(EVENT_ANALYSE_DB_USAGE);
})
);
new Setting(paneEl)
.setName("Reset notification threshold and check the remote database usage")
.setDesc("Reset the remote storage size threshold and check the remote storage size again.")
.setName($msg("Reset notification threshold and check the remote database usage"))
.setDesc($msg("Reset the remote storage size threshold and check the remote storage size again."))
.addButton((button) =>
button.setButtonText("Check").onClick(() => {
button.setButtonText($msg("Check")).onClick(() => {
eventHub.emitEvent(EVENT_REQUEST_CHECK_REMOTE_SIZE);
})
);