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

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);
})
);

View File

@@ -92,7 +92,7 @@ export function paneRemoteConfig(
}
{
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({});
el.setText(`${remoteNameMap[this.editingSettings.remoteType] || " - "}`);

View File

@@ -31,10 +31,10 @@ export function paneSetup(
});
new Setting(paneEl)
.setName("Rerun Onboarding Wizard")
.setDesc("Rerun the onboarding wizard to set up Self-hosted LiveSync again.")
.setName($msg("Rerun Onboarding Wizard"))
.setDesc($msg("Rerun the onboarding wizard to set up Self-hosted LiveSync again."))
.addButton((text) => {
text.setButtonText("Rerun Wizard").onClick(async () => {
text.setButtonText($msg("Rerun Wizard")).onClick(async () => {
const setupManager = this.plugin.getModule(SetupManager);
await setupManager.onOnboard(UserMode.ExistingUser);
// await this.plugin.moduleSetupObsidian.onBoardingWizard(true);