Skip to content

Commit 85d07ce

Browse files
committed
fix: add missing translations for AI Deep Research feature
1 parent 08c6146 commit 85d07ce

File tree

18 files changed

+321
-0
lines changed

18 files changed

+321
-0
lines changed
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
const fs = require("fs")
2+
const path = require("path")
3+
4+
const aiDeepResearchTranslations = {
5+
aiDeepResearch: {
6+
title: "AI Deep Research",
7+
thinking: "Thinking...",
8+
searching: "Searching the web...",
9+
reading: "Reading sources...",
10+
analyzing: "Analyzing information...",
11+
completed: "Research completed",
12+
initializing: "Initializing research...",
13+
query: "Query",
14+
thoughtProcess: "Thought Process",
15+
searchingFor: "Searching for",
16+
readingUrl: "Reading",
17+
analyzingContent: "Analyzing content...",
18+
results: "Research Results",
19+
},
20+
}
21+
22+
const locales = [
23+
"ca",
24+
"de",
25+
"es",
26+
"fr",
27+
"hi",
28+
"id",
29+
"it",
30+
"ja",
31+
"ko",
32+
"nl",
33+
"pl",
34+
"pt-BR",
35+
"ru",
36+
"tr",
37+
"vi",
38+
"zh-CN",
39+
"zh-TW",
40+
]
41+
42+
locales.forEach((locale) => {
43+
const filePath = path.join(__dirname, "..", "webview-ui", "src", "i18n", "locales", locale, "chat.json")
44+
45+
try {
46+
const content = JSON.parse(fs.readFileSync(filePath, "utf8"))
47+
48+
// Remove any flat keys that were added incorrectly
49+
Object.keys(content).forEach((key) => {
50+
if (key.startsWith("aiDeepResearch.")) {
51+
delete content[key]
52+
}
53+
})
54+
55+
// Add the nested translations
56+
content.aiDeepResearch = aiDeepResearchTranslations.aiDeepResearch
57+
58+
// Write back the file with proper formatting
59+
fs.writeFileSync(filePath, JSON.stringify(content, null, "\t") + "\n", "utf8")
60+
console.log(`✅ Updated ${locale}/chat.json`)
61+
} catch (error) {
62+
console.error(`❌ Error updating ${locale}/chat.json:`, error.message)
63+
}
64+
})
65+
66+
console.log("\nDone! All translations have been added.")

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

Lines changed: 15 additions & 0 deletions
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: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 15 additions & 0 deletions
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: 15 additions & 0 deletions
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: 15 additions & 0 deletions
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: 15 additions & 0 deletions
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: 15 additions & 0 deletions
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: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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

Lines changed: 15 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)