diff --git a/j2k/resources/messages/KotlinJ2KBundle.properties b/j2k/resources/messages/KotlinJ2KBundle.properties new file mode 100644 index 00000000000..5c6ce3f2b81 --- /dev/null +++ b/j2k/resources/messages/KotlinJ2KBundle.properties @@ -0,0 +1,3 @@ +text.converting.java.to.kotlin=Converting Java to Kotlin +text.pass.of.3=pass {0} of 3 +text.searching.usages.to.update=Searching usages to update... \ No newline at end of file diff --git a/j2k/src/org/jetbrains/kotlin/j2k/JavaToKotlinConverter.kt b/j2k/src/org/jetbrains/kotlin/j2k/JavaToKotlinConverter.kt index d13e80bb64b..2dfaca74136 100644 --- a/j2k/src/org/jetbrains/kotlin/j2k/JavaToKotlinConverter.kt +++ b/j2k/src/org/jetbrains/kotlin/j2k/JavaToKotlinConverter.kt @@ -221,7 +221,7 @@ class OldJavaToKotlinConverter( if (progress == null) error("Progress should not be null for old J2K") val refs = ArrayList() - progress.text = "Searching usages to update..." + progress.text = KotlinJ2KBundle.message("text.searching.usages.to.update") for ((i, entry) in map.entries.withIndex()) { val psiElement = entry.key @@ -307,7 +307,7 @@ class OldWithProgressProcessor(private val progress: ProgressIndicator?, private val DEFAULT = OldWithProgressProcessor(null, null) } - private val progressText = "Converting Java to Kotlin" + private val progressText = KotlinJ2KBundle.message("text.converting.java.to.kotlin") private val fileCount = files?.size ?: 0 private val fileCountText = fileCount.toString() + " " + if (fileCount > 1) "files" else "file" private var fraction = 0.0 @@ -322,7 +322,7 @@ class OldWithProgressProcessor(private val progress: ProgressIndicator?, private // we use special process with EmptyProgressIndicator to avoid changing text in our progress by inheritors search inside etc ProgressManager.getInstance().runProcess( { - progress?.text = "$progressText ($fileCountText) - pass $pass of 3" + progress?.text = "$progressText ($fileCountText) - ${KotlinJ2KBundle.message("text.pass.of.3", pass)}" for ((i, item) in inputItems.withIndex()) { progress?.checkCanceled() diff --git a/j2k/src/org/jetbrains/kotlin/j2k/KotlinJ2KBundle.kt b/j2k/src/org/jetbrains/kotlin/j2k/KotlinJ2KBundle.kt new file mode 100644 index 00000000000..6809ff38ab0 --- /dev/null +++ b/j2k/src/org/jetbrains/kotlin/j2k/KotlinJ2KBundle.kt @@ -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.j2k + +import org.jetbrains.annotations.NonNls +import org.jetbrains.annotations.PropertyKey +import org.jetbrains.kotlin.util.AbstractKotlinBundle + +@NonNls +private const val BUNDLE = "messages.KotlinJ2KBundle" + +object KotlinJ2KBundle : AbstractKotlinBundle(BUNDLE) { + @JvmStatic + fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params) +}