mirror of
https://github.com/Termix-SSH/Termix.git
synced 2026-10-28 14:15:24 +00:00
fix: translate hardcoded toasts and drop em dashes from ui text
This commit is contained in:
1 parent
3c66931245
commit
1b342322dc
17 files changed
+89
-52
No files matched your search
+2
-2
@@ -461,13 +461,13 @@ export function AppShell({
|
||||
}
|
||||
|
||||
if (!document.fullscreenEnabled) {
|
||||
toast.error("Fullscreen is not supported by this browser");
|
||||
toast.error(t("nav.fullscreenUnsupported"));
|
||||
return;
|
||||
}
|
||||
|
||||
await document.documentElement.requestFullscreen();
|
||||
} catch {
|
||||
toast.error("Unable to toggle fullscreen mode");
|
||||
toast.error(t("nav.fullscreenFailed"));
|
||||
}
|
||||
}, []);
|
||||
|
||||
|
||||
+11
-4
@@ -299,7 +299,9 @@
|
||||
"reconnectingTerminals_other": "Reconnecting {{count}} terminals",
|
||||
"noDisconnectedTerminals": "No disconnected terminals are ready to reconnect",
|
||||
"reconnectTerminalsFailed_one": "Could not start reconnecting {{count}} terminal",
|
||||
"reconnectTerminalsFailed_other": "Could not start reconnecting {{count}} terminals"
|
||||
"reconnectTerminalsFailed_other": "Could not start reconnecting {{count}} terminals",
|
||||
"fullscreenUnsupported": "Fullscreen is not supported by this browser",
|
||||
"fullscreenFailed": "Could not toggle fullscreen"
|
||||
},
|
||||
"hosts": {
|
||||
"hosts": "Hosts",
|
||||
@@ -859,7 +861,11 @@
|
||||
"editorUpdate": "Update Host",
|
||||
"editorAdd": "Add Host",
|
||||
"speedSearch": "Search hosts. Arrow keys to select, Enter to connect, Esc to close",
|
||||
"speedSearchList": "Host list. Type or press / to search."
|
||||
"speedSearchList": "Host list. Type or press / to search.",
|
||||
"importNoHosts": "No hosts found in the file",
|
||||
"importTooMany": "You can import up to {{max}} hosts at once",
|
||||
"importSummary": "Import done: {{imported}} imported, {{updated}} updated, {{failed}} failed",
|
||||
"importHostsFailed": "Failed to import hosts"
|
||||
},
|
||||
"commandPalette": {
|
||||
"searchPlaceholder": "Search hosts, commands, or settings...",
|
||||
@@ -1083,7 +1089,8 @@
|
||||
"resetCodeRateLimitedWithTime": "Rate limited: Too many verification attempts. Please wait {{time}} seconds before trying again.",
|
||||
"authTokenSaveFailed": "Failed to save authentication token",
|
||||
"authTokenMissing": "The server did not return a new authentication token. Please sign in again.",
|
||||
"failedToLoadServer": "Failed to load server"
|
||||
"failedToLoadServer": "Failed to load server",
|
||||
"sessionExpiredLogin": "Session expired. Please log in again."
|
||||
},
|
||||
"messages": {
|
||||
"registrationDisabled": "New account registration is currently disabled by an admin. Please log in or contact an administrator.",
|
||||
@@ -1434,7 +1441,7 @@
|
||||
"noSessionsForUser": "No active sessions",
|
||||
"deleteSuccessorLabel": "Hand over hosts and credentials to",
|
||||
"deleteSuccessorMe": "Me (the deleting admin)",
|
||||
"deleteSuccessorNone": "Nobody — delete them",
|
||||
"deleteSuccessorNone": "Nobody, delete them",
|
||||
"deleteSuccessorDesc": "Everything this user shared keeps working under the new owner; choosing nobody removes their hosts, credentials and shares.",
|
||||
"deleteUserDangerDesc": "Permanently delete {{username}} and all of their data (hosts, credentials, snippets, history). This cannot be undone.",
|
||||
"deleteUserConfirm": "Permanently delete {{username}} and all of their data?",
|
||||
|
||||
@@ -6,6 +6,7 @@ import axios, {
|
||||
type InternalAxiosRequestConfig,
|
||||
} from "axios";
|
||||
import { toast } from "sonner";
|
||||
import i18n from "i18next";
|
||||
import { getBasePath } from "@/lib/base-path";
|
||||
import { isElectron } from "@/lib/electron";
|
||||
import { clearTermixSessionStorage } from "@/shell/TabContext";
|
||||
@@ -534,7 +535,7 @@ function createApiInstance(
|
||||
|
||||
if (typeof window !== "undefined") {
|
||||
console.warn("Session expired - please log in again");
|
||||
toast.warning("Session expired. Please log in again.");
|
||||
toast.warning(i18n.t("errors.sessionExpiredLogin"));
|
||||
window.dispatchEvent(new Event("termix:logout"));
|
||||
}
|
||||
|
||||
|
||||
@@ -393,7 +393,7 @@ export function CredentialEditorView({
|
||||
/>
|
||||
{credForm.value === "existing_key" && (
|
||||
<div className="px-3 py-2 text-[10px] border border-accent-brand/30 bg-accent-brand/5 text-accent-brand">
|
||||
{t("hosts.keySaved")} — {t("hosts.keyReplaceNotice")}
|
||||
{t("hosts.keySaved")}. {t("hosts.keyReplaceNotice")}
|
||||
</div>
|
||||
)}
|
||||
<textarea
|
||||
|
||||
@@ -983,7 +983,7 @@ export function HostEditor({
|
||||
<div className="flex flex-col gap-1.5">
|
||||
{form.key === "existing_key" && (
|
||||
<div className="px-3 py-2 text-[10px] border border-accent-brand/30 bg-accent-brand/5 text-accent-brand">
|
||||
{t("hosts.keySaved")} —{" "}
|
||||
{t("hosts.keySaved")}.{" "}
|
||||
{t("hosts.keyReplaceNotice")}
|
||||
</div>
|
||||
)}
|
||||
|
||||
@@ -455,11 +455,11 @@ export function HostsPanel({
|
||||
? parsed.credentials
|
||||
: undefined;
|
||||
if (!Array.isArray(hostsArray) || hostsArray.length === 0) {
|
||||
toast.error("No hosts found in file");
|
||||
toast.error(t("hosts.importNoHosts"));
|
||||
return;
|
||||
}
|
||||
if (hostsArray.length > 100) {
|
||||
toast.error("Cannot import more than 100 hosts at once");
|
||||
toast.error(t("hosts.importTooMany", { max: 100 }));
|
||||
return;
|
||||
}
|
||||
const normalized = hostsArray.map(
|
||||
@@ -477,16 +477,15 @@ export function HostsPanel({
|
||||
const hosts = await getSSHHosts();
|
||||
setRawHosts(hosts);
|
||||
window.dispatchEvent(new CustomEvent("termix:hosts-changed"));
|
||||
const msg = [
|
||||
result.success ? `${result.success} imported` : null,
|
||||
result.updated ? `${result.updated} updated` : null,
|
||||
result.failed ? `${result.failed} failed` : null,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(", ");
|
||||
toast.success(`Import complete: ${msg}`);
|
||||
toast.success(
|
||||
t("hosts.importSummary", {
|
||||
imported: result.success ?? 0,
|
||||
updated: result.updated ?? 0,
|
||||
failed: result.failed ?? 0,
|
||||
}),
|
||||
);
|
||||
} catch (err: unknown) {
|
||||
toast.error(getErrorMessage(err, "Failed to import hosts"));
|
||||
toast.error(getErrorMessage(err, t("hosts.importHostsFailed")));
|
||||
}
|
||||
}}
|
||||
/>
|
||||
|
||||
Reference in new issue
Block a user