i18n: update bundle in `idea-repl

#KT-37483
This commit is contained in:
Dmitry Gridin
2020-03-27 15:57:19 +07:00
parent c642ca45de
commit 318ca1c5e8
8 changed files with 72 additions and 41 deletions
@@ -1,22 +1,25 @@
0.to.execute=<{0}> to execute
command.0.to.execute=<{0}> to execute
build.and.restart=Build and restart
build.module.0.and.restart=Build module ''{0}'' and restart
cannot.find.project=Cannot find project
choose.context.module=Choose context module...
error=Error:
executed.command=Executed command
history.of.executed.commands=History of executed commands
info=Info:
input.line=Input line
kotlin.repl=Kotlin REPL
icon.tool.tip.executed.command=Executed command
icon.tool.tip.history.of.executed.commands=History of executed commands
icon.tool.tip.input.line=Input line
icon.tool.tip.result=Result
icon.tool.tip.runtime.exception=Runtime exception
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
no.modules.were.found=No modules were 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}
waiting.for.input=Waiting for input...
warning=Warning:
write.your.commands.here=Write your commands here
you.re.running.the.repl.with.outdated.classes=Youre running the REPL with outdated classes:\u0020
you.re.running.the.repl.with.outdated.classes=Youre 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.util.concurrent.ConcurrentHashMap
private val REPL_TITLE: String get() = KotlinIdeaReplBundle.message("kotlin.repl")
class KotlinConsoleKeeper(val project: Project) {
private val consoleMap: MutableMap<VirtualFile, KotlinConsoleRunner> = ConcurrentHashMap()
@@ -28,8 +26,15 @@ class KotlinConsoleKeeper(val project: Project) {
fun run(module: Module, previousCompilationFailed: Boolean = false): KotlinConsoleRunner? {
val path = module.moduleFilePath
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()
return consoleRunner
}
@@ -123,7 +123,7 @@ class KotlinConsoleRunner(
var compilerHelper: ConsoleCompilerHelper by Delegates.notNull()
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 getScriptName(script: KtScript) = Name.identifier("REPL")
}
@@ -207,13 +207,13 @@ class KotlinConsoleRunner(
override fun createConsoleExecAction(consoleExecuteActionHandler: ProcessBackedConsoleExecuteActionHandler) =
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) {
val executeCommandAction = ActionManager.getInstance().getAction(KOTLIN_SHELL_EXECUTE_ACTION_ID)
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)
val placeholderAttrs = TextAttributes()
@@ -68,7 +68,7 @@ class ReplOutputProcessor(
printOutput(message, ReplColors.WARNING_INFO_CONTENT_TYPE, ReplIcons.BUILD_WARNING_INDICATOR)
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()
}
}
@@ -145,7 +145,7 @@ class ReplOutputProcessor(
}
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)
logError(this::class.java, internalErrorText)
}
@@ -15,8 +15,6 @@ import org.jetbrains.kotlin.KotlinIdeaReplBundle
import org.jetbrains.kotlin.console.KotlinConsoleKeeper
class ConsoleModuleDialog(private val project: Project) {
private val TITLE get() = KotlinIdeaReplBundle.message("choose.context.module")
fun showIfNeeded(dataContext: DataContext) {
val module = getModule(dataContext)
if (module != null) return runConsole(module)
@@ -30,7 +28,12 @@ class ConsoleModuleDialog(private val project: Project) {
val moduleGroup = DefaultActionGroup(moduleActions)
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)
@@ -52,4 +55,8 @@ class ConsoleModuleDialog(private val project: Project) {
private fun createRunAction(module: Module) = object : AnAction(module.name) {
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
) : AnAction(
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()
}
@@ -23,9 +23,9 @@ import org.jetbrains.kotlin.diagnostics.Severity
class ConsoleErrorRenderer(private val messages: List<SeverityDetails>) : GutterIconRenderer() {
private fun msgType(severity: Severity) = when (severity) {
Severity.ERROR -> KotlinIdeaReplBundle.message("error")
Severity.WARNING -> KotlinIdeaReplBundle.message("warning")
Severity.INFO -> KotlinIdeaReplBundle.message("info")
Severity.ERROR -> KotlinIdeaReplBundle.message("message.type.error")
Severity.WARNING -> KotlinIdeaReplBundle.message("message.type.warning")
Severity.INFO -> KotlinIdeaReplBundle.message("message.type.info")
}
override fun getTooltipText(): String {
@@ -25,23 +25,37 @@ data class IconWithTooltip(val icon: Icon, val tooltip: String?)
object ReplIcons {
val BUILD_WARNING_INDICATOR: IconWithTooltip = IconWithTooltip(AllIcons.General.Warning, null)
val HISTORY_INDICATOR: IconWithTooltip = IconWithTooltip(AllIcons.Vcs.History,
KotlinIdeaReplBundle.message("history.of.executed.commands")
val HISTORY_INDICATOR: IconWithTooltip = IconWithTooltip(
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,
KotlinIdeaReplBundle.message("waiting.for.input")
val EDITOR_INDICATOR: IconWithTooltip = IconWithTooltip(
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
val SYSTEM_HELP: IconWithTooltip = IconWithTooltip(AllIcons.Actions.Help, KotlinIdeaReplBundle.message("system.help"))
val RESULT: IconWithTooltip = IconWithTooltip(AllIcons.Vcs.Equal, KotlinIdeaReplBundle.message("result"))
val SYSTEM_HELP: IconWithTooltip = IconWithTooltip(AllIcons.Actions.Help, KotlinIdeaReplBundle.message("icon.tool.tip.system.help"))
val RESULT: IconWithTooltip = IconWithTooltip(AllIcons.Vcs.Equal, KotlinIdeaReplBundle.message("icon.tool.tip.result"))
val COMPILER_ERROR: Icon = AllIcons.General.Error
val RUNTIME_EXCEPTION: IconWithTooltip = IconWithTooltip(AllIcons.General.BalloonWarning,
KotlinIdeaReplBundle.message("runtime.exception")
val RUNTIME_EXCEPTION: IconWithTooltip = IconWithTooltip(
AllIcons.General.BalloonWarning,
KotlinIdeaReplBundle.message("icon.tool.tip.runtime.exception")
)
}