Skip to content

Commit 22abc7b

Browse files
committed
feat(i18n): internationalize all code indexing error messages
1 parent 514eaa9 commit 22abc7b

38 files changed

+542
-57
lines changed

src/core/webview/webviewMessageHandler.ts

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as fs from "fs/promises"
55
import pWaitFor from "p-wait-for"
66
import * as vscode from "vscode"
77
import * as yaml from "yaml"
8+
import { serializeError } from "serialize-error"
89

910
import { type Language, type ProviderSettings, type GlobalState, TelemetryEventName } from "@roo-code/types"
1011
import { CloudService } from "@roo-code/cloud"
@@ -1820,8 +1821,8 @@ export const webviewMessageHandler = async (
18201821
throw new Error("Service factory not available")
18211822
}
18221823

1823-
// Test the configuration
1824-
const isValid = await serviceFactory.validateEmbedderConfig()
1824+
// Test the configuration with the UI values
1825+
const isValid = await serviceFactory.validateEmbedderConfig(message.values)
18251826

18261827
// Send test result back to webview
18271828
provider.postMessageToWebview({
@@ -1830,14 +1831,14 @@ export const webviewMessageHandler = async (
18301831
message: isValid ? "Configuration is valid" : "Configuration test failed",
18311832
})
18321833
} catch (error) {
1833-
const errorMessage = error instanceof Error ? error.message : String(error)
1834-
provider.log(`[CodeIndexManager] Configuration test error: ${errorMessage}`)
1834+
const serializedError = serializeError(error)
1835+
provider.log(`[CodeIndexManager] Configuration test error: ${serializedError.message}`)
18351836

1836-
// Send error result back to webview
1837+
// Send error result back to webview with serialized error
18371838
provider.postMessageToWebview({
18381839
type: "codebaseIndexTestResult",
18391840
success: false,
1840-
message: errorMessage,
1841+
message: serializedError.message || "Configuration test failed",
18411842
})
18421843
}
18431844
break
@@ -1864,14 +1865,17 @@ export const webviewMessageHandler = async (
18641865
await provider.codeIndexManager.initialize(provider.contextProxy)
18651866
} catch (initError) {
18661867
// Initialization failed - send error status to webview
1867-
const errorMessage = initError instanceof Error ? initError.message : String(initError)
1868-
provider.log(`[CodeIndexManager] Initialization error: ${errorMessage}`)
1868+
const serializedError = serializeError(initError)
1869+
provider.log(`[CodeIndexManager] Initialization error: ${serializedError.message}`)
18691870

1870-
// Send error status update to webview
1871+
// Send error status update to webview with serialized error details
18711872
const status = provider.codeIndexManager.getCurrentStatus()
18721873
provider.postMessageToWebview({
18731874
type: "indexingStatusUpdate",
1874-
values: status,
1875+
values: {
1876+
...status,
1877+
errorDetails: serializedError,
1878+
},
18751879
})
18761880

18771881
// Re-throw to prevent indexing attempt

src/i18n/locales/ca/embeddings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,22 @@
55
"failedWithError": "No s'han pogut crear les incrustacions després de {{attempts}} intents: {{errorMessage}}",
66
"failedMaxAttempts": "No s'han pogut crear les incrustacions després de {{attempts}} intents",
77
"textExceedsTokenLimit": "El text a l'índex {{index}} supera el límit màxim de testimonis ({{itemTokens}} > {{maxTokens}}). S'està ometent.",
8+
"textWithPrefixExceedsTokenLimit": "El text a l'índex {{index}} amb prefix supera el límit màxim de testimonis ({{estimatedTokens}} > {{maxTokens}}). S'utilitza el text original sense prefix.",
89
"rateLimitRetry": "S'ha assolit el límit de velocitat, es torna a intentar en {{delayMs}}ms (intent {{attempt}}/{{maxRetries}})",
10+
"genericError": "Error de {{provider}}: {{errorDetails}}",
11+
"validation": {
12+
"modelNotFound": "No s'ha trobat el model '{{modelId}}'. Models disponibles: {{availableModels}}",
13+
"invalidApiKey": "Clau API no vàlida. Comprova la teva clau API de {{provider}}.",
14+
"rateLimitExceeded": "S'ha superat el límit de velocitat. Torna-ho a provar més tard.",
15+
"networkError": "Error de xarxa. Comprova la teva connexió a Internet.",
16+
"configurationFailed": "Ha fallat la validació de la configuració de {{provider}}",
17+
"baseUrlRequired": "Es requereix l'URL base per a l'embedder {{provider}}",
18+
"apiKeyRequired": "Es requereix la clau API per a l'embedder {{provider}}",
19+
"endpointNotFound": "Punt final no trobat: {{baseUrl}}",
20+
"cannotConnect": "No es pot connectar a {{provider}} a {{baseUrl}}. Assegura't que {{provider}} s'està executant.",
21+
"apiNotFound": "API de {{provider}} no trobada a {{baseUrl}}. S'està executant {{provider}}?",
22+
"connectionFailed": "Ha fallat la connexió a {{provider}}: {{status}} {{statusText}}"
23+
},
924
"ollama": {
1025
"couldNotReadErrorBody": "No s'ha pogut llegir el cos de l'error",
1126
"requestFailed": "La sol·licitud de l'API d'Ollama ha fallat amb l'estat {{status}} {{statusText}}: {{errorBody}}",

src/i18n/locales/de/embeddings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,22 @@
55
"failedWithError": "Erstellung von Einbettungen nach {{attempts}} Versuchen fehlgeschlagen: {{errorMessage}}",
66
"failedMaxAttempts": "Erstellung von Einbettungen nach {{attempts}} Versuchen fehlgeschlagen",
77
"textExceedsTokenLimit": "Text bei Index {{index}} überschreitet das maximale Token-Limit ({{itemTokens}} > {{maxTokens}}). Wird übersprungen.",
8+
"textWithPrefixExceedsTokenLimit": "Text bei Index {{index}} mit Präfix überschreitet das maximale Token-Limit ({{estimatedTokens}} > {{maxTokens}}). Verwende Originaltext ohne Präfix.",
89
"rateLimitRetry": "Ratenlimit erreicht, Wiederholung in {{delayMs}}ms (Versuch {{attempt}}/{{maxRetries}})",
10+
"genericError": "{{provider}}-Fehler: {{errorDetails}}",
11+
"validation": {
12+
"modelNotFound": "Modell '{{modelId}}' nicht gefunden. Verfügbare Modelle: {{availableModels}}",
13+
"invalidApiKey": "Ungültiger API-Schlüssel. Überprüfe deinen {{provider}} API-Schlüssel.",
14+
"rateLimitExceeded": "Ratenlimit überschritten. Versuche es später erneut.",
15+
"networkError": "Netzwerkfehler. Überprüfe deine Internetverbindung.",
16+
"configurationFailed": "{{provider}}-Konfigurationsvalidierung fehlgeschlagen",
17+
"baseUrlRequired": "Basis-URL für {{provider}}-Embedder erforderlich",
18+
"apiKeyRequired": "API-Schlüssel für {{provider}}-Embedder erforderlich",
19+
"endpointNotFound": "Endpunkt nicht gefunden: {{baseUrl}}",
20+
"cannotConnect": "Kann keine Verbindung zu {{provider}} unter {{baseUrl}} herstellen. Stelle sicher, dass {{provider}} läuft.",
21+
"apiNotFound": "{{provider}} API nicht gefunden unter {{baseUrl}}. Läuft {{provider}}?",
22+
"connectionFailed": "Verbindung zu {{provider}} fehlgeschlagen: {{status}} {{statusText}}"
23+
},
924
"ollama": {
1025
"couldNotReadErrorBody": "Fehlerinhalt konnte nicht gelesen werden",
1126
"requestFailed": "Ollama API-Anfrage fehlgeschlagen mit Status {{status}} {{statusText}}: {{errorBody}}",

src/i18n/locales/en/embeddings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,22 @@
55
"failedWithError": "Failed to create embeddings after {{attempts}} attempts: {{errorMessage}}",
66
"failedMaxAttempts": "Failed to create embeddings after {{attempts}} attempts",
77
"textExceedsTokenLimit": "Text at index {{index}} exceeds maximum token limit ({{itemTokens}} > {{maxTokens}}). Skipping.",
8+
"textWithPrefixExceedsTokenLimit": "Text at index {{index}} with prefix exceeds maximum token limit ({{estimatedTokens}} > {{maxTokens}}). Using original text without prefix.",
89
"rateLimitRetry": "Rate limit hit, retrying in {{delayMs}}ms (attempt {{attempt}}/{{maxRetries}})",
10+
"genericError": "{{provider}} error: {{errorDetails}}",
11+
"validation": {
12+
"modelNotFound": "Model '{{modelId}}' not found. Available models: {{availableModels}}",
13+
"invalidApiKey": "Invalid API key. Please check your {{provider}} API key.",
14+
"rateLimitExceeded": "Rate limit exceeded. Please try again later.",
15+
"networkError": "Network error. Please check your internet connection.",
16+
"configurationFailed": "Failed to validate {{provider}} configuration",
17+
"baseUrlRequired": "Base URL is required for {{provider}} embedder",
18+
"apiKeyRequired": "API key is required for {{provider}} embedder",
19+
"endpointNotFound": "Endpoint not found: {{baseUrl}}",
20+
"cannotConnect": "Cannot connect to {{provider}} at {{baseUrl}}. Please ensure {{provider}} is running.",
21+
"apiNotFound": "{{provider}} API not found at {{baseUrl}}. Is {{provider}} running?",
22+
"connectionFailed": "Failed to connect to {{provider}}: {{status}} {{statusText}}"
23+
},
924
"ollama": {
1025
"couldNotReadErrorBody": "Could not read error body",
1126
"requestFailed": "Ollama API request failed with status {{status}} {{statusText}}: {{errorBody}}",

src/i18n/locales/es/embeddings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,22 @@
55
"failedWithError": "No se pudieron crear las incrustaciones después de {{attempts}} intentos: {{errorMessage}}",
66
"failedMaxAttempts": "No se pudieron crear las incrustaciones después de {{attempts}} intentos",
77
"textExceedsTokenLimit": "El texto en el índice {{index}} supera el límite máximo de tokens ({{itemTokens}} > {{maxTokens}}). Omitiendo.",
8+
"textWithPrefixExceedsTokenLimit": "El texto en el índice {{index}} con prefijo supera el límite máximo de tokens ({{estimatedTokens}} > {{maxTokens}}). Usando texto original sin prefijo.",
89
"rateLimitRetry": "Límite de velocidad alcanzado, reintentando en {{delayMs}}ms (intento {{attempt}}/{{maxRetries}})",
10+
"genericError": "Error de {{provider}}: {{errorDetails}}",
11+
"validation": {
12+
"modelNotFound": "Modelo '{{modelId}}' no encontrado. Modelos disponibles: {{availableModels}}",
13+
"invalidApiKey": "Clave API inválida. Verifica tu clave API de {{provider}}.",
14+
"rateLimitExceeded": "Límite de velocidad excedido. Intenta de nuevo más tarde.",
15+
"networkError": "Error de red. Verifica tu conexión a Internet.",
16+
"configurationFailed": "Falló la validación de configuración de {{provider}}",
17+
"baseUrlRequired": "Se requiere URL base para el embedder {{provider}}",
18+
"apiKeyRequired": "Se requiere clave API para el embedder {{provider}}",
19+
"endpointNotFound": "Punto final no encontrado: {{baseUrl}}",
20+
"cannotConnect": "No se puede conectar a {{provider}} en {{baseUrl}}. Asegúrate de que {{provider}} esté ejecutándose.",
21+
"apiNotFound": "API de {{provider}} no encontrada en {{baseUrl}}. ¿Está ejecutándose {{provider}}?",
22+
"connectionFailed": "Falló la conexión a {{provider}}: {{status}} {{statusText}}"
23+
},
924
"ollama": {
1025
"couldNotReadErrorBody": "No se pudo leer el cuerpo del error",
1126
"requestFailed": "La solicitud de la API de Ollama falló con estado {{status}} {{statusText}}: {{errorBody}}",

src/i18n/locales/fr/embeddings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,22 @@
55
"failedWithError": "Échec de la création des embeddings après {{attempts}} tentatives : {{errorMessage}}",
66
"failedMaxAttempts": "Échec de la création des embeddings après {{attempts}} tentatives",
77
"textExceedsTokenLimit": "Le texte à l'index {{index}} dépasse la limite maximale de tokens ({{itemTokens}} > {{maxTokens}}). Ignoré.",
8+
"textWithPrefixExceedsTokenLimit": "Le texte à l'index {{index}} avec préfixe dépasse la limite maximale de tokens ({{estimatedTokens}} > {{maxTokens}}). Utilisation du texte original sans préfixe.",
89
"rateLimitRetry": "Limite de débit atteinte, nouvelle tentative dans {{delayMs}}ms (tentative {{attempt}}/{{maxRetries}})",
10+
"genericError": "Erreur {{provider}} : {{errorDetails}}",
11+
"validation": {
12+
"modelNotFound": "Modèle '{{modelId}}' introuvable. Modèles disponibles : {{availableModels}}",
13+
"invalidApiKey": "Clé API invalide. Vérifie ta clé API {{provider}}.",
14+
"rateLimitExceeded": "Limite de débit dépassée. Réessaye plus tard.",
15+
"networkError": "Erreur réseau. Vérifie ta connexion Internet.",
16+
"configurationFailed": "Échec de la validation de la configuration {{provider}}",
17+
"baseUrlRequired": "URL de base requise pour l'embedder {{provider}}",
18+
"apiKeyRequired": "Clé API requise pour l'embedder {{provider}}",
19+
"endpointNotFound": "Point de terminaison introuvable : {{baseUrl}}",
20+
"cannotConnect": "Impossible de se connecter à {{provider}} à {{baseUrl}}. Assure-toi que {{provider}} est en cours d'exécution.",
21+
"apiNotFound": "API {{provider}} introuvable à {{baseUrl}}. {{provider}} est-il en cours d'exécution ?",
22+
"connectionFailed": "Échec de la connexion à {{provider}} : {{status}} {{statusText}}"
23+
},
924
"ollama": {
1025
"couldNotReadErrorBody": "Impossible de lire le corps de l'erreur",
1126
"requestFailed": "Échec de la requête API Ollama avec le statut {{status}} {{statusText}} : {{errorBody}}",

src/i18n/locales/hi/embeddings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,22 @@
55
"failedWithError": "{{attempts}} प्रयासों के बाद एम्बेडिंग बनाने में विफल: {{errorMessage}}",
66
"failedMaxAttempts": "{{attempts}} प्रयासों के बाद एम्बेडिंग बनाने में विफल",
77
"textExceedsTokenLimit": "अनुक्रमणिका {{index}} पर पाठ अधिकतम टोकन सीमा ({{itemTokens}} > {{maxTokens}}) से अधिक है। छोड़ा जा रहा है।",
8+
"textWithPrefixExceedsTokenLimit": "उपसर्ग के साथ अनुक्रमणिका {{index}} पर पाठ अधिकतम टोकन सीमा ({{estimatedTokens}} > {{maxTokens}}) से अधिक है। उपसर्ग के बिना मूल पाठ का उपयोग कर रहे हैं।",
89
"rateLimitRetry": "दर सीमा समाप्त, {{delayMs}}ms में पुन: प्रयास किया जा रहा है (प्रयास {{attempt}}/{{maxRetries}})",
10+
"genericError": "{{provider}} त्रुटि: {{errorDetails}}",
11+
"validation": {
12+
"modelNotFound": "मॉडल '{{modelId}}' नहीं मिला। उपलब्ध मॉडल: {{availableModels}}",
13+
"invalidApiKey": "अमान्य API कुंजी। अपनी {{provider}} API कुंजी की जांच करें।",
14+
"rateLimitExceeded": "दर सीमा पार हो गई। बाद में पुनः प्रयास करें।",
15+
"networkError": "नेटवर्क त्रुटि। अपना इंटरनेट कनेक्शन जांचें।",
16+
"configurationFailed": "{{provider}} कॉन्फ़िगरेशन सत्यापन विफल",
17+
"baseUrlRequired": "{{provider}} एम्बेडर के लिए आधार URL आवश्यक है",
18+
"apiKeyRequired": "{{provider}} एम्बेडर के लिए API कुंजी आवश्यक है",
19+
"endpointNotFound": "एंडपॉइंट नहीं मिला: {{baseUrl}}",
20+
"cannotConnect": "{{baseUrl}} पर {{provider}} से कनेक्ट नहीं हो सकता। सुनिश्चित करें कि {{provider}} चल रहा है।",
21+
"apiNotFound": "{{baseUrl}} पर {{provider}} API नहीं मिला। क्या {{provider}} चल रहा है?",
22+
"connectionFailed": "{{provider}} से कनेक्शन विफल: {{status}} {{statusText}}"
23+
},
924
"ollama": {
1025
"couldNotReadErrorBody": "त्रुटि सामग्री पढ़ नहीं सका",
1126
"requestFailed": "Ollama API अनुरोध स्थिति {{status}} {{statusText}} के साथ विफल: {{errorBody}}",

src/i18n/locales/id/embeddings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,22 @@
55
"failedWithError": "Gagal membuat embeddings setelah {{attempts}} percobaan: {{errorMessage}}",
66
"failedMaxAttempts": "Gagal membuat embeddings setelah {{attempts}} percobaan",
77
"textExceedsTokenLimit": "Teks pada indeks {{index}} melebihi batas maksimum token ({{itemTokens}} > {{maxTokens}}). Dilewati.",
8+
"textWithPrefixExceedsTokenLimit": "Teks pada indeks {{index}} dengan prefix melebihi batas maksimum token ({{estimatedTokens}} > {{maxTokens}}). Menggunakan teks asli tanpa prefix.",
89
"rateLimitRetry": "Batas rate tercapai, mencoba lagi dalam {{delayMs}}ms (percobaan {{attempt}}/{{maxRetries}})",
10+
"genericError": "Error {{provider}}: {{errorDetails}}",
11+
"validation": {
12+
"modelNotFound": "Model '{{modelId}}' tidak ditemukan. Model yang tersedia: {{availableModels}}",
13+
"invalidApiKey": "Kunci API tidak valid. Periksa kunci API {{provider}} kamu.",
14+
"rateLimitExceeded": "Batas rate terlampaui. Coba lagi nanti.",
15+
"networkError": "Error jaringan. Periksa koneksi internet kamu.",
16+
"configurationFailed": "Validasi konfigurasi {{provider}} gagal",
17+
"baseUrlRequired": "URL dasar diperlukan untuk embedder {{provider}}",
18+
"apiKeyRequired": "Kunci API diperlukan untuk embedder {{provider}}",
19+
"endpointNotFound": "Endpoint tidak ditemukan: {{baseUrl}}",
20+
"cannotConnect": "Tidak dapat terhubung ke {{provider}} di {{baseUrl}}. Pastikan {{provider}} sedang berjalan.",
21+
"apiNotFound": "API {{provider}} tidak ditemukan di {{baseUrl}}. Apakah {{provider}} sedang berjalan?",
22+
"connectionFailed": "Koneksi ke {{provider}} gagal: {{status}} {{statusText}}"
23+
},
924
"ollama": {
1025
"couldNotReadErrorBody": "Tidak dapat membaca body error",
1126
"requestFailed": "Permintaan API Ollama gagal dengan status {{status}} {{statusText}}: {{errorBody}}",

src/i18n/locales/it/embeddings.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,22 @@
55
"failedWithError": "Creazione degli embedding non riuscita dopo {{attempts}} tentativi: {{errorMessage}}",
66
"failedMaxAttempts": "Creazione degli embedding non riuscita dopo {{attempts}} tentativi",
77
"textExceedsTokenLimit": "Il testo all'indice {{index}} supera il limite massimo di token ({{itemTokens}} > {{maxTokens}}). Saltato.",
8+
"textWithPrefixExceedsTokenLimit": "Il testo all'indice {{index}} con prefisso supera il limite massimo di token ({{estimatedTokens}} > {{maxTokens}}). Utilizzo del testo originale senza prefisso.",
89
"rateLimitRetry": "Limite di velocità raggiunto, nuovo tentativo tra {{delayMs}}ms (tentativo {{attempt}}/{{maxRetries}})",
10+
"genericError": "Errore {{provider}}: {{errorDetails}}",
11+
"validation": {
12+
"modelNotFound": "Modello '{{modelId}}' non trovato. Modelli disponibili: {{availableModels}}",
13+
"invalidApiKey": "Chiave API non valida. Controlla la tua chiave API {{provider}}.",
14+
"rateLimitExceeded": "Limite di velocità superato. Riprova più tardi.",
15+
"networkError": "Errore di rete. Controlla la tua connessione Internet.",
16+
"configurationFailed": "Validazione della configurazione {{provider}} fallita",
17+
"baseUrlRequired": "URL di base richiesto per l'embedder {{provider}}",
18+
"apiKeyRequired": "Chiave API richiesta per l'embedder {{provider}}",
19+
"endpointNotFound": "Endpoint non trovato: {{baseUrl}}",
20+
"cannotConnect": "Impossibile connettersi a {{provider}} su {{baseUrl}}. Assicurati che {{provider}} sia in esecuzione.",
21+
"apiNotFound": "API {{provider}} non trovata su {{baseUrl}}. {{provider}} è in esecuzione?",
22+
"connectionFailed": "Connessione a {{provider}} fallita: {{status}} {{statusText}}"
23+
},
924
"ollama": {
1025
"couldNotReadErrorBody": "Impossibile leggere il corpo dell'errore",
1126
"requestFailed": "Richiesta API Ollama fallita con stato {{status}} {{statusText}}: {{errorBody}}",

0 commit comments

Comments
 (0)