i18n: add bundle for j2k

This commit is contained in:
Dmitry Gridin
2020-02-20 16:46:16 +07:00
parent 540c0859c2
commit ddd6f81581
3 changed files with 24 additions and 3 deletions
@@ -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...
@@ -221,7 +221,7 @@ class OldJavaToKotlinConverter(
if (progress == null) error("Progress should not be null for old J2K")
val refs = ArrayList<ReferenceInfo>()
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()
@@ -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)
}