i18n: update bundle in `idea-repl
#KT-37483
This commit is contained in:
@@ -1,22 +1,25 @@
|
|||||||
0.to.execute=<{0}> to execute
|
command.0.to.execute=<{0}> to execute
|
||||||
build.and.restart=Build and restart
|
build.and.restart=Build and restart
|
||||||
build.module.0.and.restart=Build module ''{0}'' and restart
|
build.module.0.and.restart=Build module ''{0}'' and restart
|
||||||
cannot.find.project=Cannot find project
|
cannot.find.project=Cannot find project
|
||||||
choose.context.module=Choose context module...
|
choose.context.module=Choose context module...
|
||||||
error=Error:
|
icon.tool.tip.executed.command=Executed command
|
||||||
executed.command=Executed command
|
icon.tool.tip.history.of.executed.commands=History of executed commands
|
||||||
history.of.executed.commands=History of executed commands
|
icon.tool.tip.input.line=Input line
|
||||||
info=Info:
|
icon.tool.tip.result=Result
|
||||||
input.line=Input line
|
icon.tool.tip.runtime.exception=Runtime exception
|
||||||
kotlin.repl=Kotlin REPL
|
icon.tool.tip.system.help=System help
|
||||||
|
icon.tool.tip.waiting.for.input=Waiting for input...
|
||||||
|
icon.tool.tip.write.your.commands.here=Write your commands here
|
||||||
|
message.type.error=Error:
|
||||||
|
message.type.info=Info:
|
||||||
|
message.type.warning=Warning:
|
||||||
|
name.kotlin.repl=Kotlin REPL
|
||||||
kotlin.repl.configuration.error=Kotlin REPL Configuration Error
|
kotlin.repl.configuration.error=Kotlin REPL Configuration Error
|
||||||
no.modules.were.found=No modules were found
|
no.modules.were.found=No modules were found
|
||||||
project.not.found=Project not found
|
project.not.found=Project not found
|
||||||
result=Result
|
|
||||||
runtime.exception=Runtime exception
|
|
||||||
system.help=System help
|
|
||||||
there.were.compilation.errors.in.module.0=There were compilation errors in module {0}
|
there.were.compilation.errors.in.module.0=There were compilation errors in module {0}
|
||||||
waiting.for.input=Waiting for input...
|
|
||||||
warning=Warning:
|
|
||||||
write.your.commands.here=Write your commands here
|
|
||||||
you.re.running.the.repl.with.outdated.classes=You’re running the REPL with outdated classes:\u0020
|
you.re.running.the.repl.with.outdated.classes=You’re running the REPL with outdated classes:\u0020
|
||||||
|
constructor.title.0.in.module.1={0} (in module {1})
|
||||||
|
build.module.0.and.restart1=Build module ''{0}'' and restart
|
||||||
|
internal.error.occurred.please.send.report.to.developers=Internal error occurred. Please, send report to developers.\n
|
||||||
@@ -16,8 +16,6 @@ import org.jetbrains.kotlin.utils.PathUtil
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import java.util.concurrent.ConcurrentHashMap
|
import java.util.concurrent.ConcurrentHashMap
|
||||||
|
|
||||||
private val REPL_TITLE: String get() = KotlinIdeaReplBundle.message("kotlin.repl")
|
|
||||||
|
|
||||||
class KotlinConsoleKeeper(val project: Project) {
|
class KotlinConsoleKeeper(val project: Project) {
|
||||||
private val consoleMap: MutableMap<VirtualFile, KotlinConsoleRunner> = ConcurrentHashMap()
|
private val consoleMap: MutableMap<VirtualFile, KotlinConsoleRunner> = ConcurrentHashMap()
|
||||||
|
|
||||||
@@ -28,8 +26,15 @@ class KotlinConsoleKeeper(val project: Project) {
|
|||||||
fun run(module: Module, previousCompilationFailed: Boolean = false): KotlinConsoleRunner? {
|
fun run(module: Module, previousCompilationFailed: Boolean = false): KotlinConsoleRunner? {
|
||||||
val path = module.moduleFilePath
|
val path = module.moduleFilePath
|
||||||
val cmdLine = createReplCommandLine(project, module)
|
val cmdLine = createReplCommandLine(project, module)
|
||||||
|
val consoleRunner = KotlinConsoleRunner(
|
||||||
|
module,
|
||||||
|
cmdLine,
|
||||||
|
previousCompilationFailed,
|
||||||
|
project,
|
||||||
|
KotlinIdeaReplBundle.message("name.kotlin.repl"),
|
||||||
|
path
|
||||||
|
)
|
||||||
|
|
||||||
val consoleRunner = KotlinConsoleRunner(module, cmdLine, previousCompilationFailed, project, REPL_TITLE, path)
|
|
||||||
consoleRunner.initAndRun()
|
consoleRunner.initAndRun()
|
||||||
return consoleRunner
|
return consoleRunner
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ class KotlinConsoleRunner(
|
|||||||
var compilerHelper: ConsoleCompilerHelper by Delegates.notNull()
|
var compilerHelper: ConsoleCompilerHelper by Delegates.notNull()
|
||||||
|
|
||||||
private val consoleScriptDefinition = object : KotlinScriptDefinition(Any::class) {
|
private val consoleScriptDefinition = object : KotlinScriptDefinition(Any::class) {
|
||||||
override val name get() = KotlinIdeaReplBundle.message("kotlin.repl")
|
override val name get() = KotlinIdeaReplBundle.message("name.kotlin.repl")
|
||||||
override fun isScript(fileName: String): Boolean = fileName.startsWith(consoleView.virtualFile.name)
|
override fun isScript(fileName: String): Boolean = fileName.startsWith(consoleView.virtualFile.name)
|
||||||
override fun getScriptName(script: KtScript) = Name.identifier("REPL")
|
override fun getScriptName(script: KtScript) = Name.identifier("REPL")
|
||||||
}
|
}
|
||||||
@@ -207,13 +207,13 @@ class KotlinConsoleRunner(
|
|||||||
override fun createConsoleExecAction(consoleExecuteActionHandler: ProcessBackedConsoleExecuteActionHandler) =
|
override fun createConsoleExecAction(consoleExecuteActionHandler: ProcessBackedConsoleExecuteActionHandler) =
|
||||||
ConsoleExecuteAction(consoleView, consoleExecuteActionHandler, KOTLIN_SHELL_EXECUTE_ACTION_ID, consoleExecuteActionHandler)
|
ConsoleExecuteAction(consoleView, consoleExecuteActionHandler, KOTLIN_SHELL_EXECUTE_ACTION_ID, consoleExecuteActionHandler)
|
||||||
|
|
||||||
override fun constructConsoleTitle(title: String) = "$title (in module ${module.name})"
|
override fun constructConsoleTitle(title: String) = KotlinIdeaReplBundle.message("constructor.title.0.in.module.1", title, module.name)
|
||||||
|
|
||||||
private fun setupPlaceholder(editor: EditorEx) {
|
private fun setupPlaceholder(editor: EditorEx) {
|
||||||
val executeCommandAction = ActionManager.getInstance().getAction(KOTLIN_SHELL_EXECUTE_ACTION_ID)
|
val executeCommandAction = ActionManager.getInstance().getAction(KOTLIN_SHELL_EXECUTE_ACTION_ID)
|
||||||
val executeCommandActionShortcutText = KeymapUtil.getFirstKeyboardShortcutText(executeCommandAction)
|
val executeCommandActionShortcutText = KeymapUtil.getFirstKeyboardShortcutText(executeCommandAction)
|
||||||
|
|
||||||
editor.setPlaceholder(KotlinIdeaReplBundle.message("0.to.execute", executeCommandActionShortcutText))
|
editor.setPlaceholder(KotlinIdeaReplBundle.message("command.0.to.execute", executeCommandActionShortcutText))
|
||||||
editor.setShowPlaceholderWhenFocused(true)
|
editor.setShowPlaceholderWhenFocused(true)
|
||||||
|
|
||||||
val placeholderAttrs = TextAttributes()
|
val placeholderAttrs = TextAttributes()
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ class ReplOutputProcessor(
|
|||||||
printOutput(message, ReplColors.WARNING_INFO_CONTENT_TYPE, ReplIcons.BUILD_WARNING_INDICATOR)
|
printOutput(message, ReplColors.WARNING_INFO_CONTENT_TYPE, ReplIcons.BUILD_WARNING_INDICATOR)
|
||||||
|
|
||||||
if (isAddHyperlink) {
|
if (isAddHyperlink) {
|
||||||
consoleView.printHyperlink("Build module '${runner.module.name}' and restart") {
|
consoleView.printHyperlink(KotlinIdeaReplBundle.message("build.module.0.and.restart1", runner.module.name)) {
|
||||||
runner.compilerHelper.compileModule()
|
runner.compilerHelper.compileModule()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -145,7 +145,7 @@ class ReplOutputProcessor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun printInternalErrorMessage(internalErrorText: String) = WriteCommandAction.runWriteCommandAction(project) {
|
fun printInternalErrorMessage(internalErrorText: String) = WriteCommandAction.runWriteCommandAction(project) {
|
||||||
val promptText = "Internal error occurred. Please, send report to developers.\n"
|
val promptText = KotlinIdeaReplBundle.message("internal.error.occurred.please.send.report.to.developers")
|
||||||
printOutput(promptText, ConsoleViewContentType.ERROR_OUTPUT, ReplIcons.RUNTIME_EXCEPTION)
|
printOutput(promptText, ConsoleViewContentType.ERROR_OUTPUT, ReplIcons.RUNTIME_EXCEPTION)
|
||||||
logError(this::class.java, internalErrorText)
|
logError(this::class.java, internalErrorText)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ import org.jetbrains.kotlin.KotlinIdeaReplBundle
|
|||||||
import org.jetbrains.kotlin.console.KotlinConsoleKeeper
|
import org.jetbrains.kotlin.console.KotlinConsoleKeeper
|
||||||
|
|
||||||
class ConsoleModuleDialog(private val project: Project) {
|
class ConsoleModuleDialog(private val project: Project) {
|
||||||
private val TITLE get() = KotlinIdeaReplBundle.message("choose.context.module")
|
|
||||||
|
|
||||||
fun showIfNeeded(dataContext: DataContext) {
|
fun showIfNeeded(dataContext: DataContext) {
|
||||||
val module = getModule(dataContext)
|
val module = getModule(dataContext)
|
||||||
if (module != null) return runConsole(module)
|
if (module != null) return runConsole(module)
|
||||||
@@ -30,7 +28,12 @@ class ConsoleModuleDialog(private val project: Project) {
|
|||||||
val moduleGroup = DefaultActionGroup(moduleActions)
|
val moduleGroup = DefaultActionGroup(moduleActions)
|
||||||
|
|
||||||
val modulePopup = JBPopupFactory.getInstance().createActionGroupPopup(
|
val modulePopup = JBPopupFactory.getInstance().createActionGroupPopup(
|
||||||
TITLE, moduleGroup, dataContext, JBPopupFactory.ActionSelectionAid.SPEEDSEARCH, true, ActionPlaces.UNKNOWN
|
TITLE,
|
||||||
|
moduleGroup,
|
||||||
|
dataContext,
|
||||||
|
JBPopupFactory.ActionSelectionAid.SPEEDSEARCH,
|
||||||
|
true,
|
||||||
|
ActionPlaces.UNKNOWN
|
||||||
)
|
)
|
||||||
|
|
||||||
modulePopup.showCenteredInCurrentWindow(project)
|
modulePopup.showCenteredInCurrentWindow(project)
|
||||||
@@ -52,4 +55,8 @@ class ConsoleModuleDialog(private val project: Project) {
|
|||||||
private fun createRunAction(module: Module) = object : AnAction(module.name) {
|
private fun createRunAction(module: Module) = object : AnAction(module.name) {
|
||||||
override fun actionPerformed(e: AnActionEvent) = runConsole(module)
|
override fun actionPerformed(e: AnActionEvent) = runConsole(module)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private val TITLE get() = KotlinIdeaReplBundle.message("choose.context.module")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -47,7 +47,9 @@ class BuildAndRestartConsoleAction(
|
|||||||
private val runner: KotlinConsoleRunner
|
private val runner: KotlinConsoleRunner
|
||||||
) : AnAction(
|
) : AnAction(
|
||||||
KotlinIdeaReplBundle.message("build.and.restart"),
|
KotlinIdeaReplBundle.message("build.and.restart"),
|
||||||
KotlinIdeaReplBundle.message("build.module.0.and.restart", runner.module.name), AllIcons.Actions.Restart) {
|
KotlinIdeaReplBundle.message("build.module.0.and.restart", runner.module.name),
|
||||||
|
AllIcons.Actions.Restart
|
||||||
|
) {
|
||||||
|
|
||||||
override fun actionPerformed(e: AnActionEvent) = runner.compilerHelper.compileModule()
|
override fun actionPerformed(e: AnActionEvent) = runner.compilerHelper.compileModule()
|
||||||
}
|
}
|
||||||
@@ -23,9 +23,9 @@ import org.jetbrains.kotlin.diagnostics.Severity
|
|||||||
|
|
||||||
class ConsoleErrorRenderer(private val messages: List<SeverityDetails>) : GutterIconRenderer() {
|
class ConsoleErrorRenderer(private val messages: List<SeverityDetails>) : GutterIconRenderer() {
|
||||||
private fun msgType(severity: Severity) = when (severity) {
|
private fun msgType(severity: Severity) = when (severity) {
|
||||||
Severity.ERROR -> KotlinIdeaReplBundle.message("error")
|
Severity.ERROR -> KotlinIdeaReplBundle.message("message.type.error")
|
||||||
Severity.WARNING -> KotlinIdeaReplBundle.message("warning")
|
Severity.WARNING -> KotlinIdeaReplBundle.message("message.type.warning")
|
||||||
Severity.INFO -> KotlinIdeaReplBundle.message("info")
|
Severity.INFO -> KotlinIdeaReplBundle.message("message.type.info")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getTooltipText(): String {
|
override fun getTooltipText(): String {
|
||||||
|
|||||||
@@ -25,23 +25,37 @@ data class IconWithTooltip(val icon: Icon, val tooltip: String?)
|
|||||||
|
|
||||||
object ReplIcons {
|
object ReplIcons {
|
||||||
val BUILD_WARNING_INDICATOR: IconWithTooltip = IconWithTooltip(AllIcons.General.Warning, null)
|
val BUILD_WARNING_INDICATOR: IconWithTooltip = IconWithTooltip(AllIcons.General.Warning, null)
|
||||||
val HISTORY_INDICATOR: IconWithTooltip = IconWithTooltip(AllIcons.Vcs.History,
|
val HISTORY_INDICATOR: IconWithTooltip = IconWithTooltip(
|
||||||
KotlinIdeaReplBundle.message("history.of.executed.commands")
|
AllIcons.Vcs.History,
|
||||||
|
KotlinIdeaReplBundle.message("icon.tool.tip.history.of.executed.commands")
|
||||||
)
|
)
|
||||||
val EDITOR_INDICATOR: IconWithTooltip = IconWithTooltip(KotlinIcons.LAUNCH, KotlinIdeaReplBundle.message("write.your.commands.here"))
|
|
||||||
val EDITOR_READLINE_INDICATOR: IconWithTooltip = IconWithTooltip(AllIcons.General.Balloon,
|
val EDITOR_INDICATOR: IconWithTooltip = IconWithTooltip(
|
||||||
KotlinIdeaReplBundle.message("waiting.for.input")
|
KotlinIcons.LAUNCH,
|
||||||
|
KotlinIdeaReplBundle.message("icon.tool.tip.write.your.commands.here")
|
||||||
)
|
)
|
||||||
val COMMAND_MARKER: IconWithTooltip = IconWithTooltip(AllIcons.RunConfigurations.TestState.Run,
|
|
||||||
KotlinIdeaReplBundle.message("executed.command")
|
val EDITOR_READLINE_INDICATOR: IconWithTooltip = IconWithTooltip(
|
||||||
|
AllIcons.General.Balloon,
|
||||||
|
KotlinIdeaReplBundle.message("icon.tool.tip.waiting.for.input")
|
||||||
|
)
|
||||||
|
|
||||||
|
val COMMAND_MARKER: IconWithTooltip = IconWithTooltip(
|
||||||
|
AllIcons.RunConfigurations.TestState.Run,
|
||||||
|
KotlinIdeaReplBundle.message("icon.tool.tip.executed.command")
|
||||||
|
)
|
||||||
|
|
||||||
|
val READLINE_MARKER: IconWithTooltip = IconWithTooltip(
|
||||||
|
AllIcons.Debugger.PromptInput,
|
||||||
|
KotlinIdeaReplBundle.message("icon.tool.tip.input.line")
|
||||||
)
|
)
|
||||||
val READLINE_MARKER: IconWithTooltip = IconWithTooltip(AllIcons.Debugger.PromptInput, KotlinIdeaReplBundle.message("input.line"))
|
|
||||||
|
|
||||||
// command result icons
|
// command result icons
|
||||||
val SYSTEM_HELP: IconWithTooltip = IconWithTooltip(AllIcons.Actions.Help, KotlinIdeaReplBundle.message("system.help"))
|
val SYSTEM_HELP: IconWithTooltip = IconWithTooltip(AllIcons.Actions.Help, KotlinIdeaReplBundle.message("icon.tool.tip.system.help"))
|
||||||
val RESULT: IconWithTooltip = IconWithTooltip(AllIcons.Vcs.Equal, KotlinIdeaReplBundle.message("result"))
|
val RESULT: IconWithTooltip = IconWithTooltip(AllIcons.Vcs.Equal, KotlinIdeaReplBundle.message("icon.tool.tip.result"))
|
||||||
val COMPILER_ERROR: Icon = AllIcons.General.Error
|
val COMPILER_ERROR: Icon = AllIcons.General.Error
|
||||||
val RUNTIME_EXCEPTION: IconWithTooltip = IconWithTooltip(AllIcons.General.BalloonWarning,
|
val RUNTIME_EXCEPTION: IconWithTooltip = IconWithTooltip(
|
||||||
KotlinIdeaReplBundle.message("runtime.exception")
|
AllIcons.General.BalloonWarning,
|
||||||
|
KotlinIdeaReplBundle.message("icon.tool.tip.runtime.exception")
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user