Skip to content

Commit b62bb38

Browse files
committed
feat: add localization for similarity score tooltip in codebase search results
1 parent e10eb0a commit b62bb38

File tree

19 files changed

+40
-19
lines changed

19 files changed

+40
-19
lines changed

webview-ui/src/components/chat/CodebaseSearchResult.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React from "react"
2+
import { useTranslation } from "react-i18next"
23
import { vscode } from "@src/utils/vscode"
34
import { StandardTooltip } from "@/components/ui"
45

@@ -12,6 +13,8 @@ interface CodebaseSearchResultProps {
1213
}
1314

1415
const CodebaseSearchResult: React.FC<CodebaseSearchResultProps> = ({ filePath, score, startLine, endLine }) => {
16+
const { t } = useTranslation("chat")
17+
1518
const handleClick = () => {
1619
console.log(filePath)
1720
vscode.postMessage({
@@ -24,7 +27,7 @@ const CodebaseSearchResult: React.FC<CodebaseSearchResultProps> = ({ filePath, s
2427
}
2528

2629
return (
27-
<StandardTooltip content={`Similarity score: ${score.toFixed(3)} (click to open file)`}>
30+
<StandardTooltip content={t("codebaseSearch.resultTooltip", { score: score.toFixed(3) })}>
2831
<div
2932
onClick={handleClick}
3033
className="mb-1 p-2 border border-primary rounded cursor-pointer hover:bg-secondary hover:text-white">

webview-ui/src/i18n/locales/ca/chat.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@
294294
"codebaseSearch": {
295295
"wantsToSearch": "Roo vol cercar a la base de codi <code>{{query}}</code>:",
296296
"wantsToSearchWithPath": "Roo vol cercar a la base de codi <code>{{query}}</code> a <code>{{path}}</code>:",
297-
"didSearch": "S'han trobat {{count}} resultat(s) per a <code>{{query}}</code>:"
297+
"didSearch": "S'han trobat {{count}} resultat(s) per a <code>{{query}}</code>:",
298+
"resultTooltip": "Puntuació de similitud: {{score}} (fes clic per obrir el fitxer)"
298299
},
299300
"read-batch": {
300301
"approve": {

webview-ui/src/i18n/locales/de/chat.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@
294294
"codebaseSearch": {
295295
"wantsToSearch": "Roo möchte den Codebase nach <code>{{query}}</code> durchsuchen:",
296296
"wantsToSearchWithPath": "Roo möchte den Codebase nach <code>{{query}}</code> in <code>{{path}}</code> durchsuchen:",
297-
"didSearch": "{{count}} Ergebnis(se) für <code>{{query}}</code> gefunden:"
297+
"didSearch": "{{count}} Ergebnis(se) für <code>{{query}}</code> gefunden:",
298+
"resultTooltip": "Ähnlichkeitswert: {{score}} (klicken zum Öffnen der Datei)"
298299
},
299300
"read-batch": {
300301
"approve": {

webview-ui/src/i18n/locales/en/chat.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,8 @@
201201
"codebaseSearch": {
202202
"wantsToSearch": "Roo wants to search the codebase for <code>{{query}}</code>:",
203203
"wantsToSearchWithPath": "Roo wants to search the codebase for <code>{{query}}</code> in <code>{{path}}</code>:",
204-
"didSearch": "Found {{count}} result(s) for <code>{{query}}</code>:"
204+
"didSearch": "Found {{count}} result(s) for <code>{{query}}</code>:",
205+
"resultTooltip": "Similarity score: {{score}} (click to open file)"
205206
},
206207
"commandOutput": "Command Output",
207208
"response": "Response",

webview-ui/src/i18n/locales/es/chat.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@
294294
"codebaseSearch": {
295295
"wantsToSearch": "Roo quiere buscar en la base de código <code>{{query}}</code>:",
296296
"wantsToSearchWithPath": "Roo quiere buscar en la base de código <code>{{query}}</code> en <code>{{path}}</code>:",
297-
"didSearch": "Se encontraron {{count}} resultado(s) para <code>{{query}}</code>:"
297+
"didSearch": "Se encontraron {{count}} resultado(s) para <code>{{query}}</code>:",
298+
"resultTooltip": "Puntuación de similitud: {{score}} (haz clic para abrir el archivo)"
298299
},
299300
"read-batch": {
300301
"approve": {

webview-ui/src/i18n/locales/fr/chat.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@
294294
"codebaseSearch": {
295295
"wantsToSearch": "Roo veut rechercher dans la base de code <code>{{query}}</code> :",
296296
"wantsToSearchWithPath": "Roo veut rechercher dans la base de code <code>{{query}}</code> dans <code>{{path}}</code> :",
297-
"didSearch": "{{count}} résultat(s) trouvé(s) pour <code>{{query}}</code> :"
297+
"didSearch": "{{count}} résultat(s) trouvé(s) pour <code>{{query}}</code> :",
298+
"resultTooltip": "Score de similarité : {{score}} (cliquer pour ouvrir le fichier)"
298299
},
299300
"read-batch": {
300301
"approve": {

webview-ui/src/i18n/locales/hi/chat.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@
294294
"codebaseSearch": {
295295
"wantsToSearch": "Roo कोडबेस में <code>{{query}}</code> खोजना चाहता है:",
296296
"wantsToSearchWithPath": "Roo <code>{{path}}</code> में कोडबेस में <code>{{query}}</code> खोजना चाहता है:",
297-
"didSearch": "<code>{{query}}</code> के लिए {{count}} परिणाम मिले:"
297+
"didSearch": "<code>{{query}}</code> के लिए {{count}} परिणाम मिले:",
298+
"resultTooltip": "समानता स्कोर: {{score}} (फ़ाइल खोलने के लिए क्लिक करें)"
298299
},
299300
"read-batch": {
300301
"approve": {

webview-ui/src/i18n/locales/id/chat.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,8 @@
207207
"codebaseSearch": {
208208
"wantsToSearch": "Roo ingin mencari codebase untuk <code>{{query}}</code>:",
209209
"wantsToSearchWithPath": "Roo ingin mencari codebase untuk <code>{{query}}</code> di <code>{{path}}</code>:",
210-
"didSearch": "Ditemukan {{count}} hasil untuk <code>{{query}}</code>:"
210+
"didSearch": "Ditemukan {{count}} hasil untuk <code>{{query}}</code>:",
211+
"resultTooltip": "Skor kemiripan: {{score}} (klik untuk membuka file)"
211212
},
212213
"commandOutput": "Output Perintah",
213214
"response": "Respons",

webview-ui/src/i18n/locales/it/chat.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@
294294
"codebaseSearch": {
295295
"wantsToSearch": "Roo vuole cercare nella base di codice <code>{{query}}</code>:",
296296
"wantsToSearchWithPath": "Roo vuole cercare nella base di codice <code>{{query}}</code> in <code>{{path}}</code>:",
297-
"didSearch": "Trovato {{count}} risultato/i per <code>{{query}}</code>:"
297+
"didSearch": "Trovato {{count}} risultato/i per <code>{{query}}</code>:",
298+
"resultTooltip": "Punteggio di somiglianza: {{score}} (clicca per aprire il file)"
298299
},
299300
"read-batch": {
300301
"approve": {

webview-ui/src/i18n/locales/ja/chat.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,8 @@
294294
"codebaseSearch": {
295295
"wantsToSearch": "Rooはコードベースで <code>{{query}}</code> を検索したい:",
296296
"wantsToSearchWithPath": "Rooは <code>{{path}}</code> 内のコードベースで <code>{{query}}</code> を検索したい:",
297-
"didSearch": "<code>{{query}}</code> の検索結果: {{count}} 件"
297+
"didSearch": "<code>{{query}}</code> の検索結果: {{count}} 件",
298+
"resultTooltip": "類似度スコア: {{score}} (クリックしてファイルを開く)"
298299
},
299300
"read-batch": {
300301
"approve": {

0 commit comments

Comments
 (0)