refactor(callbackServer): added in i18n translations

This commit is contained in:
Elliott de Launay 2026-03-24 22:22:02 -04:00
parent 4152d0fc31
commit b6dfa7556b
No known key found for this signature in database
GPG key ID: BB899BED766D1806
19 changed files with 255 additions and 23 deletions

View file

@ -24,5 +24,18 @@
"refreshing_all": "Actualitzant tots els servidors MCP...",
"all_refreshed": "Tots els servidors MCP han estat actualitzats.",
"project_config_deleted": "Fitxer de configuració MCP del projecte eliminat. Tots els servidors MCP del projecte han estat desconnectats."
},
"oauth": {
"callback": {
"title": "OAuth Callback - Roo Code",
"success": "Success!",
"failed": "Failed",
"auth_failed": "Authentication failed. Please check the MCP server logs.",
"auth_success": "MCP server authenticated successfully. You can now close this browser tab.",
"server_connection_complete": "The server connection is complete.",
"tab_closing_in": "This tab will attempt to close in <span id=\"count\">{{count}}</span>s...",
"safe_to_close": "If the tab did not close, you can safely close it manually.",
"invalid_state": "Error: Invalid state parameter"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "Alle MCP-Server werden aktualisiert...",
"all_refreshed": "Alle MCP-Server wurden aktualisiert.",
"project_config_deleted": "Projekt-MCP-Konfigurationsdatei gelöscht. Alle Projekt-MCP-Server wurden getrennt."
},
"oauth": {
"callback": {
"title": "OAuth Callback - Roo Code",
"success": "Erfolg!",
"failed": "Fehlgeschlagen",
"auth_failed": "Authentifizierung fehlgeschlagen. Bitte überprüfe die MCP-Server-Logs.",
"auth_success": "MCP-Server erfolgreich authentifiziert. Du kannst diesen Browser-Tab jetzt schließen.",
"server_connection_complete": "Die Serververbindung ist abgeschlossen.",
"tab_closing_in": "Dieser Tab wird in <span id=\"count\">{{count}}</span>s geschlossen...",
"safe_to_close": "Falls sich der Tab nicht automatisch geschlossen hat, kannst du ihn jetzt manuell schließen.",
"invalid_state": "Fehler: Ungültiger State-Parameter"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "Refreshing all MCP servers...",
"all_refreshed": "All MCP servers have been refreshed.",
"project_config_deleted": "Project MCP configuration file deleted. All project MCP servers have been disconnected."
},
"oauth": {
"callback": {
"title": "OAuth Callback - Roo Code",
"success": "Success!",
"failed": "Failed",
"auth_failed": "Authentication failed. Please check the MCP server logs.",
"auth_success": "MCP server authenticated successfully. You can now close this browser tab.",
"server_connection_complete": "The server connection is complete.",
"tab_closing_in": "This tab will attempt to close in <span id=\"count\">{{count}}</span>s...",
"safe_to_close": "If the tab did not close, you can safely close it manually.",
"invalid_state": "Error: Invalid state parameter"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "Actualizando todos los servidores MCP...",
"all_refreshed": "Todos los servidores MCP han sido actualizados.",
"project_config_deleted": "Archivo de configuración MCP del proyecto eliminado. Todos los servidores MCP del proyecto han sido desconectados."
},
"oauth": {
"callback": {
"title": "OAuth Callback - Roo Code",
"success": "¡Éxito!",
"failed": "Fallido",
"auth_failed": "La autenticación falló. Por favor, comprueba los registros del servidor MCP.",
"auth_success": "Servidor MCP autenticado con éxito. Ya puedes cerrar esta pestaña del navegador.",
"server_connection_complete": "La conexión con el servidor se ha completado.",
"tab_closing_in": "Esta pestaña intentará cerrarse en <span id=\"count\">{{count}}</span>s...",
"safe_to_close": "Si la pestaña no se cerró, puedes cerrarla manualmente de forma segura.",
"invalid_state": "Error: Parámetro de estado no válido"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "Rafraîchissement de tous les serveurs MCP...",
"all_refreshed": "Tous les serveurs MCP ont été rafraîchis.",
"project_config_deleted": "Fichier de configuration MCP du projet supprimé. Tous les serveurs MCP du projet ont été déconnectés."
},
"oauth": {
"callback": {
"title": "Rappel OAuth - Roo Code",
"success": "Succès !",
"failed": "Échec",
"auth_failed": "L'authentification a échoué. Veuillez vérifier les journaux du serveur MCP.",
"auth_success": "Le serveur MCP a été authentifié avec succès. Vous pouvez maintenant fermer cet onglet de navigateur.",
"server_connection_complete": "La connexion au serveur est terminée.",
"tab_closing_in": "Cet onglet tentera de se fermer dans <span id=\"count\">{{count}}</span>s...",
"safe_to_close": "Si l'onglet ne s'est pas fermé, vous pouvez le fermer manuellement en toute sécurité.",
"invalid_state": "Erreur : Paramètre d'état invalide"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "सभी एमसीपी सर्वर रीफ्रेश हो रहे हैं...",
"all_refreshed": "सभी एमसीपी सर्वर रीफ्रेश हो गए हैं।",
"project_config_deleted": "प्रोजेक्ट एमसीपी कॉन्फ़िगरेशन फ़ाइल हटा दी गई है। सभी प्रोजेक्ट एमसीपी सर्वर डिस्कनेक्ट कर दिए गए हैं।"
},
"oauth": {
"callback": {
"title": "OAuth कॉलबैक - Roo Code",
"success": "सफलता!",
"failed": "विफल",
"auth_failed": "प्रमाणीकरण विफल रहा। कृपया MCP सर्वर लॉग की जाँच करें।",
"auth_success": "MCP सर्वर सफलतापूर्वक प्रमाणित हो गया। अब आप इस ब्राउज़र टैब को बंद कर सकते हैं।",
"server_connection_complete": "सर्वर कनेक्शन पूरा हो गया है।",
"tab_closing_in": "यह टैब <span id=\"count\">{{count}}</span> सेकंड में बंद होने का प्रयास करेगा...",
"safe_to_close": "यदि टैब बंद नहीं हुआ, तो आप इसे सुरक्षित रूप से मैन्युअल रूप से बंद कर सकते हैं।",
"invalid_state": "त्रुटि: अमान्य स्थिति पैरामीटर"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "Me-refresh semua server MCP...",
"all_refreshed": "Semua server MCP telah di-refresh.",
"project_config_deleted": "File konfigurasi MCP proyek dihapus. Semua server MCP proyek telah diputus koneksinya."
},
"oauth": {
"callback": {
"title": "Callback OAuth - Roo Code",
"success": "Berhasil!",
"failed": "Gagal",
"auth_failed": "Autentikasi gagal. Silakan periksa log server MCP.",
"auth_success": "Server MCP berhasil diautentikasi. Anda sekarang dapat menutup tab browser ini.",
"server_connection_complete": "Koneksi server selesai.",
"tab_closing_in": "Tab ini akan mencoba menutup dalam <span id=\"count\">{{count}}</span> detik...",
"safe_to_close": "Jika tab tidak tertutup, Anda dapat menutupnya secara manual dengan aman.",
"invalid_state": "Kesalahan: Parameter state tidak valid"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "Aggiornamento di tutti i server MCP...",
"all_refreshed": "Tutti i server MCP sono stati aggiornati.",
"project_config_deleted": "File di configurazione MCP del progetto eliminato. Tutti i server MCP del progetto sono stati disconnessi."
},
"oauth": {
"callback": {
"title": "Callback OAuth - Roo Code",
"success": "Successo!",
"failed": "Fallito",
"auth_failed": "Autenticazione fallita. Controlla i log del server MCP.",
"auth_success": "Server MCP autenticato con successo. Ora puoi chiudere questa scheda del browser.",
"server_connection_complete": "La connessione al server è completa.",
"tab_closing_in": "Questa scheda tenterà di chiudersi tra <span id=\"count\">{{count}}</span>s...",
"safe_to_close": "Se la scheda non si è chiusa, puoi chiuderla manualmente in sicurezza.",
"invalid_state": "Errore: Parametro di stato non valido"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "すべてのMCPサーバーを更新しています...",
"all_refreshed": "すべてのMCPサーバーが更新されました。",
"project_config_deleted": "プロジェクトMCP設定ファイルが削除されました。すべてのプロジェクトMCPサーバーが切断されました。"
},
"oauth": {
"callback": {
"title": "OAuth コールバック - Roo Code",
"success": "成功!",
"failed": "失敗",
"auth_failed": "認証に失敗しました。MCP サーバーのログを確認してください。",
"auth_success": "MCP サーバーの認証に成功しました。このブラウザタブを閉じても構いません。",
"server_connection_complete": "サーバー接続が完了しました。",
"tab_closing_in": "このタブは <span id=\"count\">{{count}}</span> 秒後に閉じられます...",
"safe_to_close": "タブが閉じなかった場合は、手動で閉じてください。",
"invalid_state": "エラー: 無効な state パラメータ"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "모든 MCP 서버를 새로 고치는 중...",
"all_refreshed": "모든 MCP 서버가 새로 고쳐졌습니다.",
"project_config_deleted": "프로젝트 MCP 구성 파일이 삭제되었습니다. 모든 프로젝트 MCP 서버가 연결 해제되었습니다."
},
"oauth": {
"callback": {
"title": "OAuth 콜백 - Roo Code",
"success": "성공!",
"failed": "실패",
"auth_failed": "인증에 실패했습니다. MCP 서버 로그를 확인해 주세요.",
"auth_success": "MCP 서버 인증에 성공했습니다. 이제 이 브라우저 탭을 닫으셔도 됩니다.",
"server_connection_complete": "서버 연결이 완료되었습니다.",
"tab_closing_in": "이 탭은 <span id=\"count\">{{count}}</span>초 후에 닫힙니다...",
"safe_to_close": "탭이 자동으로 닫히지 않으면 직접 닫아주세요.",
"invalid_state": "오류: 유효하지 않은 state 파라미터"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "Alle MCP-servers worden vernieuwd...",
"all_refreshed": "Alle MCP-servers zijn vernieuwd.",
"project_config_deleted": "Project MCP-configuratiebestand verwijderd. Alle project MCP-servers zijn losgekoppeld."
},
"oauth": {
"callback": {
"title": "OAuth Callback - Roo Code",
"success": "Succes!",
"failed": "Mislukt",
"auth_failed": "Authenticatie mislukt. Controleer de MCP-serverlogs.",
"auth_success": "MCP-server succesvol geauthenticeerd. Je kunt dit browsertabblad nu sluiten.",
"server_connection_complete": "De serververbinding is voltooid.",
"tab_closing_in": "Dit tabblad wordt gesloten over <span id=\"count\">{{count}}</span>s...",
"safe_to_close": "Als het tabblad niet is gesloten, kun je het handmatig sluiten.",
"invalid_state": "Fout: Ongeldige state-parameter"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "Odświeżanie wszystkich serwerów MCP...",
"all_refreshed": "Wszystkie serwery MCP zostały odświeżone.",
"project_config_deleted": "Plik konfiguracyjny MCP projektu został usunięty. Wszystkie serwery MCP projektu zostały odłączone."
},
"oauth": {
"callback": {
"title": "Wywołanie zwrotne OAuth - Roo Code",
"success": "Sukces!",
"failed": "Niepowodzenie",
"auth_failed": "Uwierzytelnianie nie powiodło się. Sprawdź dzienniki serwera MCP.",
"auth_success": "Serwer MCP został pomyślnie uwierzytelniony. Możesz teraz zamknąć tę kartę przeglądarki.",
"server_connection_complete": "Połączenie z serwerem zostało zakończone.",
"tab_closing_in": "Ta karta spróbuje się zamknąć za <span id=\"count\">{{count}}</span>s...",
"safe_to_close": "Jeśli karta nie zamknęła się automatycznie, możesz ją bezpiecznie zamknąć ręcznie.",
"invalid_state": "Błąd: Nieprawidłowy parametr stanu"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "Atualizando todos os servidores MCP...",
"all_refreshed": "Todos os servidores MCP foram atualizados.",
"project_config_deleted": "Arquivo de configuração MCP do projeto excluído. Todos os servidores MCP do projeto foram desconectados."
},
"oauth": {
"callback": {
"title": "Callback OAuth - Roo Code",
"success": "Sucesso!",
"failed": "Falhou",
"auth_failed": "A autenticação falhou. Verifique os logs do servidor MCP.",
"auth_success": "Servidor MCP autenticado com sucesso. Você já pode fechar esta aba do navegador.",
"server_connection_complete": "A conexão com o servidor foi concluída.",
"tab_closing_in": "Esta aba tentará fechar em <span id=\"count\">{{count}}</span>s...",
"safe_to_close": "Se a aba não fechar, você pode fechá-la manualmente com segurança.",
"invalid_state": "Erro: Parâmetro de estado inválido"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "Обновление всех MCP серверов...",
"all_refreshed": "Все MCP серверы обновлены.",
"project_config_deleted": "Файл конфигурации MCP проекта удален. Все MCP серверы проекта отключены."
},
"oauth": {
"callback": {
"title": "OAuth Callback - Roo Code",
"success": "Успешно!",
"failed": "Ошибка",
"auth_failed": "Ошибка аутентификации. Пожалуйста, проверьте логи MCP-сервера.",
"auth_success": "MCP-сервер успешно аутентифицирован. Теперь вы можете закрыть эту вкладку браузера.",
"server_connection_complete": "Подключение к серверу завершено.",
"tab_closing_in": "Эта вкладка попытается закрыться через <span id=\"count\">{{count}}</span> сек...",
"safe_to_close": "Если вкладка не закрылась, вы можете закрыть ее вручную.",
"invalid_state": "Ошибка: Недопустимый параметр состояния"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "Tüm MCP sunucuları yenileniyor...",
"all_refreshed": "Tüm MCP sunucuları yenilendi.",
"project_config_deleted": "Proje MCP yapılandırma dosyası silindi. Tüm proje MCP sunucuları bağlantısı kesildi."
},
"oauth": {
"callback": {
"title": "OAuth Geri Çağırma - Roo Code",
"success": "Başarılı!",
"failed": "Başarısız",
"auth_failed": "Kimlik doğrulama başarısız oldu. Lütfen MCP sunucu günlüklerini kontrol edin.",
"auth_success": "MCP sunucusu başarıyla doğrulandı. Artık bu tarayıcı sekmesini kapatabilirsiniz.",
"server_connection_complete": "Sunucu bağlantısı tamamlandı.",
"tab_closing_in": "Bu sekme <span id=\"count\">{{count}}</span> saniye içinde kapanmaya çalışacak...",
"safe_to_close": "Sekme kapanmadıysa, manuel olarak güvenle kapatabilirsiniz.",
"invalid_state": "Hata: Geçersiz durum parametresi"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "Đang làm mới tất cả các máy chủ MCP...",
"all_refreshed": "Tất cả các máy chủ MCP đã được làm mới.",
"project_config_deleted": "Tệp cấu hình MCP của dự án đã bị xóa. Tất cả các máy chủ MCP của dự án đã bị ngắt kết nối."
},
"oauth": {
"callback": {
"title": "OAuth Callback - Roo Code",
"success": "Thành công!",
"failed": "Thất bại",
"auth_failed": "Xác thực thất bại. Vui lòng kiểm tra nhật ký máy chủ MCP.",
"auth_success": "Máy chủ MCP đã được xác thực thành công. Bây giờ bạn có thể đóng tab trình duyệt này.",
"server_connection_complete": "Kết nối máy chủ đã hoàn tất.",
"tab_closing_in": "Tab này sẽ cố gắng đóng sau <span id=\"count\">{{count}}</span> giây...",
"safe_to_close": "Nếu tab không đóng, bạn có thể đóng nó một cách thủ công an toàn.",
"invalid_state": "Lỗi: Tham số trạng thái không hợp lệ"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "正在刷新所有 MCP 服务器...",
"all_refreshed": "所有 MCP 服务器已刷新。",
"project_config_deleted": "项目MCP配置文件已删除。所有项目MCP服务器已断开连接。"
},
"oauth": {
"callback": {
"title": "OAuth 回调 - Roo Code",
"success": "成功!",
"failed": "失败",
"auth_failed": "身份验证失败。请检查 MCP 服务器日志。",
"auth_success": "MCP 服务器身份验证成功。您现在可以关闭此浏览器标签页。",
"server_connection_complete": "服务器连接已完成。",
"tab_closing_in": "此标签页将在 <span id=\"count\">{{count}}</span> 秒后尝试关闭...",
"safe_to_close": "如果标签页没有关闭,您可以安全地手动关闭它。",
"invalid_state": "错误:无效的状态参数"
}
}
}

View file

@ -24,5 +24,18 @@
"refreshing_all": "正在重新整理所有 MCP 伺服器...",
"all_refreshed": "所有 MCP 伺服器已重新整理。",
"project_config_deleted": "專案MCP設定檔案已刪除。所有專案MCP伺服器已斷開連接。"
},
"oauth": {
"callback": {
"title": "OAuth 回呼 - Roo Code",
"success": "成功!",
"failed": "失敗",
"auth_failed": "身分驗證失敗。請檢查 MCP 伺服器日誌。",
"auth_success": "MCP 伺服器身分驗證成功。您現在可以關閉此瀏覽器分頁。",
"server_connection_complete": "伺服器連接已完成。",
"tab_closing_in": "此分頁將在 <span id=\"count\">{{count}}</span> 秒後嘗試關閉...",
"safe_to_close": "如果分頁沒有關閉,您可以安全地手動關閉它。",
"invalid_state": "錯誤:無效的狀態參數"
}
}
}

View file

@ -1,4 +1,5 @@
import * as http from "http"
import { t } from "../../../i18n"
export interface CallbackResult {
code?: string
@ -73,22 +74,23 @@ export function startCallbackServer(
const error = url.searchParams.get("error")
const errorDescription = url.searchParams.get("error_description")
const state = url.searchParams.get("state")
const hasError = !!error
// Verify state for CSRF protection
if (expectedState && state !== expectedState) {
res.writeHead(400, { "Content-Type": "text/html" })
res.end(`
<!DOCTYPE html>
<html>
<head>
<title>OAuth Callback</title>
</head>
<body>
<h1>OAuth Authentication Failed</h1>
<p>Error: Invalid state parameter</p>
</body>
</html>
`)
<!DOCTYPE html>
<html>
<head>
<title>${t("mcp:oauth.callback.title")}</title>
</head>
<body>
<h1>${t("mcp:oauth.callback.failed")}</h1>
<p>${t("mcp:oauth.callback.invalid_state")}</p>
</body>
</html>
`)
rejectResult(new Error("Invalid state parameter"))
return
}
@ -99,7 +101,7 @@ export function startCallbackServer(
<!DOCTYPE html>
<html>
<head>
<title>OAuth Callback - Roo Code</title>
<title>${t("mcp:oauth.callback.title")}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; max-width: 400px; margin: 50px auto; text-align: center; padding: 20px; }
@ -112,24 +114,20 @@ export function startCallbackServer(
</style>
</head>
<body>
<h1 id="title">${error ? "Failed" : "Success!"}</h1>
<div class="spinner" id="spinner" style="${error ? "display:none;" : ""}"></div>
<h1 id="title">${hasError ? t("mcp:oauth.callback.failed") : t("mcp:oauth.callback.success")}</h1>
<div class="spinner" id="spinner" style="${hasError ? "display:none;" : ""}"></div>
<p id="message">
${
error
? "Authentication failed. Please check the MCP server logs."
: "MCP server authenticated successfully. You can now close this browser tab."
}
${hasError ? t("mcp:oauth.callback.auth_failed") : t("mcp:oauth.callback.auth_success")}
</p>
<div id="countdown" class="countdown" style="${error ? "display:none;" : ""}">The server connection is complete.</div>
<div id="countdown" class="countdown" style="${hasError ? "display:none;" : ""}">${t("mcp:oauth.callback.server_connection_complete")}</div>
<script>
const isError = ${error ? "true" : "false"};
const isError = ${hasError ? "true" : "false"};
if (!isError) {
let count = 5;
const countEl = document.getElementById('count');
const countdownEl = document.getElementById('countdown');
if (countdownEl) {
countdownEl.innerHTML = 'This tab will attempt to close in <span id="count">5</span>s...';
countdownEl.innerHTML = \`${t("mcp:oauth.callback.tab_closing_in", { count: 5 })}\`;
}
const timer = setInterval(() => {
count--;
@ -139,7 +137,7 @@ export function startCallbackServer(
clearInterval(timer);
window.close();
if (countdownEl) {
countdownEl.textContent = 'If the tab did not close, you can safely close it manually.';
countdownEl.textContent = \`${t("mcp:oauth.callback.safe_to_close")}\`;
}
}
}, 1000);