From 5bd44b73b2246a1826aaf7f7d2ff39df7ae5b4aa Mon Sep 17 00:00:00 2001 From: Dmitry Gridin Date: Tue, 10 Mar 2020 13:00:13 +0700 Subject: [PATCH] i18n: fix bundle location --- .../KotlinIdeaAnalysisBundle.properties | 2 ++ .../org/jetbrains/kotlin/idea/KotlinBundle.kt | 31 ------------------- .../kotlin/idea/KotlinIdeaAnalysisBundle.kt | 20 ++++++++++++ .../quickfix/KotlinSuppressIntentionAction.kt | 6 ++-- .../messages/KotlinBundle.properties | 3 -- .../org/jetbrains/kotlin/idea/KotlinBundle.kt | 20 ++++++++++++ 6 files changed, 45 insertions(+), 37 deletions(-) create mode 100644 idea/idea-analysis/resources/messages/KotlinIdeaAnalysisBundle.properties delete mode 100644 idea/idea-analysis/src/org/jetbrains/kotlin/idea/KotlinBundle.kt create mode 100644 idea/idea-analysis/src/org/jetbrains/kotlin/idea/KotlinIdeaAnalysisBundle.kt rename idea/{idea-analysis => }/resources/messages/KotlinBundle.properties (99%) create mode 100644 idea/src/org/jetbrains/kotlin/idea/KotlinBundle.kt diff --git a/idea/idea-analysis/resources/messages/KotlinIdeaAnalysisBundle.properties b/idea/idea-analysis/resources/messages/KotlinIdeaAnalysisBundle.properties new file mode 100644 index 00000000000..82f7f557b1c --- /dev/null +++ b/idea/idea-analysis/resources/messages/KotlinIdeaAnalysisBundle.properties @@ -0,0 +1,2 @@ +intention.suppress.family=Suppress Warnings +intention.suppress.text=Suppress ''{0}'' for {1} {2} \ No newline at end of file diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/KotlinBundle.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/KotlinBundle.kt deleted file mode 100644 index 1d9b788f5ce..00000000000 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/KotlinBundle.kt +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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. - */ -package org.jetbrains.kotlin.idea - -import org.jetbrains.annotations.NonNls -import org.jetbrains.annotations.PropertyKey -import org.jetbrains.kotlin.util.AbstractKotlinBundle - -@NonNls -private const val BUNDLE = "messages.KotlinBundle" - -object KotlinBundle : AbstractKotlinBundle(BUNDLE) { - @JvmStatic - fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params) - - @JvmStatic - fun lazyMessage(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): () -> String = { getMessage(key, *params) } -} \ No newline at end of file diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/KotlinIdeaAnalysisBundle.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/KotlinIdeaAnalysisBundle.kt new file mode 100644 index 00000000000..f93aa359dc0 --- /dev/null +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/KotlinIdeaAnalysisBundle.kt @@ -0,0 +1,20 @@ +/* + * 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 + +import org.jetbrains.annotations.NonNls +import org.jetbrains.annotations.PropertyKey +import org.jetbrains.kotlin.util.AbstractKotlinBundle + +@NonNls +private const val BUNDLE = "messages.KotlinIdeaAnalysisBundle" + +object KotlinIdeaAnalysisBundle : AbstractKotlinBundle(BUNDLE) { + @JvmStatic + fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params) + + @JvmStatic + fun lazyMessage(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): () -> String = { getMessage(key, *params) } +} \ No newline at end of file diff --git a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/quickfix/KotlinSuppressIntentionAction.kt b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/quickfix/KotlinSuppressIntentionAction.kt index 36afaa7bed2..48f1955ffb2 100644 --- a/idea/idea-analysis/src/org/jetbrains/kotlin/idea/quickfix/KotlinSuppressIntentionAction.kt +++ b/idea/idea-analysis/src/org/jetbrains/kotlin/idea/quickfix/KotlinSuppressIntentionAction.kt @@ -22,7 +22,7 @@ import com.intellij.openapi.editor.Editor import com.intellij.openapi.project.Project import com.intellij.psi.PsiElement import org.jetbrains.kotlin.builtins.KotlinBuiltIns -import org.jetbrains.kotlin.idea.KotlinBundle +import org.jetbrains.kotlin.idea.KotlinIdeaAnalysisBundle import org.jetbrains.kotlin.idea.caches.resolve.analyze import org.jetbrains.kotlin.idea.util.addAnnotation import org.jetbrains.kotlin.psi.* @@ -50,8 +50,8 @@ class KotlinSuppressIntentionAction private constructor( kind: AnnotationHostKind ) : this(suppressAt as PsiElement, suppressKey, kind) - override fun getFamilyName() = KotlinBundle.message("intention.suppress.family") - override fun getText() = KotlinBundle.message("intention.suppress.text", suppressKey, kind.kind, kind.name) + override fun getFamilyName() = KotlinIdeaAnalysisBundle.message("intention.suppress.family") + override fun getText() = KotlinIdeaAnalysisBundle.message("intention.suppress.text", suppressKey, kind.kind, kind.name) override fun isAvailable(project: Project, editor: Editor?, element: PsiElement) = element.isValid diff --git a/idea/idea-analysis/resources/messages/KotlinBundle.properties b/idea/resources/messages/KotlinBundle.properties similarity index 99% rename from idea/idea-analysis/resources/messages/KotlinBundle.properties rename to idea/resources/messages/KotlinBundle.properties index e5b33a35637..5436b0f7450 100644 --- a/idea/idea-analysis/resources/messages/KotlinBundle.properties +++ b/idea/resources/messages/KotlinBundle.properties @@ -236,9 +236,6 @@ intention.change.package.text=Change package intention.extract.declarations.from.file.text=Extract declaration from current file intention.extract.declarations.from.file.text.details=Extract ''{0}'' {1, choice, 0#|1#and subclasses }from current file -intention.suppress.family=Suppress Warnings -intention.suppress.text=Suppress ''{0}'' for {1} {2} - kotlin.compiler.option.generate.no.warnings=Report compiler &warnings kotlin.compiler.option.additional.command.line.parameters=&Additional command line parameters: kotlin.compiler.option.enable.new.inference.in.ide=Enable new type inference algorithm for IDE analysis diff --git a/idea/src/org/jetbrains/kotlin/idea/KotlinBundle.kt b/idea/src/org/jetbrains/kotlin/idea/KotlinBundle.kt new file mode 100644 index 00000000000..aa181c0c0a0 --- /dev/null +++ b/idea/src/org/jetbrains/kotlin/idea/KotlinBundle.kt @@ -0,0 +1,20 @@ +/* + * 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 + +import org.jetbrains.annotations.NonNls +import org.jetbrains.annotations.PropertyKey +import org.jetbrains.kotlin.util.AbstractKotlinBundle + +@NonNls +private const val BUNDLE = "messages.KotlinBundle" + +object KotlinBundle : AbstractKotlinBundle(BUNDLE) { + @JvmStatic + fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params) + + @JvmStatic + fun lazyMessage(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): () -> String = { getMessage(key, *params) } +} \ No newline at end of file