mirror of
https://github.com/fosrl/pangolin.git
synced 2026-06-24 08:11:48 +00:00
translate strings in auth pages for ssh, vnc, and rdp
This commit is contained in:
@@ -274,7 +274,7 @@ export default function SshClient({
|
||||
);
|
||||
} else {
|
||||
xtermRef.current?.writeln(
|
||||
`\r\n\x1b[31mError: ${msg.error}\x1b[0m\r\n`
|
||||
`\r\n\x1b[31m${t("sshTerminalError", { error: msg.error ?? "" })}\x1b[0m\r\n`
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -309,7 +309,7 @@ export default function SshClient({
|
||||
if (authConfirmed) {
|
||||
setConnected(false);
|
||||
xtermRef.current?.writeln(
|
||||
`\r\n\x1b[33mConnection closed (code ${evt.code})\x1b[0m\r\n`
|
||||
`\r\n\x1b[33m${t("sshConnectionClosedCode", { code: evt.code })}\x1b[0m\r\n`
|
||||
);
|
||||
}
|
||||
// If auth was never confirmed the login form is already visible;
|
||||
@@ -510,7 +510,9 @@ export default function SshClient({
|
||||
privateKey: e.target.value
|
||||
})
|
||||
}
|
||||
placeholder="-----BEGIN OPENSSH PRIVATE KEY-----"
|
||||
placeholder={t(
|
||||
"sshPrivateKeyPlaceholder"
|
||||
)}
|
||||
rows={5}
|
||||
className="font-mono text-xs"
|
||||
/>
|
||||
|
||||
@@ -9,6 +9,7 @@ import SshClient from "./SshClient";
|
||||
import crypto from "crypto";
|
||||
import AuthFooter from "@app/components/AuthFooter";
|
||||
import type { SignSshKeyResponse } from "@server/routers/ssh/types";
|
||||
import { getTranslations } from "next-intl/server";
|
||||
|
||||
const pollInitialDelayMs = 250;
|
||||
const pollStartIntervalMs = 250;
|
||||
@@ -107,6 +108,7 @@ export async function generateMetadata() {
|
||||
}
|
||||
|
||||
export default async function SshPage() {
|
||||
const t = await getTranslations();
|
||||
const headersList = await headers();
|
||||
const cookieHeader = headersList.get("cookie") || "";
|
||||
|
||||
@@ -119,7 +121,7 @@ export default async function SshPage() {
|
||||
target = browserTarget;
|
||||
|
||||
if (!target) {
|
||||
error = "No resource found for this domain";
|
||||
error = t("browserGatewayNoResourceForDomain");
|
||||
} else if (target.pamMode === "push") {
|
||||
try {
|
||||
const { privateKeyPem, publicKeyOpenSSH } =
|
||||
@@ -150,8 +152,7 @@ export default async function SshPage() {
|
||||
await waitForRoundTripCompletion(messageIds, cookieHeader);
|
||||
} catch (err) {
|
||||
console.error("Error signing SSH key:", err);
|
||||
error =
|
||||
"Failed to sign SSH key for PAM push authentication. Did you sign in as a user?";
|
||||
error = t("sshErrorSignKeyFailed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user