Skip to content

Commit fe01135

Browse files
luizomfclaude
andcommitted
fix(tunnels): translate diagram labels and descriptions to PT-BR
"sua máquina", "no servidor", "qualquer destino", etc. The diagram is the main learning tool — needs to speak the audience's language. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 2f07854 commit fe01135

2 files changed

Lines changed: 13 additions & 12 deletions

File tree

src/lib/__tests__/tunnel-generator.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -380,22 +380,22 @@ describe('generateSshConfig', () => {
380380
});
381381

382382
describe('generateDiagram', () => {
383-
it('generates local tunnel diagram', () => {
383+
it('generates local tunnel diagram in PT-BR', () => {
384384
const tunnel: TunnelSpec = {
385385
type: 'local',
386386
localPort: 8080,
387387
remoteHost: 'db.internal',
388388
remotePort: 3306,
389389
};
390390
const diagram = generateDiagram(tunnel, makeOptions({ sshUser: 'user', sshServer: 'bastion' }));
391-
expect(diagram.left).toBe('localhost:8080');
391+
expect(diagram.left).toBe('sua máquina :8080');
392392
expect(diagram.middle).toBe('user@bastion');
393393
expect(diagram.right).toBe('db.internal:3306');
394394
expect(diagram.description).toContain('8080');
395395
expect(diagram.description).toContain('db.internal:3306');
396396
});
397397

398-
it('generates remote tunnel diagram', () => {
398+
it('generates remote tunnel diagram in PT-BR', () => {
399399
const tunnel: TunnelSpec = {
400400
type: 'remote',
401401
remotePort: 8080,
@@ -406,17 +406,18 @@ describe('generateDiagram', () => {
406406
const diagram = generateDiagram(tunnel, makeOptions({ sshServer: 'vps' }));
407407
expect(diagram.left).toBe('localhost:3000');
408408
expect(diagram.right).toContain('8080');
409+
expect(diagram.right).toContain('no servidor');
409410
expect(diagram.description).toContain('3000');
410411
});
411412

412-
it('generates dynamic tunnel diagram', () => {
413+
it('generates dynamic tunnel diagram in PT-BR', () => {
413414
const tunnel: TunnelSpec = {
414415
type: 'dynamic',
415416
localPort: 1080,
416417
};
417418
const diagram = generateDiagram(tunnel, makeOptions({ sshServer: 'vps' }));
418419
expect(diagram.left).toContain('1080');
419420
expect(diagram.left).toContain('SOCKS');
420-
expect(diagram.right).toBe('any destination');
421+
expect(diagram.right).toBe('qualquer destino');
421422
});
422423
});

src/lib/tunnel-generator.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -183,24 +183,24 @@ export function generateDiagram(tunnel: TunnelSpec, options: TunnelOptions): Tun
183183
switch (tunnel.type) {
184184
case 'local':
185185
return {
186-
left: `localhost:${tunnel.localPort}`,
186+
left: `sua máquina :${tunnel.localPort}`,
187187
middle: server,
188188
right: `${tunnel.remoteHost}:${tunnel.remotePort}`,
189-
description: `Traffic on your port ${tunnel.localPort} goes through ${server} to reach ${tunnel.remoteHost}:${tunnel.remotePort}`,
189+
description: `Tráfego na sua porta ${tunnel.localPort} passa por ${server} e chega em ${tunnel.remoteHost}:${tunnel.remotePort}`,
190190
};
191191
case 'remote':
192192
return {
193193
left: `${tunnel.localHost}:${tunnel.localPort}`,
194194
middle: server,
195-
right: `${tunnel.bindAddress || 'localhost'}:${tunnel.remotePort} (on server)`,
196-
description: `Port ${tunnel.remotePort} on ${options.sshServer} forwards back to your ${tunnel.localHost}:${tunnel.localPort}`,
195+
right: `${tunnel.bindAddress || 'localhost'}:${tunnel.remotePort} (no servidor)`,
196+
description: `A porta ${tunnel.remotePort} no ${options.sshServer} encaminha de volta para o seu ${tunnel.localHost}:${tunnel.localPort}`,
197197
};
198198
case 'dynamic':
199199
return {
200-
left: `localhost:${tunnel.localPort} (SOCKS)`,
200+
left: `sua máquina :${tunnel.localPort} (SOCKS)`,
201201
middle: server,
202-
right: 'any destination',
203-
description: `SOCKS proxy on port ${tunnel.localPort}all traffic routed through ${server}`,
202+
right: 'qualquer destino',
203+
description: `Proxy SOCKS na porta ${tunnel.localPort}todo tráfego sai por ${server}`,
204204
};
205205
}
206206
}

0 commit comments

Comments
 (0)