i18n: add bundle for idea/testIntegration

This commit is contained in:
Dmitry Gridin
2020-02-21 16:14:15 +07:00
parent 1aa48e5f26
commit a41f3ff17d
3 changed files with 28 additions and 5 deletions
@@ -0,0 +1,5 @@
button.text.cancel=Cancel
button.text.rewrite=Rewrite
message.text.create.test.in.the.same.source.root=Create test in the same source root?
message.text.kotlin.class=Kotlin class ''{0}'' already exists. Do you want to update it?
title.no.test.roots.found=No Test Roots Found
@@ -108,8 +108,8 @@ class KotlinCreateTestIntention : SelfTargetingRangeIntention<KtNamedDeclaration
if (testFolders.isEmpty() && !propertiesComponent.getBoolean("create.test.in.the.same.root")) {
if (Messages.showOkCancelDialog(
project,
"Create test in the same source root?",
"No Test Roots Found",
KotlinTestIntegrationBundle.message("message.text.create.test.in.the.same.source.root"),
KotlinTestIntegrationBundle.message("title.no.test.roots.found"),
Messages.getQuestionIcon()
) != Messages.OK
) return
@@ -130,10 +130,10 @@ class KotlinCreateTestIntention : SelfTargetingRangeIntention<KtNamedDeclaration
// TODO: Override dialog method when it becomes protected
val answer = Messages.showYesNoDialog(
project,
"Kotlin class '${existingClass.name}' already exists. Do you want to update it?",
KotlinTestIntegrationBundle.message("message.text.kotlin.class", existingClass.name.toString()),
CommonBundle.getErrorTitle(),
"Rewrite",
"Cancel",
KotlinTestIntegrationBundle.message("button.text.rewrite"),
KotlinTestIntegrationBundle.message("button.text.cancel"),
Messages.getErrorIcon()
)
if (answer == Messages.NO) return
@@ -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.testIntegration
import org.jetbrains.annotations.NonNls
import org.jetbrains.annotations.PropertyKey
import org.jetbrains.kotlin.util.AbstractKotlinBundle
@NonNls
private const val BUNDLE = "messages.KotlinTestIntegrationBundle"
object KotlinTestIntegrationBundle : AbstractKotlinBundle(BUNDLE) {
@JvmStatic
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
}