i18n: add bundle for idea/copy
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
text.adding.imports=Adding imports ...
|
||||
text.clipboard.content.seems.to.be.java.code.do.you.want.to.convert.it.to.kotlin=Clipboard content seems to be Java code. Do you want to convert it to Kotlin?
|
||||
text.convert.java.to.kotlin=Convert Java to Kotlin
|
||||
text.copied.kotlin.code=Copied kotlin code
|
||||
text.resolving.references=Resolving references ...
|
||||
title.convert.code.from.java=Convert Code From Java
|
||||
@@ -377,7 +377,7 @@ fun runPostProcessing(
|
||||
processor.updateState(0, phase, description)
|
||||
}
|
||||
},
|
||||
"Convert Java to Kotlin",
|
||||
KotlinCopyBundle.message("text.convert.java.to.kotlin"),
|
||||
true,
|
||||
project
|
||||
)
|
||||
|
||||
@@ -29,6 +29,6 @@ class CopiedKotlinCode(val fileText: String, val startOffsets: IntArray, val end
|
||||
override fun setOffsets(offsets: IntArray?, index: Int) = index
|
||||
|
||||
companion object {
|
||||
val DATA_FLAVOR: DataFlavor = DataFlavor(CopiedKotlinCode::class.java, "Copied kotlin code")
|
||||
val DATA_FLAVOR: DataFlavor = DataFlavor(CopiedKotlinCode::class.java, KotlinCopyBundle.message("text.copied.kotlin.code"))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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.conversion.copy
|
||||
|
||||
import org.jetbrains.annotations.NonNls
|
||||
import org.jetbrains.annotations.PropertyKey
|
||||
import org.jetbrains.kotlin.util.AbstractKotlinBundle
|
||||
|
||||
@NonNls
|
||||
private const val BUNDLE = "messages.KotlinCopyBundle"
|
||||
|
||||
object KotlinCopyBundle : AbstractKotlinBundle(BUNDLE) {
|
||||
@JvmStatic
|
||||
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||
}
|
||||
@@ -39,9 +39,9 @@ public class KotlinPasteFromJavaDialog extends DialogWrapper {
|
||||
super(project, true);
|
||||
setModal(true);
|
||||
getRootPane().setDefaultButton(buttonOK);
|
||||
setTitle("Convert Code From Java");
|
||||
setTitle(KotlinCopyBundle.message("title.convert.code.from.java"));
|
||||
if (isPlainText) {
|
||||
questionLabel.setText("Clipboard content seems to be Java code. Do you want to convert it to Kotlin? ");
|
||||
questionLabel.setText(KotlinCopyBundle.message("text.clipboard.content.seems.to.be.java.code.do.you.want.to.convert.it.to.kotlin"));
|
||||
//TODO: should we also use different set of settings?
|
||||
}
|
||||
init();
|
||||
|
||||
@@ -134,7 +134,7 @@ class PlainTextPasteImportResolver(private val dataForConversion: DataForConvers
|
||||
}
|
||||
|
||||
ProgressManager.getInstance().runProcessWithProgressSynchronously(
|
||||
task, "Adding imports ...", true, project
|
||||
task, KotlinCopyBundle.message("text.adding.imports"), true, project
|
||||
)
|
||||
}
|
||||
|
||||
@@ -229,7 +229,7 @@ class PlainTextPasteImportResolver(private val dataForConversion: DataForConvers
|
||||
}
|
||||
|
||||
ProgressManager.getInstance().runProcessWithProgressSynchronously(
|
||||
task, "Resolving references ...", true, project
|
||||
task, KotlinCopyBundle.message("text.resolving.references"), true, project
|
||||
)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user