From 2faf3608b2ed4550ba0b4975f4de8d740d650bf2 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Fri, 15 May 2026 09:01:48 -0300 Subject: [PATCH] =?UTF-8?q?fix(cli):=20R6=20=E2=80=94=20i18n=20para=20stri?= =?UTF-8?q?ngs=20literais=20em=20logs.mjs=20e=20tunnel.mjs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Substitui 13 strings hardcoded em logs.mjs e 2 em tunnel.mjs por chamadas t() com chaves adicionadas nas locales en.json e pt-BR.json. --- bin/cli/commands/logs.mjs | 26 +++++++++++++------------- bin/cli/commands/tunnel.mjs | 6 +++--- bin/cli/locales/en.json | 7 +++++++ bin/cli/locales/pt-BR.json | 7 +++++++ 4 files changed, 30 insertions(+), 16 deletions(-) diff --git a/bin/cli/commands/logs.mjs b/bin/cli/commands/logs.mjs index cfbe930b31..6f0ecb1e7c 100644 --- a/bin/cli/commands/logs.mjs +++ b/bin/cli/commands/logs.mjs @@ -4,19 +4,19 @@ import { t } from "../i18n.mjs"; export function registerLogs(program) { program .command("logs") - .description("Stream request logs") - .option("--follow", "Stream logs in real-time") - .option("--filter ", "Filter by level (error,warn,info) — comma-separated") - .option("--lines ", "Number of lines to fetch", "100") - .option("--timeout ", "Connection timeout in ms", "30000") - .option("--base-url ", "OmniRoute API base URL", "http://localhost:20128") - .option("--request-id ", "Filter by request ID") - .option("--api-key ", "Filter by API key") - .option("--combo ", "Filter by combo name") - .option("--status ", "Filter by HTTP status code") - .option("--duration-min ", "Min request duration in ms", parseInt) - .option("--duration-max ", "Max request duration in ms", parseInt) - .option("--export ", "Save logs to file (json/jsonl/csv)") + .description(t("logs.description")) + .option("--follow", t("logs.follow")) + .option("--filter ", t("logs.filter")) + .option("--lines ", t("logs.lines"), "100") + .option("--timeout ", t("logs.timeout"), "30000") + .option("--base-url ", t("logs.baseUrl"), "http://localhost:20128") + .option("--request-id ", t("logs.requestId")) + .option("--api-key ", t("logs.apiKey")) + .option("--combo ", t("logs.combo")) + .option("--status ", t("logs.status")) + .option("--duration-min ", t("logs.durationMin"), parseInt) + .option("--duration-max ", t("logs.durationMax"), parseInt) + .option("--export ", t("logs.export")) .action(async (opts, cmd) => { const globalOpts = cmd.optsWithGlobals(); const exitCode = await runLogsCommand({ ...opts, output: globalOpts.output }); diff --git a/bin/cli/commands/tunnel.mjs b/bin/cli/commands/tunnel.mjs index 98093442a8..aa3e062151 100644 --- a/bin/cli/commands/tunnel.mjs +++ b/bin/cli/commands/tunnel.mjs @@ -9,8 +9,8 @@ export function registerTunnel(program) { tunnel .command("list") - .description("List active tunnels") - .option("--json", "Output as JSON") + .description(t("tunnel.listDescription")) + .option("--json", t("common.jsonOpt")) .action(async (opts, cmd) => { const globalOpts = cmd.parent.optsWithGlobals(); const exitCode = await runTunnelListCommand({ ...opts, output: globalOpts.output }); @@ -19,7 +19,7 @@ export function registerTunnel(program) { tunnel .command("create [type]") - .description("Create a tunnel") + .description(t("tunnel.createDescription")) .addArgument( new Argument("[type]", "Tunnel type").choices(VALID_TUNNEL_TYPES).default("cloudflare") ) diff --git a/bin/cli/locales/en.json b/bin/cli/locales/en.json index 5ba762584b..f9f7bf4a87 100644 --- a/bin/cli/locales/en.json +++ b/bin/cli/locales/en.json @@ -433,6 +433,8 @@ }, "tunnel": { "title": "Tunnels", + "listDescription": "List active tunnels", + "createDescription": "Create a tunnel", "created": "Tunnel created: {url}", "stopped": "Tunnel stopped.", "confirmStop": "Stop tunnel {id}?", @@ -1161,6 +1163,11 @@ }, "logs": { "description": "Stream or export request logs", + "follow": "Stream logs in real-time", + "filter": "Filter by level (error,warn,info) — comma-separated", + "lines": "Number of lines to fetch", + "timeout": "Connection timeout in ms", + "baseUrl": "OmniRoute API base URL", "requestId": "Filter by request ID", "apiKey": "Filter by API key", "combo": "Filter by combo name", diff --git a/bin/cli/locales/pt-BR.json b/bin/cli/locales/pt-BR.json index a157f112f2..e26db7969d 100644 --- a/bin/cli/locales/pt-BR.json +++ b/bin/cli/locales/pt-BR.json @@ -433,6 +433,8 @@ }, "tunnel": { "title": "Túneis", + "listDescription": "Listar túneis ativos", + "createDescription": "Criar um túnel", "created": "Túnel criado: {url}", "stopped": "Túnel parado.", "confirmStop": "Parar túnel {id}?", @@ -1161,6 +1163,11 @@ }, "logs": { "description": "Streaming ou exportação de logs de request", + "follow": "Transmitir logs em tempo real", + "filter": "Filtrar por nível (error,warn,info) — separados por vírgula", + "lines": "Número de linhas a buscar", + "timeout": "Timeout de conexão em ms", + "baseUrl": "URL base da API do OmniRoute", "requestId": "Filtrar por ID do request", "apiKey": "Filtrar por chave de API", "combo": "Filtrar por nome do combo",