mirror of
https://github.com/svemagie/obsidian-micropub.git
synced 2026-05-15 03:48:52 +02:00
feat(i18n): wire t() into SyndicationDialog and IndieAuth
This commit is contained in:
+2
-1
@@ -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 = {
|
||||
|
||||
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user