feat(i18n): wire t() into SyndicationDialog and IndieAuth

This commit is contained in:
svemagie
2026-04-14 12:47:26 +02:00
parent 2d67fd48ee
commit 8d0cf8b576
2 changed files with 7 additions and 5 deletions
+2 -1
View File
@@ -27,6 +27,7 @@
import * as crypto from "crypto";
import { requestUrl } from "obsidian";
import { t } from "./i18n";
export const CLIENT_ID = "https://svemagie.github.io/obsidian-micropub/";
export const REDIRECT_URI = "https://svemagie.github.io/obsidian-micropub/callback";
@@ -123,7 +124,7 @@ export class IndieAuth {
(resolve, reject) => {
const timeout = setTimeout(() => {
pendingCallback = null;
reject(new Error("Sign-in timed out (5 min). Please try again."));
reject(new Error(t("errSignInTimeout")));
}, AUTH_TIMEOUT_MS);
pendingCallback = {
+5 -4
View File
@@ -7,6 +7,7 @@
import { App, Modal, Setting } from "obsidian";
import type { SyndicationTarget } from "./types";
import { t } from "./i18n";
export class SyndicationDialog extends Modal {
private selected: Set<string>;
@@ -37,9 +38,9 @@ export class SyndicationDialog extends Modal {
onOpen(): void {
const { contentEl } = this;
contentEl.createEl("h2", { text: "Syndication targets" });
contentEl.createEl("h2", { text: t("syndDialogTitle") });
contentEl.createEl("p", {
text: "Choose where to cross-post this note.",
text: t("syndDialogSubtitle"),
cls: "setting-item-description",
});
@@ -59,14 +60,14 @@ export class SyndicationDialog extends Modal {
new Setting(contentEl)
.addButton((btn) =>
btn
.setButtonText("Cancel")
.setButtonText(t("btnCancel"))
.onClick(() => {
this.finish(null);
}),
)
.addButton((btn) =>
btn
.setButtonText("Publish")
.setButtonText(t("btnPublish"))
.setCta()
.onClick(() => {
this.finish([...this.selected]);