Mehrsprachigkeit (Englisch/Deutsch, Systemsprache oder Auswahl in den Einstellungen), README auf Englisch für Nutzer, Version 0.4.0
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+6
-5
@@ -5,6 +5,7 @@ const fs = require('fs');
|
||||
const os = require('os');
|
||||
const path = require('path');
|
||||
const crypto = require('crypto');
|
||||
const i18n = require('../i18n');
|
||||
|
||||
function defaultAgent() {
|
||||
if (process.env.SSH_AUTH_SOCK) return process.env.SSH_AUTH_SOCK;
|
||||
@@ -77,7 +78,7 @@ class SshManager {
|
||||
let sock;
|
||||
try {
|
||||
for (const hop of [...chain, host]) {
|
||||
onStatus(`Verbinde mit ${hop.label || hop.address} (${hop.address}:${hop.port || 22}) …`);
|
||||
onStatus(i18n.t('Connecting to {name} ({addr}) …', { name: hop.label || hop.address, addr: `${hop.address}:${hop.port || 22}` }));
|
||||
const conn = await this.openClient(hop, sessionId, sock);
|
||||
opened.push(conn);
|
||||
if (hop !== host) {
|
||||
@@ -104,7 +105,7 @@ class SshManager {
|
||||
const answers = [];
|
||||
for (const p of prompts) {
|
||||
if (!p.echo && host.password && !askedPassword) { answers.push(host.password); askedPassword = true; continue; }
|
||||
const a = await this.askSecret(sessionId, { title: name || 'Anmeldung', prompt: p.prompt, echo: p.echo, host: host.label || host.address });
|
||||
const a = await this.askSecret(sessionId, { title: name || i18n.t('Authentication'), prompt: p.prompt, echo: p.echo, host: host.label || host.address });
|
||||
if (a == null) return finish([]);
|
||||
answers.push(a);
|
||||
}
|
||||
@@ -114,7 +115,7 @@ class SshManager {
|
||||
conn.once('error', async (err) => {
|
||||
// Kein Passwort hinterlegt und alle Methoden schlugen fehl -> nach Passwort fragen und neu versuchen
|
||||
if (err.level === 'client-authentication' && !host.password && !host._retried) {
|
||||
const pw = await this.askSecret(sessionId, { title: 'Passwort', prompt: `Passwort für ${cfg.username}@${host.address}`, echo: false, host: host.label || host.address });
|
||||
const pw = await this.askSecret(sessionId, { title: i18n.t('Password'), prompt: i18n.t('Password for {user}', { user: `${cfg.username}@${host.address}` }), echo: false, host: host.label || host.address });
|
||||
if (pw != null) {
|
||||
this.openClient({ ...host, password: pw, _retried: true }, sessionId, sock).then(resolve, reject);
|
||||
return;
|
||||
@@ -178,7 +179,7 @@ class SshManager {
|
||||
|
||||
sftpOf(id) {
|
||||
const s = this.sessions.get(id);
|
||||
if (!s?.sftp) throw new Error('SFTP-Sitzung nicht gefunden');
|
||||
if (!s?.sftp) throw new Error(i18n.t('SFTP session not found'));
|
||||
return s.sftp;
|
||||
}
|
||||
|
||||
@@ -250,7 +251,7 @@ class SshManager {
|
||||
// ---------- Port-Forwarding ----------
|
||||
async startForward(fw, onEvent) {
|
||||
const host = this.store.resolveHost(fw.hostId);
|
||||
if (!host) throw new Error('Host nicht gefunden');
|
||||
if (!host) throw new Error(i18n.t('Host not found'));
|
||||
const { conn, jumps } = await this.connect(host, 'fw-' + fw.id);
|
||||
const entry = { conn, jumps };
|
||||
this.forwards.set(fw.id, entry);
|
||||
|
||||
Reference in New Issue
Block a user