Skip to content

Commit 4a48388

Browse files
feat: Complete i18n localization for token statistics
Fix i18n violations by adding complete translations for token statistics tooltip. Changes include: - Add tokenStats section with inputLabel, outputLabel, and cacheLabel to all 18 language files - Replace hardcoded strings in ChatRow.tsx with i18n calls - Update formatTokens.ts to accept localized cache label parameter - Translate shareSuccessPublic message to all supported languages - Ensure proper localization for token usage display in API request tooltips This resolves the automated code review rule violation (irule_C0ez7Rji6ANcGkkX) and provides complete localization support for the token statistics feature.
1 parent 1666dd5 commit 4a48388

File tree

20 files changed

+119
-22
lines changed

20 files changed

+119
-22
lines changed

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

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,12 @@ export const ChatRowContent = ({
11011101
/>
11021102
)
11031103
case "api_req_started":
1104-
const tokenStats = formatTokenStats(tokensIn, tokensOut, cacheReads)
1104+
const tokenStats = formatTokenStats(
1105+
tokensIn,
1106+
tokensOut,
1107+
cacheReads,
1108+
t("chat:task.tokenStats.cacheLabel"),
1109+
)
11051110
const hasTokenData = tokensIn !== undefined || tokensOut !== undefined
11061111

11071112
return (
@@ -1151,11 +1156,11 @@ export const ChatRowContent = ({
11511156
content={
11521157
<div className="flex flex-col gap-1">
11531158
<div className="flex items-center gap-2">
1154-
<span>↑ Input:</span>
1159+
<span>{t("chat:task.tokenStats.inputLabel")}</span>
11551160
<span className="font-mono">{tokenStats.input}</span>
11561161
</div>
11571162
<div className="flex items-center gap-2">
1158-
<span>↓ Output:</span>
1163+
<span>{t("chat:task.tokenStats.outputLabel")}</span>
11591164
<span className="font-mono">{tokenStats.output}</span>
11601165
</div>
11611166
</div>

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

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,12 @@
2424
"connectToCloudDescription": "Sign in to Roo Code Cloud to share tasks",
2525
"sharingDisabledByOrganization": "Sharing disabled by organization",
2626
"shareSuccessOrganization": "Organization link copied to clipboard",
27-
"shareSuccessPublic": "Public link copied to clipboard"
27+
"shareSuccessPublic": "Public link copied to clipboard",
28+
"tokenStats": {
29+
"inputLabel": "↑ Input:",
30+
"outputLabel": "↓ Output:",
31+
"cacheLabel": "cache"
32+
}
2833
},
2934
"unpin": "Unpin",
3035
"pin": "Pin",

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

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 6 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)