IDEA-261130 i18n: Run/Debug configuration: Junit: hardcode strings in build and run configurations

JRE selector

GitOrigin-RevId: 4ebdee1d9be538a67e1158f927653a585d9ec998
This commit is contained in:
Dmitry Avdeev
2021-02-03 18:09:38 +03:00
committed by intellij-monorepo-bot
parent 45d4d3176a
commit fed66a349b
2 changed files with 10 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ package com.intellij.execution.ui
import com.intellij.application.options.ModuleDescriptionsComboBox
import com.intellij.application.options.ModulesComboBox
import com.intellij.execution.ExecutionBundle
import com.intellij.execution.configurations.JavaParameters
import com.intellij.execution.util.JavaParametersUtil
import com.intellij.java.JavaBundle
@@ -70,18 +71,19 @@ abstract class DefaultJreSelector {
open class SdkFromModuleDependencies<T: ComboBox<*>>(val moduleComboBox: T, val getSelectedModule: (T) -> Module?, val productionOnly: () -> Boolean): DefaultJreSelector() {
override fun getNameAndDescription(): Pair<String?, String> {
val module = getSelectedModule(moduleComboBox) ?: return Pair.create(null, "module not specified")
val moduleNotSpecified = ExecutionBundle.message("module.not.specified")
val module = getSelectedModule(moduleComboBox) ?: return Pair.create(null, moduleNotSpecified)
val productionOnly = productionOnly()
val jdkToRun = JavaParameters.getJdkToRunModule(module, productionOnly)
val moduleJdk = ModuleRootManager.getInstance(module).sdk
if (moduleJdk == null || jdkToRun == null) {
return Pair.create(null, "module not specified")
return Pair.create(null, moduleNotSpecified)
}
if (moduleJdk.homeDirectory == jdkToRun.homeDirectory) {
return Pair.create(moduleJdk.name, "SDK of '${module.name}' module")
return Pair.create(moduleJdk.name, ExecutionBundle.message("sdk.of.0.module", module.name))
}
return Pair.create(jdkToRun.name, "newest SDK from '${module.name}' module${if (productionOnly) "" else " test"} dependencies")
return Pair.create(jdkToRun.name, ExecutionBundle.message("newest.sdk.from.0.module.1.choice.0.1.test.dependencies", module.name, if (productionOnly) 0 else 1))
}
override fun getVersion(): String? {

View File

@@ -590,4 +590,7 @@ state.widget.active.processes.text={0} active processes
state.widget.debug=Debugging
state.widget.run=Running
state.widget.stop.action.item.name={0}: {1}
state.widget.stop.process.action.item.name=Stop {0}
state.widget.stop.process.action.item.name=Stop {0}
module.not.specified=module not specified
sdk.of.0.module=SDK of ''{0}'' module
newest.sdk.from.0.module.1.choice.0.1.test.dependencies=newest SDK from ''{0}'' module{1, choice, 0#|1# test} dependencies