diff --git a/idea/idea-jvm/resources/messages/KotlinJvmBundle.properties b/idea/idea-jvm/resources/messages/KotlinJvmBundle.properties
index 88aad4bdaf0..421d970ee7f 100644
--- a/idea/idea-jvm/resources/messages/KotlinJvmBundle.properties
+++ b/idea/idea-jvm/resources/messages/KotlinJvmBundle.properties
@@ -62,14 +62,14 @@ run.configuration.error.class.no.main.method=Class ''{0}'' has no ''main()'' met
run.configuration.error.main.not.found=Function ''main()'' not found in class ''{0}''
run.configuration.error.main.not.found.top.level=Top-level function ''main()'' not found in package ''{0}''
-script.choose.file=Choose script file
+script.choose.file=Choose Script File
editor.editor.only=Editor only
editor.preview.only=Preview only
editor.editor.and.preview=Editor and preview
-choose.configurator=Choose Configurator
-ignore=Ignore
-configure=Configure
+title.choose.configurator=Choose Configurator
+action.text.ignore=Ignore
+action.text.configure=Configure
kotlin.not.configured=Kotlin not configured
there.aren.t.configurators.available=There aren't configurators available
all.modules.with.kotlin.files.are.configured=All modules with Kotlin files are configured
@@ -86,6 +86,8 @@ can.t.find.library.jar.file.0=Can''t find library JAR file {0}
0.library.was.created={0} library was created
configure.kotlin=Configure Kotlin
configure.0.in.1.project.br.2=Configure {0} in ''{1}'' project
{2}
+configure.0.module=''{0}'' module
+configure.modules=modules
kotlin.code.style=Kotlin Code Style
default.code.style.was.updated.to.kotlin.coding.conventions=Default code style was updated to Kotlin Coding Conventions.
apply.new.code.style=Apply new code style
@@ -94,29 +96,29 @@ libraries.for.the.following.platform.are.also.present.in.the.module.dependencies
no.target.platforms.selected=No target platforms selected
kotlin.common.standard.library=Kotlin Common Standard Library
create.kotlin.common.standard.library=Create Kotlin Common Standard Library
-kotlin.js=Kotlin/JS
+presentable.name.kotlin.js=Kotlin/JS
kotlin.java.runtime.library=Kotlin Java Runtime Library
create.kotlin.java.runtime.library=Create Kotlin Java Runtime Library
kotlin.javascript.library=Kotlin JavaScript Library
create.kotlin.javascript.library=Create Kotlin JavaScript Library
javascript.library.creation=JavaScript Library Creation
java.runtime.library.creation=Java Runtime Library Creation
-js.files=JS files
+presentable.type.js.files=JS files
kotlin.project.with.a.javascript.target.based.on.the.intellij.idea.build.system=Kotlin project with a JavaScript target based on the IntelliJ IDEA build system
kotlin.project.with.a.jvm.target.based.on.the.intellij.idea.build.system=Kotlin project with a JVM target based on the IntelliJ IDEA build system
-add.injection.comment=Add injection comment
-add.injection.annotation=Add injection annotation
-remove.injection.in.code.instructions=remove injection in-code instructions
+command.action.add.injection.comment=Add injection comment
+command.action.add.injection.annotation=Add injection annotation
+command.action.remove.injection.in.code.instructions=remove injection in-code instructions
this.java.file.is.outside.of.java.source.roots.and.won.t.be.added.to.the.classpath=This .java file is outside of Java source roots and won't be added to the classpath.
-incompatible.api=Incompatible API
+reason.incompatible.api=Incompatible API
kotlin.bytecode.decompiler=Kotlin Bytecode Decompiler
failed.to.decompile.0.1=Failed to decompile {0}: {1}
-decompile=Decompile
-ir=IR
-jvm.8.target=JVM 8 target
-assertions=Assertions
-optimization=Optimization
-inline=Inline
+button.text.decompile=Decompile
+checkbox.text.ir=IR
+checkbox.text.jvm.8.target=JVM 8 target
+checkbox.text.assertions=Assertions
+checkbox.text.optimization=Optimization
+checkbox.text.inline=Inline
cannot.compile.0.to.bytecode=Cannot compile {0} to bytecode.
create.backup.for.debugging.kotlin.incremental.compilation=Create backup for debugging Kotlin incremental compilation
creating.backup.for.debugging.kotlin.incremental.compilation=Creating backup for debugging Kotlin incremental compilation
@@ -132,7 +134,7 @@ this.language.feature.requires.version.0.or.later.of.the.kotlin.runtime.library.
could.not.find.script.file.0=Could not find script file: {0}
file.was.not.specified=File was not specified
run.kotlin.script=Run Kotlin script
-kotlin.script=Kotlin script
+name.kotlin.script=Kotlin script
exception.occurs.during.run.scratch.action=Exception occurs during Run Scratch Action
there.were.compilation.errors.in.module.0=There were compilation errors in module {0}
other.scratch.file.execution.is.in.progress=Other Scratch file execution is in progress
@@ -145,9 +147,9 @@ running.kotlin.scratch=Running Kotlin Scratch...
couldn.t.execute.statement.0=Couldn''t execute statement: {0}
couldn.t.stop.repl.process=Couldn't stop REPL process
check.bunch.files=Check &bunch files
-commit=Commit
-review=Review
-forgotten.bunch.files=Forgotten Bunch Files
+button.text.commit=Commit
+button.text.review=Review
+button.text.forgotten.bunch.files=Forgotten Bunch Files
several.bunch.files.haven.t.been.updated.0.do.you.want.to.review.them.before.commit=Several bunch files haven''t been updated:\n\n{0}\n\nDo you want to review them before commit?
update.kotlin.runtime.library=Update Kotlin Runtime Library
automatic.library.version.update.for.maven.and.gradle.projects.is.currently.unsupported.please.update.your.build.scripts.manually=Automatic library version update for Maven and Gradle projects is currently unsupported. Please update your build scripts manually.
@@ -156,31 +158,43 @@ failed.to.update.0.1=Failed to update {0}: {1}
library.update.failed1=Library update failed
failed.to.find.root.for.file.0=Failed to find root for file: {0}
html.b.0.choice.0.1.1.some.kotlin.runtime.librar.0.choice.0.1.y.1.ies.b.1.choice.0.1.and.one.other.jar.1.and.1.other.jars.1.choice.0.has.0.have.an.unsupported.binary.format.html={0,choice,0#|1#|1{1,choice,0#|1# and one other jar|1< and {1} other jars} {1,choice,0#has|0'{'0'}' has outdated binary format and can''t be read by current plugin. Please update the library.
html.kotlin.library.b.0.b.was.compiled.with.a.newer.kotlin.compiler.and.can.t.be.read.please.update.kotlin.plugin.html=Kotlin library '{'0'}' was compiled with a newer Kotlin compiler and can''t be read. Please update Kotlin plugin.
some.kotlin.libraries.attached.to.this.project.have.unsupported.binary.format.please.update.the.libraries.or.the.plugin=Some Kotlin libraries attached to this project have unsupported binary format. Please update the libraries or the plugin.
some.kotlin.libraries.attached.to.this.project.have.outdated.binary.format.and.can.t.be.read.by.current.plugin.please.update.found.libraries=Some Kotlin libraries attached to this project have outdated binary format and can't be read by current plugin. Please update found libraries.
some.kotlin.libraries.attached.to.this.project.were.compiled.with.a.newer.kotlin.compiler.and.can.t.be.read.please.update.kotlin.plugin=Some Kotlin libraries attached to this project were compiled with a newer Kotlin compiler and can't be read. Please update Kotlin plugin.
-go.to.0=Go to {0}
-details=Details
-update.plugin=Update plugin
-check=\ Check...
+button.text.go.to.0=Go to {0}
+button.text.details=Details
+progress.action.text.update.plugin=Update plugin
+progress.action.text.check=\ Check...
can.t.show.all.paths.during.index.update=Can't show all paths during index update
unsupported.format.plugin.version.0=Unsupported format, plugin version: {0}
no.updates.found=No updates found
0.1.expected.2={0} ({1}) - expected: {2}
-copy.to=&Copy to:
+choose.library.copy.to=&Copy to:
use.library.from.plugin=&Use library from plugin
-all.modules.containing.kotlin.files=All modules containing Kotlin files:
+all.modules.containing.kotlin.files=All modules containing Kotlin files:
all.modules=All modules
single.module=Single module:
kotlin.compiler.and.runtime.version=Kotlin compiler and runtime version:
copy.into=&Copy into:
using.compiler.bundled.into.plugin=Using compiler bundled into plugin
-reason=&Reason
-reference=Re&ference
-script.file=Script file
\ No newline at end of file
+api.dialog.reason=&Reason
+api.dialog.reference=Re&ference
+configuration.title.script.file=Script file
+presentable.name.js.idea=JS | IDEA
+presentable.name.jvm.idea=JVM | IDEA
+language.name.kotlin=Kotlin
+language.name.java=Java
+language.name.javascript=JavaScript
+as.kotlin.1.module=as Kotlin ({0}) {1,choice,0#module|2#modules}
+presentable.name.kotlin.jvm=Kotlin/JVM
+fix.0.in.current.module={0} in the current module
+fix.0.in.the.project={0} in the project
+short.feature.name.coroutine=coroutine
+enable.feature.family=Increase {0,choice,0#module|1#project} {1,choice,0#API version|1#language version}
+enable.feature.text=Set {0,choice,0#module|1#project} {1,choice,0#API version|1#language version} to {2}
\ No newline at end of file
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/actions/ShowKotlinBytecodeAction.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/actions/ShowKotlinBytecodeAction.kt
index b51fbde208e..bf588f63d1b 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/actions/ShowKotlinBytecodeAction.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/actions/ShowKotlinBytecodeAction.kt
@@ -27,15 +27,12 @@ import org.jetbrains.kotlin.idea.KotlinIcons
import org.jetbrains.kotlin.idea.internal.KotlinBytecodeToolWindow
class ShowKotlinBytecodeAction : AnAction() {
- val TOOLWINDOW_ID = "Kotlin Bytecode"
-
override fun actionPerformed(e: AnActionEvent) {
val project = e.project ?: return
val toolWindowManager = ToolWindowManager.getInstance(project)
-
var toolWindow = toolWindowManager.getToolWindow(TOOLWINDOW_ID)
if (toolWindow == null) {
- toolWindow = toolWindowManager.registerToolWindow("Kotlin Bytecode", false, ToolWindowAnchor.RIGHT)
+ toolWindow = toolWindowManager.registerToolWindow(TOOLWINDOW_ID, false, ToolWindowAnchor.RIGHT)
toolWindow.icon = KotlinIcons.SMALL_LOGO_13
val contentManager = toolWindow.contentManager
@@ -49,4 +46,8 @@ class ShowKotlinBytecodeAction : AnAction() {
val file = e.getData(CommonDataKeys.PSI_FILE)
e.presentation.isEnabled = e.project != null && file?.fileType == KotlinFileType.INSTANCE
}
+
+ companion object {
+ const val TOOLWINDOW_ID = "Kotlin Bytecode"
+ }
}
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/actions/ShowKotlinBytecodeAction.kt.201 b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/actions/ShowKotlinBytecodeAction.kt.201
index 3993fd63862..69903c264a0 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/actions/ShowKotlinBytecodeAction.kt.201
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/actions/ShowKotlinBytecodeAction.kt.201
@@ -27,14 +27,12 @@ import org.jetbrains.kotlin.idea.KotlinIcons
import org.jetbrains.kotlin.idea.internal.KotlinBytecodeToolWindow
class ShowKotlinBytecodeAction : AnAction() {
- val TOOLWINDOW_ID = "Kotlin Bytecode"
-
override fun actionPerformed(e: AnActionEvent) {
val project = e.project ?: return
val toolWindowManager = ToolWindowManager.getInstance(project)
val toolWindow = toolWindowManager.getToolWindow(TOOLWINDOW_ID) ?: toolWindowManager.registerToolWindow(
- "Kotlin Bytecode",
+ TOOLWINDOW_ID,
false,
ToolWindowAnchor.RIGHT,
)
@@ -51,4 +49,8 @@ class ShowKotlinBytecodeAction : AnAction() {
val file = e.getData(CommonDataKeys.PSI_FILE)
e.presentation.isEnabled = e.project != null && file?.fileType == KotlinFileType.INSTANCE
}
+
+ companion object {
+ const val TOOLWINDOW_ID = "Kotlin Bytecode"
+ }
}
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt
index 618d9039036..db21c1e03a1 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ConfigureKotlinInProjectUtils.kt
@@ -83,11 +83,11 @@ fun devRepository(version: String) = RepositoryDescription(
isSnapshot = false
)
-val MAVEN_CENTRAL = "mavenCentral()"
+const val MAVEN_CENTRAL = "mavenCentral()"
-val JCENTER = "jcenter()"
+const val JCENTER = "jcenter()"
-val KOTLIN_GROUP_ID = "org.jetbrains.kotlin"
+const val KOTLIN_GROUP_ID = "org.jetbrains.kotlin"
fun isRepositoryConfigured(repositoriesBlockText: String): Boolean =
repositoriesBlockText.contains(MAVEN_CENTRAL) || repositoriesBlockText.contains(JCENTER)
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinJavaModuleConfigurator.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinJavaModuleConfigurator.kt
index a964674a297..3ea03a00689 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinJavaModuleConfigurator.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinJavaModuleConfigurator.kt
@@ -28,6 +28,7 @@ import com.intellij.openapi.roots.OrderRootType
import com.intellij.openapi.roots.impl.libraries.LibraryEx
import com.intellij.openapi.roots.libraries.Library
import org.jetbrains.kotlin.cli.common.arguments.K2JVMCompilerArguments
+import org.jetbrains.kotlin.idea.KotlinJvmBundle
import org.jetbrains.kotlin.idea.compiler.configuration.Kotlin2JvmCompilerArgumentsHolder
import org.jetbrains.kotlin.idea.facet.getOrCreateFacet
import org.jetbrains.kotlin.idea.facet.initializeIfNeeded
@@ -63,7 +64,7 @@ open class KotlinJavaModuleConfigurator protected constructor() : KotlinWithLibr
get() = JavaRuntimeLibraryDescription.JAVA_RUNTIME_LIBRARY_CREATION
override val presentableText: String
- get() = "Java"
+ get() = KotlinJvmBundle.message("language.name.java")
override val name: String
get() = NAME
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinJsModuleConfigurator.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinJsModuleConfigurator.kt
index 4bfb198aae8..9537f3e705a 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinJsModuleConfigurator.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinJsModuleConfigurator.kt
@@ -36,7 +36,7 @@ open class KotlinJsModuleConfigurator : KotlinWithLibraryConfigurator() {
override fun getTargetPlatform() = JsPlatforms.CompatJsPlatform
override val presentableText: String
- get() = JavaScript.FULL_NAME
+ get() = KotlinJvmBundle.message("language.name.javascript")
override fun isConfigured(module: Module) = hasKotlinJsRuntimeInScope(module)
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinSetupEnvironmentNotificationProvider.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinSetupEnvironmentNotificationProvider.kt
index 1347f4568f8..177a4ff12cc 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinSetupEnvironmentNotificationProvider.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinSetupEnvironmentNotificationProvider.kt
@@ -97,7 +97,7 @@ class KotlinSetupEnvironmentNotificationProvider(private val myProject: Project)
setText(KotlinJvmBundle.message("kotlin.not.configured"))
val configurators = getAbleToRunConfigurators(module).toList()
if (configurators.isNotEmpty()) {
- createComponentActionLabel(KotlinJvmBundle.message("configure")) { label ->
+ createComponentActionLabel(KotlinJvmBundle.message("action.text.configure")) { label ->
val singleConfigurator = configurators.singleOrNull()
if (singleConfigurator != null) {
singleConfigurator.apply(module.project)
@@ -107,7 +107,7 @@ class KotlinSetupEnvironmentNotificationProvider(private val myProject: Project)
}
}
- createComponentActionLabel(KotlinJvmBundle.message("ignore")) {
+ createComponentActionLabel(KotlinJvmBundle.message("action.text.ignore")) {
SuppressNotificationState.suppressKotlinNotConfigured(module)
EditorNotifications.getInstance(module.project).updateAllNotifications()
}
@@ -123,7 +123,7 @@ class KotlinSetupEnvironmentNotificationProvider(private val myProject: Project)
fun createConfiguratorsPopup(project: Project, configurators: List): ListPopup {
val step = object : BaseListPopupStep(
- KotlinJvmBundle.message("choose.configurator"),
+ KotlinJvmBundle.message("title.choose.configurator"),
configurators
) {
override fun getTextFor(value: KotlinProjectConfigurator?) = value?.presentableText ?: ""
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinWithLibraryConfigurator.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinWithLibraryConfigurator.kt
index 956689f94af..993dbe513e8 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinWithLibraryConfigurator.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/KotlinWithLibraryConfigurator.kt
@@ -464,7 +464,7 @@ abstract class KotlinWithLibraryConfigurator protected constructor() : KotlinPro
}
companion object {
- val DEFAULT_LIBRARY_DIR = "lib"
+ const val DEFAULT_LIBRARY_DIR = "lib"
fun getPathFromLibrary(library: Library?, type: OrderRootType): String? {
if (library == null) return null
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ui/notifications/ConfigureKotlinNotification.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ui/notifications/ConfigureKotlinNotification.kt
index a07e078f72f..ccb3fa87c02 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ui/notifications/ConfigureKotlinNotification.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ui/notifications/ConfigureKotlinNotification.kt
@@ -28,7 +28,8 @@ class ConfigureKotlinNotification(
excludeModules: List,
val notificationState: ConfigureKotlinNotificationState
) : Notification(
- KotlinConfigurationCheckerService.CONFIGURE_NOTIFICATION_GROUP_ID, KotlinJvmBundle.message("configure.kotlin"),
+ KotlinConfigurationCheckerService.CONFIGURE_NOTIFICATION_GROUP_ID,
+ KotlinJvmBundle.message("configure.kotlin"),
notificationState.notificationString,
NotificationType.WARNING,
NotificationListener { notification, event ->
@@ -63,7 +64,10 @@ class ConfigureKotlinNotification(
val isOnlyOneModule = configurableModules.size == 1
- val modulesString = if (isOnlyOneModule) "'${configurableModules.first().baseModule.name}' module" else "modules"
+ val modulesString = if (isOnlyOneModule)
+ KotlinJvmBundle.message("configure.0.module", configurableModules.first().baseModule.name)
+ else
+ KotlinJvmBundle.message("configure.modules")
val links = ableToRunConfigurators.joinToString(separator = "
") { configurator ->
getLink(configurator, isOnlyOneModule)
}
@@ -76,6 +80,10 @@ class ConfigureKotlinNotification(
}
private fun getLink(configurator: KotlinProjectConfigurator, isOnlyOneModule: Boolean): String =
- "as Kotlin (${configurator.presentableText}) module${if (!isOnlyOneModule) "s" else ""}"
+ "${KotlinJvmBundle.message(
+ "as.kotlin.1.module",
+ configurator.presentableText,
+ 1.takeIf { isOnlyOneModule } ?: 2
+ )}"
}
}
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ui/notifications/NewCodeStyleNotification.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ui/notifications/NewCodeStyleNotification.kt
index f495cb9f3ae..3ab3ef2d8f5 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ui/notifications/NewCodeStyleNotification.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ui/notifications/NewCodeStyleNotification.kt
@@ -55,7 +55,7 @@ fun notifyKotlinStyleUpdateIfNeeded(project: Project) {
private class KotlinCodeStyleChangedNotification(val project: Project, isProjectSettings: Boolean) : Notification(
KOTLIN_UPDATE_CODE_STYLE_GROUP_ID,
- "Kotlin Code Style",
+ KotlinJvmBundle.message("kotlin.code.style"),
"${KotlinJvmBundle.message("default.code.style.was.updated.to.kotlin.coding.conventions")}",
NotificationType.WARNING,
null
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/CommonStandardLibraryDescription.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/CommonStandardLibraryDescription.kt
index 5dd46e59aa6..6829521b93b 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/CommonStandardLibraryDescription.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/CommonStandardLibraryDescription.kt
@@ -14,8 +14,8 @@ class CommonStandardLibraryDescription(project: Project?) : CustomLibraryDescrip
project, "common", LIBRARY_NAME, DIALOG_TITLE, LIBRARY_CAPTION, KOTLIN_COMMON_STDLIB_KIND, SUITABLE_LIBRARY_KINDS
) {
companion object {
- val KOTLIN_COMMON_STDLIB_KIND = LibraryKind.create("kotlin-stdlib-common")
- val LIBRARY_NAME = "KotlinStdlibCommon"
+ val KOTLIN_COMMON_STDLIB_KIND: LibraryKind = LibraryKind.create("kotlin-stdlib-common")
+ const val LIBRARY_NAME = "KotlinStdlibCommon"
val DIALOG_TITLE get() = KotlinJvmBundle.message("create.kotlin.common.standard.library")
val LIBRARY_CAPTION get() = KotlinJvmBundle.message("kotlin.common.standard.library")
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/CustomLibraryDescriptorWithDeferredConfig.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/CustomLibraryDescriptorWithDeferredConfig.kt
index ae9ab9b1a89..dea61b345eb 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/CustomLibraryDescriptorWithDeferredConfig.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/CustomLibraryDescriptorWithDeferredConfig.kt
@@ -222,6 +222,6 @@ abstract class CustomLibraryDescriptorWithDeferredConfig(
companion object {
- private val DEFAULT_LIB_DIR_NAME = "lib"
+ private const val DEFAULT_LIB_DIR_NAME = "lib"
}
}
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JSLibraryStdDescription.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JSLibraryStdDescription.kt
index c56b6587878..98b12789697 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JSLibraryStdDescription.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JSLibraryStdDescription.kt
@@ -30,7 +30,7 @@ class JSLibraryStdDescription(project: Project?) : CustomLibraryDescriptorWithDe
}
companion object {
- val LIBRARY_NAME = "KotlinJavaScript"
+ const val LIBRARY_NAME = "KotlinJavaScript"
val JAVA_SCRIPT_LIBRARY_CREATION get() = KotlinJvmBundle.message("javascript.library.creation")
val DIALOG_TITLE get() = KotlinJvmBundle.message("create.kotlin.javascript.library")
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JSLibraryType.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JSLibraryType.kt
index bd5f73fee93..1759ce1afae 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JSLibraryType.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JSLibraryType.kt
@@ -69,7 +69,7 @@ class JSLibraryType : LibraryType(JSLibraryKind) {
object JSRootFilter : FileTypeBasedRootFilter(
OrderRootType.CLASSES, false, PlainTextFileType.INSTANCE,
- KotlinJvmBundle.message("js.files")
+ KotlinJvmBundle.message("presentable.type.js.files")
) {
override fun isFileAccepted(virtualFile: VirtualFile) = isAcceptedForJsLibrary(virtualFile.extension)
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JavaFrameworkSupportProvider.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JavaFrameworkSupportProvider.kt
index 6adbbd4bf95..64f3cfc2acb 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JavaFrameworkSupportProvider.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JavaFrameworkSupportProvider.kt
@@ -48,7 +48,7 @@ class JavaFrameworkSupportProvider : FrameworkSupportInModuleProvider() {
FrameworksCompatibilityUtils.suggestRemoveIncompatibleFramework(
rootModel,
JSLibraryStdDescription.SUITABLE_LIBRARY_KINDS,
- KotlinJvmBundle.message("kotlin.js")
+ KotlinJvmBundle.message("presentable.name.kotlin.js")
)
description!!.finishLibConfiguration(module, rootModel, false)
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JavaFrameworkType.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JavaFrameworkType.kt
index f504c03b4c0..f5e95ab0fdb 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JavaFrameworkType.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JavaFrameworkType.kt
@@ -19,13 +19,14 @@ package org.jetbrains.kotlin.idea.framework
import com.intellij.framework.FrameworkTypeEx
import com.intellij.framework.addSupport.FrameworkSupportInModuleProvider
import org.jetbrains.kotlin.idea.KotlinIcons
+import org.jetbrains.kotlin.idea.KotlinJvmBundle
import javax.swing.Icon
class JavaFrameworkType : FrameworkTypeEx("kotlin-java-framework-id") {
override fun createProvider(): FrameworkSupportInModuleProvider = JavaFrameworkSupportProvider()
- override fun getPresentableName() = "Kotlin/JVM"
+ override fun getPresentableName() = KotlinJvmBundle.message("presentable.name.kotlin.jvm")
override fun getIcon(): Icon = KotlinIcons.SMALL_LOGO
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JavaRuntimeLibraryDescription.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JavaRuntimeLibraryDescription.kt
index 9a1570a17be..84c0f804a39 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JavaRuntimeLibraryDescription.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/JavaRuntimeLibraryDescription.kt
@@ -37,8 +37,8 @@ class JavaRuntimeLibraryDescription(project: Project?) : CustomLibraryDescriptor
}
companion object {
- val KOTLIN_JAVA_RUNTIME_KIND = LibraryKind.create("kotlin-java-runtime")
- val LIBRARY_NAME = "KotlinJavaRuntime"
+ val KOTLIN_JAVA_RUNTIME_KIND: LibraryKind = LibraryKind.create("kotlin-java-runtime")
+ const val LIBRARY_NAME = "KotlinJavaRuntime"
val JAVA_RUNTIME_LIBRARY_CREATION get() = KotlinJvmBundle.message("java.runtime.library.creation")
val DIALOG_TITLE get() = KotlinJvmBundle.message("create.kotlin.java.runtime.library")
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/KotlinModuleBuilder.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/KotlinModuleBuilder.kt
index d826d61ece2..971d7f5995d 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/KotlinModuleBuilder.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/KotlinModuleBuilder.kt
@@ -12,6 +12,8 @@ import com.intellij.ide.util.projectWizard.WizardContext
import com.intellij.openapi.projectRoots.SdkTypeId
import com.intellij.openapi.roots.ModifiableRootModel
import com.intellij.openapi.roots.ui.configuration.ModulesProvider
+import org.jetbrains.annotations.Nls
+import org.jetbrains.annotations.NonNls
import org.jetbrains.kotlin.idea.roots.migrateNonJvmSourceFolders
import org.jetbrains.kotlin.idea.statistics.NewProjectWizardsFUSCollector
import org.jetbrains.kotlin.platform.TargetPlatform
@@ -19,13 +21,17 @@ import org.jetbrains.kotlin.platform.jvm.isJvm
import javax.swing.Icon
class KotlinModuleBuilder(
- val targetPlatform: TargetPlatform, val builderName: String, val builderDescription: String, val icon: Icon
+ val targetPlatform: TargetPlatform,
+ @NonNls private val builderName: String,
+ @Nls private val builderPresentableName: String,
+ @Nls private val builderDescription: String,
+ val icon: Icon
) : JavaModuleBuilder() {
private var wizardContext: WizardContext? = null
override fun getBuilderId() = "kotlin.module.builder"
override fun getName() = builderName
- override fun getPresentableName() = builderName
+ override fun getPresentableName() = builderPresentableName
override fun getDescription() = builderDescription
override fun getNodeIcon() = icon
override fun getGroupName() = KotlinTemplatesFactory.KOTLIN_GROUP_NAME
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/KotlinTemplatesFactory.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/KotlinTemplatesFactory.kt
index e209cfeb5e3..1163ae79c1b 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/KotlinTemplatesFactory.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/KotlinTemplatesFactory.kt
@@ -21,8 +21,8 @@ class KotlinTemplatesFactory : ProjectTemplatesFactory() {
companion object {
val EP_NAME = ExtensionPointName.create("org.jetbrains.kotlin.moduleBuilder")
- val KOTLIN_GROUP_NAME: String = "Kotlin"
- val KOTLIN_PARENT_GROUP_NAME = "Kotlin Group"
+ const val KOTLIN_GROUP_NAME: String = "Kotlin"
+ const val KOTLIN_PARENT_GROUP_NAME = "Kotlin Group"
}
override fun getGroups() = arrayOf(KOTLIN_GROUP_NAME)
@@ -36,6 +36,7 @@ class KotlinTemplatesFactory : ProjectTemplatesFactory() {
KotlinModuleBuilder(
JvmPlatforms.unspecifiedJvmPlatform,
"JVM | IDEA",
+ KotlinJvmBundle.message("presentable.name.jvm.idea"),
KotlinJvmBundle.message("kotlin.project.with.a.jvm.target.based.on.the.intellij.idea.build.system"),
KotlinIcons.SMALL_LOGO
)
@@ -43,7 +44,9 @@ class KotlinTemplatesFactory : ProjectTemplatesFactory() {
BuilderBasedTemplate(
KotlinModuleBuilder(
- JsPlatforms.defaultJsPlatform, "JS | IDEA",
+ JsPlatforms.defaultJsPlatform,
+ "JS | IDEA",
+ KotlinJvmBundle.message("presentable.name.js.idea"),
KotlinJvmBundle.message("kotlin.project.with.a.javascript.target.based.on.the.intellij.idea.build.system"),
KotlinIcons.JS
)
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/ui/ChooseLibraryPathPanel.form b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/ui/ChooseLibraryPathPanel.form
index 6bc548492ff..56a8a7dcaff 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/ui/ChooseLibraryPathPanel.form
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/ui/ChooseLibraryPathPanel.form
@@ -21,7 +21,7 @@
-
+
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/ui/CreateLibraryDialog.java b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/ui/CreateLibraryDialog.java
index c043843fc9a..e25d004d080 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/ui/CreateLibraryDialog.java
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/ui/CreateLibraryDialog.java
@@ -16,11 +16,12 @@
package org.jetbrains.kotlin.idea.framework.ui;
+import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
public class CreateLibraryDialog extends CreateLibraryDialogBase {
- public CreateLibraryDialog(@NotNull String defaultPath, @NotNull String title, @NotNull String libraryCaption) {
+ public CreateLibraryDialog(@NotNull String defaultPath, @Nls @NotNull String title, @Nls @NotNull String libraryCaption) {
super(null, defaultPath, title, libraryCaption);
updateComponents();
}
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/ui/CreateLibraryDialogBase.java b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/ui/CreateLibraryDialogBase.java
index 64d608bee28..f5d7a2feb82 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/ui/CreateLibraryDialogBase.java
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/framework/ui/CreateLibraryDialogBase.java
@@ -19,6 +19,7 @@ package org.jetbrains.kotlin.idea.framework.ui;
import com.intellij.openapi.project.Project;
import com.intellij.openapi.ui.DialogWrapper;
import com.intellij.ui.SeparatorWithText;
+import org.jetbrains.annotations.Nls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import org.jetbrains.kotlin.idea.versions.KotlinRuntimeLibraryUtilKt;
@@ -40,8 +41,8 @@ public abstract class CreateLibraryDialogBase extends DialogWrapper {
public CreateLibraryDialogBase(
@Nullable Project project,
@NotNull String defaultPath,
- @NotNull String title,
- @NotNull String libraryCaption
+ @Nls @NotNull String title,
+ @Nls @NotNull String libraryCaption
) {
super(project);
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/injection/KotlinLanguageInjectionSupport.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/injection/KotlinLanguageInjectionSupport.kt
index 26d9e49a8b9..8a1adc2dc60 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/injection/KotlinLanguageInjectionSupport.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/injection/KotlinLanguageInjectionSupport.kt
@@ -74,7 +74,7 @@ class KotlinLanguageInjectionSupport : AbstractLanguageInjectionSupport() {
TemporaryPlacesRegistry.getInstance(project).removeHostWithUndo(project, psiElement)
- project.executeWriteCommand(KotlinJvmBundle.message("remove.injection.in.code.instructions")) {
+ project.executeWriteCommand(KotlinJvmBundle.message("command.action.remove.injection.in.code.instructions")) {
injectInstructions.forEach(PsiElement::delete)
}
@@ -172,7 +172,7 @@ private fun addInjectionInstructionInCode(language: Language, host: PsiLanguageI
val modifierListOwner = findElementToInjectWithAnnotation(ktHost)
if (modifierListOwner != null && canInjectWithAnnotation(ktHost)) {
- project.executeWriteCommand(KotlinJvmBundle.message("add.injection.annotation")) {
+ project.executeWriteCommand(KotlinJvmBundle.message("command.action.add.injection.annotation")) {
modifierListOwner.addAnnotation(FqName(AnnotationUtil.LANGUAGE), "\"${language.id}\"")
}
@@ -186,7 +186,7 @@ private fun addInjectionInstructionInCode(language: Language, host: PsiLanguageI
val psiFactory = KtPsiFactory(project)
val injectComment = psiFactory.createComment("//language=" + language.id)
- project.executeWriteCommand(KotlinJvmBundle.message("add.injection.comment")) {
+ project.executeWriteCommand(KotlinJvmBundle.message("command.action.add.injection.comment")) {
commentBeforeAnchor.parent.addBefore(injectComment, commentBeforeAnchor)
}
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/injection/KotlinLanguageInjectionSupport.kt.191 b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/injection/KotlinLanguageInjectionSupport.kt.191
index 76a9d9c6d44..5a029a6bd56 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/injection/KotlinLanguageInjectionSupport.kt.191
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/injection/KotlinLanguageInjectionSupport.kt.191
@@ -1,17 +1,6 @@
/*
- * Copyright 2010-2016 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.injection
@@ -85,7 +74,7 @@ class KotlinLanguageInjectionSupport : AbstractLanguageInjectionSupport() {
TemporaryPlacesRegistry.getInstance(project).removeHostWithUndo(project, psiElement)
- project.executeWriteCommand(KotlinJvmBundle.message("remove.injection.in.code.instructions")) {
+ project.executeWriteCommand(KotlinJvmBundle.message("command.action.remove.injection.in.code.instructions")) {
injectInstructions.forEach(PsiElement::delete)
}
@@ -184,7 +173,7 @@ private fun addInjectionInstructionInCode(language: Language, host: PsiLanguageI
val modifierListOwner = findElementToInjectWithAnnotation(ktHost)
if (modifierListOwner != null && canInjectWithAnnotation(ktHost)) {
- project.executeWriteCommand(KotlinJvmBundle.message("add.injection.annotation")) {
+ project.executeWriteCommand(KotlinJvmBundle.message("command.action.add.injection.annotation")) {
modifierListOwner.addAnnotation(FqName(AnnotationUtil.LANGUAGE), "\"${language.id}\"")
}
@@ -200,7 +189,7 @@ private fun addInjectionInstructionInCode(language: Language, host: PsiLanguageI
val psiFactory = KtPsiFactory(project)
val injectComment = psiFactory.createComment("//language=" + language.id)
- project.executeWriteCommand(KotlinJvmBundle.message("add.injection.comment")) {
+ project.executeWriteCommand(KotlinJvmBundle.message("command.action.add.injection.comment")) {
commentBeforeAnchor.parent.addBefore(injectComment, commentBeforeAnchor)
}
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/inspections/api/AddToIncompatibleApiDialog.form b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/inspections/api/AddToIncompatibleApiDialog.form
index d513495f5f5..883ec7d1b6f 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/inspections/api/AddToIncompatibleApiDialog.form
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/inspections/api/AddToIncompatibleApiDialog.form
@@ -24,7 +24,7 @@
-
+
@@ -44,7 +44,7 @@
-
+
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/inspections/api/IncompatibleAPIInspection.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/inspections/api/IncompatibleAPIInspection.kt
index 444b7fc21d8..565959aa2a8 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/inspections/api/IncompatibleAPIInspection.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/inspections/api/IncompatibleAPIInspection.kt
@@ -64,7 +64,7 @@ class IncompatibleAPIInspection : LocalInspectionTool() {
companion object {
const val SHORT_NAME = "IncompatibleAPI"
- val DEFAULT_REASON get() = KotlinJvmBundle.message("incompatible.api")
+ val DEFAULT_REASON get() = KotlinJvmBundle.message("reason.incompatible.api")
}
}
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.kt
index 4f0c2ba2b76..628a64df85b 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/KotlinBytecodeToolWindow.kt
@@ -181,7 +181,7 @@ class KotlinBytecodeToolWindow(private val myProject: Project, private val toolW
val optionPanel = JPanel(FlowLayout())
add(optionPanel, BorderLayout.NORTH)
- decompile = JButton(KotlinJvmBundle.message("decompile"))
+ decompile = JButton(KotlinJvmBundle.message("button.text.decompile"))
if (KotlinDecompilerService.getInstance() != null) {
optionPanel.add(decompile)
decompile.addActionListener {
@@ -204,11 +204,11 @@ class KotlinBytecodeToolWindow(private val myProject: Project, private val toolW
}
/*TODO: try to extract default parameter from compiler options*/
- enableInline = JCheckBox(KotlinJvmBundle.message("inline"), true)
- enableOptimization = JCheckBox(KotlinJvmBundle.message("optimization"), true)
- enableAssertions = JCheckBox(KotlinJvmBundle.message("assertions"), true)
- jvm8Target = JCheckBox(KotlinJvmBundle.message("jvm.8.target"), false)
- ir = JCheckBox(KotlinJvmBundle.message("ir"), false)
+ enableInline = JCheckBox(KotlinJvmBundle.message("checkbox.text.inline"), true)
+ enableOptimization = JCheckBox(KotlinJvmBundle.message("checkbox.text.optimization"), true)
+ enableAssertions = JCheckBox(KotlinJvmBundle.message("checkbox.text.assertions"), true)
+ jvm8Target = JCheckBox(KotlinJvmBundle.message("checkbox.text.jvm.8.target"), false)
+ ir = JCheckBox(KotlinJvmBundle.message("checkbox.text.ir"), false)
optionPanel.add(enableInline)
optionPanel.add(enableOptimization)
optionPanel.add(enableAssertions)
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/makeBackup/CreateIncrementalCompilationBackup.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/makeBackup/CreateIncrementalCompilationBackup.kt
index 242d50c44c1..7e48e8d8d58 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/makeBackup/CreateIncrementalCompilationBackup.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/makeBackup/CreateIncrementalCompilationBackup.kt
@@ -48,7 +48,8 @@ class CreateIncrementalCompilationBackup : AnAction(KotlinJvmBundle.message("cre
ProgressManager.getInstance().run(
object : Task.Backgroundable(
project,
- KotlinJvmBundle.message("creating.backup.for.debugging.kotlin.incremental.compilation"), true
+ KotlinJvmBundle.message("creating.backup.for.debugging.kotlin.incremental.compilation"),
+ true
) {
override fun run(indicator: ProgressIndicator) {
createPatches(backupDir, project, indicator)
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/makeBackup/CreateIncrementalCompilationBackup.kt.192 b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/makeBackup/CreateIncrementalCompilationBackup.kt.192
index 33b305e728f..e124ebdb671 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/makeBackup/CreateIncrementalCompilationBackup.kt.192
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/internal/makeBackup/CreateIncrementalCompilationBackup.kt.192
@@ -1,17 +1,6 @@
/*
- * Copyright 2010-2015 JetBrains s.r.o.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.idea.internal.makeBackup
@@ -59,7 +48,8 @@ class CreateIncrementalCompilationBackup : AnAction(KotlinJvmBundle.message("cre
ProgressManager.getInstance().run(
object : Task.Backgroundable(
project,
- KotlinJvmBundle.message("creating.backup.for.debugging.kotlin.incremental.compilation"), true
+ KotlinJvmBundle.message("creating.backup.for.debugging.kotlin.incremental.compilation"),
+ true
) {
override fun run(indicator: ProgressIndicator) {
createPatches(backupDir, project, indicator)
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/quickfix/ChangeCoroutineSupportFix.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/quickfix/ChangeCoroutineSupportFix.kt
index b5d60e3c55d..7f5d309ef6f 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/quickfix/ChangeCoroutineSupportFix.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/quickfix/ChangeCoroutineSupportFix.kt
@@ -13,6 +13,7 @@ import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.diagnostics.Diagnostic
+import org.jetbrains.kotlin.idea.KotlinJvmBundle
import org.jetbrains.kotlin.idea.compiler.configuration.KotlinCommonCompilerArgumentsHolder
import org.jetbrains.kotlin.idea.configuration.findApplicableConfigurator
import org.jetbrains.kotlin.idea.roots.invalidateProjectRoots
@@ -24,7 +25,7 @@ sealed class ChangeCoroutineSupportFix(
) : AbstractChangeFeatureSupportLevelFix(element, LanguageFeature.Coroutines, coroutineSupport, shortFeatureName) {
class InModule(element: PsiElement, coroutineSupport: LanguageFeature.State) : ChangeCoroutineSupportFix(element, coroutineSupport) {
- override fun getText() = "${super.getText()} in the current module"
+ override fun getText() = KotlinJvmBundle.message("fix.0.in.current.module", super.getText())
override fun invoke(project: Project, editor: Editor?, file: KtFile) {
val module = ModuleUtilCore.findModuleForPsiElement(file) ?: return
@@ -34,7 +35,7 @@ sealed class ChangeCoroutineSupportFix(
}
class InProject(element: PsiElement, coroutineSupport: LanguageFeature.State) : ChangeCoroutineSupportFix(element, coroutineSupport) {
- override fun getText() = "${super.getText()} in the project"
+ override fun getText() = KotlinJvmBundle.message("fix.0.in.the.project", super.getText())
override fun invoke(project: Project, editor: Editor?, file: KtFile) {
if (featureSupportEnabled) {
@@ -54,7 +55,7 @@ sealed class ChangeCoroutineSupportFix(
}
companion object : FeatureSupportIntentionActionsFactory() {
- private const val shortFeatureName = "coroutine"
+ private val shortFeatureName get() = KotlinJvmBundle.message("short.feature.name.coroutine")
fun getFixText(state: LanguageFeature.State) = getFixText(state, shortFeatureName)
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/quickfix/ChangeGeneralLanguageFeatureSupportFix.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/quickfix/ChangeGeneralLanguageFeatureSupportFix.kt
index c915203c35b..a1e5592dd79 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/quickfix/ChangeGeneralLanguageFeatureSupportFix.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/quickfix/ChangeGeneralLanguageFeatureSupportFix.kt
@@ -14,12 +14,10 @@ import com.intellij.psi.PsiElement
import org.jetbrains.kotlin.cli.common.arguments.CliArgumentStringBuilder.replaceLanguageFeature
import org.jetbrains.kotlin.config.LanguageFeature
import org.jetbrains.kotlin.diagnostics.Diagnostic
+import org.jetbrains.kotlin.idea.KotlinJvmBundle
import org.jetbrains.kotlin.idea.compiler.configuration.KotlinCompilerSettings
-import org.jetbrains.kotlin.idea.configuration.BuildSystemType
import org.jetbrains.kotlin.idea.configuration.findApplicableConfigurator
-import org.jetbrains.kotlin.idea.configuration.getBuildSystemType
import org.jetbrains.kotlin.idea.core.isInTestSourceContentKotlinAware
-import org.jetbrains.kotlin.idea.facet.KotlinFacet
import org.jetbrains.kotlin.idea.facet.getCleanRuntimeLibraryVersion
import org.jetbrains.kotlin.idea.roots.invalidateProjectRoots
import org.jetbrains.kotlin.idea.util.module
@@ -36,7 +34,7 @@ sealed class ChangeGeneralLanguageFeatureSupportFix(
feature: LanguageFeature,
featureSupport: LanguageFeature.State
) : ChangeGeneralLanguageFeatureSupportFix(element, feature, featureSupport) {
- override fun getText() = "${super.getText()} in the current module"
+ override fun getText() = KotlinJvmBundle.message("fix.0.in.current.module", super.getText())
override fun invoke(project: Project, editor: Editor?, file: KtFile) {
val module = ModuleUtilCore.findModuleForPsiElement(file) ?: return
@@ -51,7 +49,7 @@ sealed class ChangeGeneralLanguageFeatureSupportFix(
feature: LanguageFeature,
featureSupport: LanguageFeature.State
) : ChangeGeneralLanguageFeatureSupportFix(element, feature, featureSupport) {
- override fun getText() = "${super.getText()} in the project"
+ override fun getText() = KotlinJvmBundle.message("fix.0.in.the.project", super.getText())
override fun invoke(project: Project, editor: Editor?, file: KtFile) {
if (featureSupportEnabled) {
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/quickfix/EnableUnsupportedFeatureFix.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/quickfix/EnableUnsupportedFeatureFix.kt
index c6af5a6f9a6..bf00531efd4 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/quickfix/EnableUnsupportedFeatureFix.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/quickfix/EnableUnsupportedFeatureFix.kt
@@ -36,17 +36,24 @@ import org.jetbrains.kotlin.psi.KtFile
sealed class EnableUnsupportedFeatureFix(
element: PsiElement,
protected val feature: LanguageFeature,
- protected val apiVersionOnly: Boolean
+ protected val apiVersionOnly: Boolean,
+ protected val isModule: Boolean,
) : KotlinQuickFixAction(element) {
+ override fun getFamilyName() = KotlinJvmBundle.message(
+ "enable.feature.family",
+ 0.takeIf { isModule } ?: 1,
+ 0.takeIf { apiVersionOnly } ?: 1
+ )
+
+ override fun getText() = KotlinJvmBundle.message(
+ "enable.feature.text",
+ 0.takeIf { isModule } ?: 1,
+ 0.takeIf { apiVersionOnly } ?: 1,
+ if (apiVersionOnly) feature.sinceApiVersion.versionString else feature.sinceVersion?.versionString.toString()
+ )
+
class InModule(element: PsiElement, feature: LanguageFeature, apiVersionOnly: Boolean) :
- EnableUnsupportedFeatureFix(element, feature, apiVersionOnly) {
- override fun getFamilyName() = "Increase module " + if (apiVersionOnly) "API version" else "language version"
-
- override fun getText() = if (apiVersionOnly)
- "Set module API version to ${feature.sinceApiVersion.versionString}"
- else
- "Set module language version to ${feature.sinceVersion!!.description}"
-
+ EnableUnsupportedFeatureFix(element, feature, apiVersionOnly, isModule = true) {
override fun invoke(project: Project, editor: Editor?, file: KtFile) {
val module = ModuleUtilCore.findModuleForPsiElement(file) ?: return
@@ -70,14 +77,7 @@ sealed class EnableUnsupportedFeatureFix(
}
class InProject(element: PsiElement, feature: LanguageFeature, apiVersionOnly: Boolean) :
- EnableUnsupportedFeatureFix(element, feature, apiVersionOnly) {
- override fun getFamilyName() = "Increase project " + if (apiVersionOnly) "API version" else "language version"
-
- override fun getText() = if (apiVersionOnly)
- "Set project API version to ${feature.sinceApiVersion.versionString}"
- else
- "Set project language version to ${feature.sinceVersion!!.versionString}"
-
+ EnableUnsupportedFeatureFix(element, feature, apiVersionOnly, isModule = false) {
override fun invoke(project: Project, editor: Editor?, file: KtFile) {
val targetVersion = feature.sinceVersion!!
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/run/KotlinRunConfigurationType.java b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/run/KotlinRunConfigurationType.java
index 2069a2b8b6a..1dc23c0b22d 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/run/KotlinRunConfigurationType.java
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/run/KotlinRunConfigurationType.java
@@ -24,7 +24,7 @@ import com.intellij.openapi.project.Project;
import com.intellij.openapi.util.NotNullLazyValue;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.kotlin.idea.KotlinIcons;
-import org.jetbrains.kotlin.idea.KotlinLanguage;
+import org.jetbrains.kotlin.idea.KotlinJvmBundle;
public class KotlinRunConfigurationType extends SimpleConfigurationType {
public static KotlinRunConfigurationType getInstance() {
@@ -33,8 +33,8 @@ public class KotlinRunConfigurationType extends SimpleConfigurationType {
public KotlinRunConfigurationType() {
super("JetRunConfigurationType",
- KotlinLanguage.NAME,
- KotlinLanguage.NAME,
+ KotlinJvmBundle.message("language.name.kotlin"),
+ KotlinJvmBundle.message("language.name.kotlin"),
NotNullLazyValue.createValue(() -> KotlinIcons.SMALL_LOGO));
}
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/run/script/standalone/KotlinStandaloneScriptRunConfigurationEditor.form b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/run/script/standalone/KotlinStandaloneScriptRunConfigurationEditor.form
index 1fcfe4a9db6..60e62545d06 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/run/script/standalone/KotlinStandaloneScriptRunConfigurationEditor.form
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/run/script/standalone/KotlinStandaloneScriptRunConfigurationEditor.form
@@ -31,7 +31,7 @@
-
+
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/run/script/standalone/KotlinStandaloneScriptRunConfigurationType.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/run/script/standalone/KotlinStandaloneScriptRunConfigurationType.kt
index 59b52d21f38..4ae4fbf2be8 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/run/script/standalone/KotlinStandaloneScriptRunConfigurationType.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/run/script/standalone/KotlinStandaloneScriptRunConfigurationType.kt
@@ -15,7 +15,7 @@ import org.jetbrains.kotlin.idea.KotlinJvmBundle
class KotlinStandaloneScriptRunConfigurationType : SimpleConfigurationType(
"KotlinStandaloneScriptRunConfigurationType",
- KotlinJvmBundle.message("kotlin.script"),
+ KotlinJvmBundle.message("name.kotlin.script"),
KotlinJvmBundle.message("run.kotlin.script"),
NotNullLazyValue.createValue { KotlinIcons.SMALL_LOGO }
) {
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/repl/KtScratchReplExecutor.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/repl/KtScratchReplExecutor.kt
index 6d3b2c4ca90..3e461367bd2 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/repl/KtScratchReplExecutor.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/scratch/repl/KtScratchReplExecutor.kt
@@ -93,7 +93,7 @@ class KtScratchReplExecutor(file: ScratchFile) : SequentialScratchExecutor(file)
}
private fun sendCommandToProcess(command: String) {
- LOG.printDebugMessage("Send to REPL: ${command}")
+ LOG.printDebugMessage("Send to REPL: $command")
val processInputOS = osProcessHandler?.processInput ?: return logError(this::class.java, "Broken execute stream
")
val charset = osProcessHandler?.charset ?: Charsets.UTF_8
@@ -203,16 +203,15 @@ class KtScratchReplExecutor(file: ScratchFile) : SequentialScratchExecutor(file)
}
}
- private fun parseReplOutput(text: String, outputType: String): ScratchOutput? {
- return when (outputType) {
- "USER_OUTPUT" -> ScratchOutput(text, ScratchOutputType.OUTPUT)
- "REPL_RESULT" -> ScratchOutput(text, ScratchOutputType.RESULT)
- "REPL_INCOMPLETE",
- "INTERNAL_ERROR",
- "COMPILE_ERROR",
- "RUNTIME_ERROR" -> ScratchOutput(text, ScratchOutputType.ERROR)
- else -> null
- }
+ private fun parseReplOutput(text: String, outputType: String): ScratchOutput? = when (outputType) {
+ "USER_OUTPUT" -> ScratchOutput(text, ScratchOutputType.OUTPUT)
+ "REPL_RESULT" -> ScratchOutput(text, ScratchOutputType.RESULT)
+ "REPL_INCOMPLETE",
+ "INTERNAL_ERROR",
+ "COMPILE_ERROR",
+ "RUNTIME_ERROR",
+ -> ScratchOutput(text, ScratchOutputType.ERROR)
+ else -> null
}
}
}
\ No newline at end of file
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/vcs/BunchCheckinHandler.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/vcs/BunchCheckinHandler.kt
index 60c2bbc9152..1434a8e87b9 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/vcs/BunchCheckinHandler.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/vcs/BunchCheckinHandler.kt
@@ -106,9 +106,11 @@ class BunchFileCheckInHandlerFactory : CheckinHandlerFactory() {
"several.bunch.files.haven.t.been.updated.0.do.you.want.to.review.them.before.commit",
filePaths.joinToString("\n")
),
- KotlinJvmBundle.message("forgotten.bunch.files"),
- KotlinJvmBundle.message("review"),
- KotlinJvmBundle.message("commit"), CommonBundle.getCancelButtonText(), Messages.getWarningIcon()
+ KotlinJvmBundle.message("button.text.forgotten.bunch.files"),
+ KotlinJvmBundle.message("button.text.review"),
+ KotlinJvmBundle.message("button.text.commit"),
+ CommonBundle.getCancelButtonText(),
+ Messages.getWarningIcon()
)) {
YES -> {
return ReturnResult.CLOSE_WINDOW
@@ -132,7 +134,7 @@ object BunchFileUtils {
val file = File(bunchFile.path)
if (!file.exists()) return null
- val lines = file.readLines().map { it.trim() }.filter { !it.isEmpty() }
+ val lines = file.readLines().map { it.trim() }.filter { it.isNotEmpty() }
if (lines.size <= 1) return null
return lines.drop(1).map { it.split('_').first() }
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/vcs/BunchCheckinHandler.kt.192 b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/vcs/BunchCheckinHandler.kt.192
index 87886118dde..b9b51209743 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/vcs/BunchCheckinHandler.kt.192
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/vcs/BunchCheckinHandler.kt.192
@@ -1,5 +1,5 @@
/*
- * Copyright 2010-2018 JetBrains s.r.o. and Kotlin Programming Language contributors.
+ * Copyright 2010-2020 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
@@ -103,9 +103,11 @@ class BunchFileCheckInHandlerFactory : CheckinHandlerFactory() {
"several.bunch.files.haven.t.been.updated.0.do.you.want.to.review.them.before.commit",
filePaths.joinToString("\n")
),
- KotlinJvmBundle.message("forgotten.bunch.files"),
- KotlinJvmBundle.message("review"),
- KotlinJvmBundle.message("commit"), CommonBundle.getCancelButtonText(), Messages.getWarningIcon()
+ KotlinJvmBundle.message("button.text.forgotten.bunch.files"),
+ KotlinJvmBundle.message("button.text.review"),
+ KotlinJvmBundle.message("button.text.commit"),
+ CommonBundle.getCancelButtonText(),
+ Messages.getWarningIcon()
)) {
YES -> {
return ReturnResult.CLOSE_WINDOW
@@ -129,7 +131,7 @@ object BunchFileUtils {
val file = File(bunchFile.path)
if (!file.exists()) return null
- val lines = file.readLines().map { it.trim() }.filter { !it.isEmpty() }
+ val lines = file.readLines().map { it.trim() }.filter { it.isNotEmpty() }
if (lines.size <= 1) return null
return lines.drop(1).map { it.split('_').first() }
diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.kt
index 1b9a4383fe4..2f7892bfd1f 100644
--- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.kt
+++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/versions/UnsupportedAbiVersionNotificationPanelProvider.kt
@@ -79,9 +79,9 @@ class UnsupportedAbiVersionNotificationPanelProvider(private val project: Projec
val isPluginNewForAllRuntimeLibraries = badRootsInRuntimeLibraries.all { it.supportedVersion > it.version }
val updateAction = when {
- isPluginNewForAllRuntimeLibraries -> KotlinJvmBundle.message("update")
- isPluginOldForAllRuntimeLibraries -> KotlinJvmBundle.message("downgrade")
- else -> KotlinJvmBundle.message("replace")
+ isPluginNewForAllRuntimeLibraries -> KotlinJvmBundle.message("button.text.update.library")
+ isPluginOldForAllRuntimeLibraries -> KotlinJvmBundle.message("button.text.downgrade.library")
+ else -> KotlinJvmBundle.message("button.text.replace.library")
}
val actionLabelText = "$updateAction " + KotlinJvmBundle.message(
@@ -124,7 +124,7 @@ class UnsupportedAbiVersionNotificationPanelProvider(private val project: Projec
}
}
- answer.createActionLabel(KotlinJvmBundle.message("go.to.0", presentableName)) {
+ answer.createActionLabel(KotlinJvmBundle.message("button.text.go.to.0", presentableName)) {
navigateToLibraryRoot(
project,
badVersionedRoot.file
@@ -149,7 +149,7 @@ class UnsupportedAbiVersionNotificationPanelProvider(private val project: Projec
}
- createShowPathsActionLabel(module, answer, KotlinJvmBundle.message("details"))
+ createShowPathsActionLabel(module, answer, KotlinJvmBundle.message("button.text.details"))
return answer
}
@@ -178,7 +178,10 @@ class UnsupportedAbiVersionNotificationPanelProvider(private val project: Projec
}
private fun createUpdatePluginLink(answer: ErrorNotificationPanel) {
- answer.createProgressAction(KotlinJvmBundle.message("check"), KotlinJvmBundle.message("update.plugin")) { link, updateLink ->
+ answer.createProgressAction(
+ KotlinJvmBundle.message("progress.action.text.check"),
+ KotlinJvmBundle.message("progress.action.text.update.plugin")
+ ) { link, updateLink ->
KotlinPluginUpdater.getInstance().runCachedUpdate { pluginUpdateStatus ->
when (pluginUpdateStatus) {
is PluginUpdateStatus.Update -> {