1
1
package cc.unitmesh.devti.mcp.ui
2
2
3
+ import cc.unitmesh.devti.AutoDevBundle
3
4
import cc.unitmesh.devti.mcp.client.CustomMcpServerManager
4
5
import cc.unitmesh.devti.mcp.ui.model.McpChatConfig
5
6
import cc.unitmesh.devti.util.parser.CodeFence
@@ -48,8 +49,8 @@ class McpChatResultPanel(private val project: Project, val config: McpChatConfig
48
49
}
49
50
50
51
private val tabbedPane = JBTabbedPane ().apply {
51
- addTab(" Response " , responseScrollPane)
52
- addTab(" Tools " , toolsScrollPane)
52
+ addTab(AutoDevBundle .message( " mcp.chat.result.tab.response " ) , responseScrollPane)
53
+ addTab(AutoDevBundle .message( " mcp.chat.result.tab.tools " ) , toolsScrollPane)
53
54
}
54
55
55
56
private val borderColor = JBColor (0xE5E7EB , 0x3C3F41 ) // Equivalent to Tailwind gray-200
@@ -77,7 +78,7 @@ class McpChatResultPanel(private val project: Project, val config: McpChatConfig
77
78
78
79
val toolCalls = extractToolCalls(text)
79
80
if (toolCalls.isEmpty()) {
80
- val noToolsLabel = JBLabel (" No tool calls found in the response " ).apply {
81
+ val noToolsLabel = JBLabel (AutoDevBundle .message( " mcp.chat.result.no.tools " ) ).apply {
81
82
foreground = JBColor (0x6B7280 , 0x9DA0A8 ) // Gray text
82
83
horizontalAlignment = SwingConstants .CENTER
83
84
}
@@ -183,7 +184,7 @@ class McpChatResultPanel(private val project: Project, val config: McpChatConfig
183
184
}
184
185
185
186
// Add execute button and result panel
186
- val executeButton = JButton (" Execute " ).apply {
187
+ val executeButton = JButton (AutoDevBundle .message( " mcp.chat.result.execute " ) ).apply {
187
188
font = JBUI .Fonts .label(12f )
188
189
addActionListener {
189
190
executeToolCall(toolCall, panel)
@@ -223,7 +224,7 @@ class McpChatResultPanel(private val project: Project, val config: McpChatConfig
223
224
224
225
parentPanel.add(resultPanel, BorderLayout .SOUTH )
225
226
226
- val loadingLabel = JBLabel (" Executing tool ${toolCall.name} ... " ).apply {
227
+ val loadingLabel = JBLabel (AutoDevBundle .message( " mcp.chat.result.executing " , toolCall.name) ).apply {
227
228
horizontalAlignment = SwingConstants .CENTER
228
229
}
229
230
resultPanel.add(loadingLabel, BorderLayout .CENTER )
@@ -244,7 +245,7 @@ class McpChatResultPanel(private val project: Project, val config: McpChatConfig
244
245
val result = if (matchingTool != null ) {
245
246
mcpServerManager.execute(project, matchingTool, params)
246
247
} else {
247
- " Error: Could not find matching tool ' ${ toolCall.name} ' "
248
+ AutoDevBundle .message( " mcp.chat.result.error.tool. not.found " , toolCall.name)
248
249
}
249
250
250
251
resultPanel.removeAll()
0 commit comments