i18n: add bundle for idea/facet
This commit is contained in:
@@ -0,0 +1,14 @@
|
|||||||
|
checkbox.text.use.project.settings=Use project settings
|
||||||
|
column.name.options=Options
|
||||||
|
column.name.plugin=Plugin
|
||||||
|
error.text.at.least.one.target.platform.should.be.selected=At least one target platform should be selected
|
||||||
|
label.text.selected.target.platforms=Selected target platforms:
|
||||||
|
label.text.target.platform=Target platform:
|
||||||
|
label.text.the.project.is.imported.from.external.build.system.and.could.not.be.edited=The project is imported from external build system and could not be edited
|
||||||
|
link.text.edit.project.settings=Edit project settings
|
||||||
|
name.compiler.plugins=Compiler Plugins
|
||||||
|
name.general=General
|
||||||
|
text.following.arguments.are.redundant=Following arguments are redundant: {0}
|
||||||
|
text.following.arguments.override.facet.settings=Following arguments override facet settings: {0}
|
||||||
|
text.following.options.are.not.correct=Following options are not correct:
|
||||||
|
text.multiplatform=Multiplatform
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
/*
|
||||||
|
* 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.facet
|
||||||
|
|
||||||
|
import org.jetbrains.annotations.NonNls
|
||||||
|
import org.jetbrains.annotations.PropertyKey
|
||||||
|
import org.jetbrains.kotlin.util.AbstractKotlinBundle
|
||||||
|
|
||||||
|
@NonNls
|
||||||
|
private const val BUNDLE = "messages.KotlinFacetBundle"
|
||||||
|
|
||||||
|
object KotlinFacetBundle : AbstractKotlinBundle(BUNDLE) {
|
||||||
|
@JvmStatic
|
||||||
|
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||||
|
}
|
||||||
@@ -62,8 +62,8 @@ class KotlinFacetCompilerPluginsTab(
|
|||||||
override fun getColumnCount() = 2
|
override fun getColumnCount() = 2
|
||||||
|
|
||||||
override fun getColumnName(column: Int) = when (column) {
|
override fun getColumnName(column: Int) = when (column) {
|
||||||
0 -> "Plugin"
|
0 -> KotlinFacetBundle.message("column.name.plugin")
|
||||||
else -> "Options"
|
else -> KotlinFacetBundle.message("column.name.options")
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getColumnClass(columnIndex: Int) = String::class.java
|
override fun getColumnClass(columnIndex: Int) = String::class.java
|
||||||
@@ -118,7 +118,8 @@ class KotlinFacetCompilerPluginsTab(
|
|||||||
val invalidOptions = optionsByTable.filter { parsePluginOption(it) == null }
|
val invalidOptions = optionsByTable.filter { parsePluginOption(it) == null }
|
||||||
if (invalidOptions.isNotEmpty()) {
|
if (invalidOptions.isNotEmpty()) {
|
||||||
val message = buildString {
|
val message = buildString {
|
||||||
append("Following options are not correct: <br/>")
|
append(KotlinFacetBundle.message("text.following.options.are.not.correct"))
|
||||||
|
append(" <br/>")
|
||||||
invalidOptions.joinTo(this, "<br/>") { "<strong>$it</strong>" }
|
invalidOptions.joinTo(this, "<br/>") { "<strong>$it</strong>" }
|
||||||
}
|
}
|
||||||
return ValidationResult(message)
|
return ValidationResult(message)
|
||||||
@@ -140,7 +141,7 @@ class KotlinFacetCompilerPluginsTab(
|
|||||||
validatorsManager.registerValidator(OptionValidator())
|
validatorsManager.registerValidator(OptionValidator())
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getDisplayName() = "Compiler Plugins"
|
override fun getDisplayName() = KotlinFacetBundle.message("name.compiler.plugins")
|
||||||
|
|
||||||
override fun createComponent(): JComponent {
|
override fun createComponent(): JComponent {
|
||||||
val panel = JPanel(BorderLayout())
|
val panel = JPanel(BorderLayout())
|
||||||
|
|||||||
@@ -82,10 +82,11 @@ class KotlinFacetEditorGeneralTab(
|
|||||||
|
|
||||||
private fun FormBuilder.addTargetPlatformComponents(): FormBuilder {
|
private fun FormBuilder.addTargetPlatformComponents(): FormBuilder {
|
||||||
return if (configuration?.settings?.isHmppEnabled == true) {
|
return if (configuration?.settings?.isHmppEnabled == true) {
|
||||||
targetPlatformLabel.toolTipText = "The project is imported from external build system and could not be edited"
|
targetPlatformLabel.toolTipText =
|
||||||
this.addLabeledComponent("Selected target platforms:", targetPlatformLabel)
|
KotlinFacetBundle.message("label.text.the.project.is.imported.from.external.build.system.and.could.not.be.edited")
|
||||||
|
this.addLabeledComponent(KotlinFacetBundle.message("label.text.selected.target.platforms"), targetPlatformLabel)
|
||||||
} else {
|
} else {
|
||||||
this.addLabeledComponent("&Target platform: ", targetPlatformSelectSingleCombobox)
|
this.addLabeledComponent(KotlinFacetBundle.message("label.text.target.platform"), targetPlatformSelectSingleCombobox)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,7 +132,7 @@ class KotlinFacetEditorGeneralTab(
|
|||||||
isMultiEditor
|
isMultiEditor
|
||||||
)
|
)
|
||||||
|
|
||||||
useProjectSettingsCheckBox = ThreeStateCheckBox("Use project settings").apply { isThirdStateEnabled = isMultiEditor }
|
useProjectSettingsCheckBox = ThreeStateCheckBox(KotlinFacetBundle.message("checkbox.text.use.project.settings")).apply { isThirdStateEnabled = isMultiEditor }
|
||||||
dependsOnLabel = JLabel()
|
dependsOnLabel = JLabel()
|
||||||
|
|
||||||
targetPlatformWrappers = CommonPlatforms.allDefaultTargetPlatforms.sortedBy { unifyJvmVersion(it.oldFashionedDescription) }
|
targetPlatformWrappers = CommonPlatforms.allDefaultTargetPlatforms.sortedBy { unifyJvmVersion(it.oldFashionedDescription) }
|
||||||
@@ -151,14 +152,14 @@ class KotlinFacetEditorGeneralTab(
|
|||||||
text =
|
text =
|
||||||
(value as? TargetPlatformWrapper)?.targetPlatform?.componentPlatforms?.singleOrNull()
|
(value as? TargetPlatformWrapper)?.targetPlatform?.componentPlatforms?.singleOrNull()
|
||||||
?.oldFashionedDescription
|
?.oldFashionedDescription
|
||||||
?: "Multiplatform"
|
?: KotlinFacetBundle.message("text.multiplatform")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
targetPlatformSelectSingleCombobox.maximumRowCount =
|
targetPlatformSelectSingleCombobox.maximumRowCount =
|
||||||
targetPlatformsComboboxRowsCount(targetPlatformWrappers.size)
|
targetPlatformsComboboxRowsCount(targetPlatformWrappers.size)
|
||||||
projectSettingsLink = HoverHyperlinkLabel("Edit project settings").apply {
|
projectSettingsLink = HoverHyperlinkLabel(KotlinFacetBundle.message("link.text.edit.project.settings")).apply {
|
||||||
addHyperlinkListener {
|
addHyperlinkListener {
|
||||||
ShowSettingsUtilImpl.showSettingsDialog(project, compilerConfigurable.id, "")
|
ShowSettingsUtilImpl.showSettingsDialog(project, compilerConfigurable.id, "")
|
||||||
if (useProjectSettingsCheckBox.isSelected) {
|
if (useProjectSettingsCheckBox.isSelected) {
|
||||||
@@ -223,7 +224,7 @@ class KotlinFacetEditorGeneralTab(
|
|||||||
|
|
||||||
inner class ArgumentConsistencyValidator : FacetEditorValidator() {
|
inner class ArgumentConsistencyValidator : FacetEditorValidator() {
|
||||||
override fun check(): ValidationResult {
|
override fun check(): ValidationResult {
|
||||||
val platform = editor.getChosenPlatform() ?: return ValidationResult("At least one target platform should be selected")
|
val platform = editor.getChosenPlatform() ?: return ValidationResult(KotlinFacetBundle.message("error.text.at.least.one.target.platform.should.be.selected"))
|
||||||
val primaryArguments = platform.createArguments {
|
val primaryArguments = platform.createArguments {
|
||||||
editor.compilerConfigurable.applyTo(
|
editor.compilerConfigurable.applyTo(
|
||||||
this,
|
this,
|
||||||
@@ -259,13 +260,18 @@ class KotlinFacetEditorGeneralTab(
|
|||||||
if (overridingArguments.isNotEmpty() || redundantArguments.isNotEmpty()) {
|
if (overridingArguments.isNotEmpty() || redundantArguments.isNotEmpty()) {
|
||||||
val message = buildString {
|
val message = buildString {
|
||||||
if (overridingArguments.isNotEmpty()) {
|
if (overridingArguments.isNotEmpty()) {
|
||||||
append("Following arguments override facet settings: ${overridingArguments.joinToString()}")
|
append(
|
||||||
|
KotlinFacetBundle.message(
|
||||||
|
"text.following.arguments.override.facet.settings",
|
||||||
|
overridingArguments.joinToString()
|
||||||
|
)
|
||||||
|
)
|
||||||
}
|
}
|
||||||
if (redundantArguments.isNotEmpty()) {
|
if (redundantArguments.isNotEmpty()) {
|
||||||
if (isNotEmpty()) {
|
if (isNotEmpty()) {
|
||||||
append("<br/>")
|
append("<br/>")
|
||||||
}
|
}
|
||||||
append("Following arguments are redundant: ${redundantArguments.joinToString()}")
|
append(KotlinFacetBundle.message("text.following.arguments.are.redundant", redundantArguments.joinToString()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return ValidationResult(message)
|
return ValidationResult(message)
|
||||||
@@ -425,7 +431,7 @@ class KotlinFacetEditorGeneralTab(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getDisplayName() = "General"
|
override fun getDisplayName() = KotlinFacetBundle.message("name.general")
|
||||||
|
|
||||||
override fun createComponent(): JComponent {
|
override fun createComponent(): JComponent {
|
||||||
return editor
|
return editor
|
||||||
|
|||||||
Reference in New Issue
Block a user