mcp server: fix i18n (IJPL-190143)

GitOrigin-RevId: 04e976df079ca9588fe2026ccd81bc9d610b74a1
This commit is contained in:
Dmitry Batkovich
2025-06-13 13:52:57 +00:00
committed by intellij-monorepo-bot
parent 8843d44e8d
commit 0a794ff8a8
4 changed files with 14 additions and 22 deletions
@@ -1,9 +1,5 @@
border.title.notifications=Notifications
border.title.terminal.commands=Terminal Commands
checkbox.enable.brave.mode.skip.command.execution.confirmations=Enable Brave Mode (skip command execution confirmations)
checkbox.show.claude.notifications=Show Claude notifications
checkbox.show.claude.settings.notifications=Show Claude settings notifications
checkbox.show.node.js.notifications=Show Node.js notifications
command.name.replace.file.text=Replace File Text
command.name.replace.selected.text=Replace Selected Text
configurable.name.mcp.plugin=MCP Plugin
@@ -12,13 +8,6 @@ dialog.message.no.suitable.runner.found.for.configuration.executor=No suitable r
dialog.message.run.configuration.doesn.t.support.catching.output=Run configuration doesn't support catching output
dialog.title.confirm.command.execution=Confirm Command Execution
label.do.you.want.to.run.command.in.terminal=Do you want to run command `{0}` in the terminal?
notification.content.claude.client.not.installed=Claude Client is not installed
notification.content.don.t.show.again=Don't show again
notification.content.install.mcp.server.proxy=Install MCP server proxy
notification.content.mcp.server.proxy.not.configured=MCP Server Proxy is not configured
notification.content.mcp.server.proxy.requires.node.js.to.be.installed=MCP Server Proxy requires Node.js to be installed
notification.content.open.installation.instruction=Open installation instruction
notification.on.tool.window.title.node.not.installed=Node is not installed
tab.title.mcp.command=MCP Command
text.note.you.can.enable.brave.mode.in.settings.to.skip.this.confirmation=Note: You can enable 'Brave Mode' in settings to skip this confirmation.
text.warning.enabling.brave.mode.will.allow.terminal.commands.to.execute.without.confirmation.use.with.caution=Enabling Brave Mode will allow terminal commands to execute without confirmation. Use with caution.
@@ -13,6 +13,7 @@ import com.intellij.execution.ui.RunContentDescriptor
import com.intellij.find.FindManager
import com.intellij.find.impl.FindInProjectUtil
import com.intellij.ide.DataManager
import com.intellij.mcpserver.McpServerBundle
import com.intellij.mcpserver.McpToolset
import com.intellij.mcpserver.annotations.McpDescription
import com.intellij.mcpserver.annotations.McpTool
@@ -36,11 +37,11 @@ import com.intellij.usageView.UsageInfo
import com.intellij.usages.FindUsagesProcessPresentation
import com.intellij.usages.UsageViewPresentation
import com.intellij.util.Processor
import kotlin.coroutines.coroutineContext
import kotlin.io.path.Path
import java.util.concurrent.CompletableFuture
import java.util.concurrent.TimeUnit
import java.util.concurrent.TimeoutException
import kotlin.coroutines.coroutineContext
import kotlin.io.path.Path
class BuiltinGeneralToolset : McpToolset {
@McpTool
@@ -141,7 +142,7 @@ class BuiltinGeneralToolset : McpToolset {
val runner: ProgramRunner<*>? = ProgramRunner.getRunner(executor.id, settings.configuration)
if (runner == null) {
future.completeExceptionally(
ExecutionException("No suitable runner found for configuration '${settings.name}' and executor '${executor.id}'")
ExecutionException(McpServerBundle.message("dialog.message.no.suitable.runner.found.for.configuration.executor", settings.name, executor.id))
)
return@invokeLater
}
@@ -153,7 +154,7 @@ class BuiltinGeneralToolset : McpToolset {
if (descriptor == null) {
if (!future.isDone) {
future.completeExceptionally(
ExecutionException("Run configuration doesn't support catching output")
ExecutionException(McpServerBundle.message("dialog.message.run.configuration.doesn.t.support.catching.output"))
)
}
return
@@ -195,7 +196,7 @@ class BuiltinGeneralToolset : McpToolset {
} catch (e: Throwable) {
if (!future.isDone) {
future.completeExceptionally(
ExecutionException("Failed to prepare or start run configuration: ${e.message}", e)
ExecutionException(McpServerBundle.message("dialog.message.failed.to.prepare.or.start.run.configuration", e.message.orEmpty()), e)
)
}
}
@@ -2,6 +2,7 @@
package com.intellij.mcpserver.toolsets.general
import com.intellij.mcpserver.McpServerBundle
import com.intellij.mcpserver.McpToolset
import com.intellij.mcpserver.annotations.McpDescription
import com.intellij.mcpserver.annotations.McpTool
@@ -94,7 +95,7 @@ class TextToolset : McpToolset {
var response: String? = null
application.invokeAndWait {
WriteCommandAction.runWriteCommandAction(project, "Replace Selected Text", null, {
WriteCommandAction.runWriteCommandAction(project, McpServerBundle.message("command.name.replace.selected.text"), null, {
val editor = FileEditorManager.getInstance(project).selectedTextEditor
val document = editor?.document
val selectionModel = editor?.selectionModel
@@ -128,7 +129,7 @@ class TextToolset : McpToolset {
val project = coroutineContext.project
var response: String? = null
application.invokeAndWait {
WriteCommandAction.runWriteCommandAction(project, "Replace File Text", null, {
WriteCommandAction.runWriteCommandAction(project, McpServerBundle.message("command.name.replace.file.text"), null, {
val editor = FileEditorManager.getInstance(project).selectedTextEditor
val document = editor?.document
if (document != null) {
@@ -2,6 +2,7 @@
package com.intellij.mcpserver.toolsets.terminal
import com.intellij.mcpserver.McpServerBundle
import com.intellij.mcpserver.McpToolset
import com.intellij.mcpserver.annotations.McpDescription
import com.intellij.mcpserver.annotations.McpTool
@@ -71,16 +72,16 @@ class TerminalToolset : McpToolset {
val confirmationDialog = object : DialogWrapper(project, true) {
init {
init()
title = "Confirm Command Execution"
title = McpServerBundle.message("dialog.title.confirm.command.execution")
}
override fun createCenterPanel(): JComponent? {
return panel {
row {
label("Do you want to run command `${command.take(100)}` in the terminal?")
label(McpServerBundle.message("label.do.you.want.to.run.command.in.terminal", command.take(100)))
}
row {
comment("Note: You can enable 'Brave Mode' in settings to skip this confirmation.")
comment(McpServerBundle.message("text.note.you.can.enable.brave.mode.in.settings.to.skip.this.confirmation"))
}
}
}
@@ -94,7 +95,7 @@ class TerminalToolset : McpToolset {
return@invokeAndWait
}
val terminalWidget = ShTerminalRunner.run(project, command, project.basePath ?: "", "MCP Command", true)
val terminalWidget = ShTerminalRunner.run(project, command, project.basePath ?: "", McpServerBundle.message("tab.title.mcp.command"), true)
val shellWidget = if (terminalWidget != null) ShellTerminalWidget.asShellJediTermWidget(terminalWidget) else null
if (shellWidget == null) {