AbstractKotlinBundle: introduce withHtml
#KT-37483
This commit is contained in:
@@ -7,4 +7,6 @@ package org.jetbrains.kotlin.util
|
||||
|
||||
import com.intellij.AbstractBundle
|
||||
|
||||
abstract class AbstractKotlinBundle protected constructor(pathToBundle: String) : AbstractBundle(pathToBundle)
|
||||
abstract class AbstractKotlinBundle protected constructor(pathToBundle: String) : AbstractBundle(pathToBundle) {
|
||||
protected fun String.withHtml(): String = "<html>$this</html>"
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
/*
|
||||
* 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.util
|
||||
|
||||
import com.intellij.AbstractBundle
|
||||
|
||||
abstract class AbstractKotlinBundle protected constructor(pathToBundle: String) : AbstractBundle(pathToBundle)
|
||||
@@ -7,4 +7,6 @@ package org.jetbrains.kotlin.util
|
||||
|
||||
import com.intellij.DynamicBundle
|
||||
|
||||
abstract class AbstractKotlinBundle protected constructor(pathToBundle: String) : DynamicBundle(pathToBundle)
|
||||
abstract class AbstractKotlinBundle protected constructor(pathToBundle: String) : DynamicBundle(pathToBundle) {
|
||||
protected fun String.withHtml(): String = "<html>$this</html>"
|
||||
}
|
||||
@@ -17,7 +17,7 @@ object KotlinIdeaAnalysisBundle : AbstractKotlinBundle(BUNDLE) {
|
||||
|
||||
@JvmStatic
|
||||
fun htmlMessage(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String =
|
||||
"<html>" + getMessage(key, *params) + "</html>"
|
||||
getMessage(key, *params).withHtml()
|
||||
|
||||
@JvmStatic
|
||||
fun lazyMessage(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): () -> String = { getMessage(key, *params) }
|
||||
|
||||
@@ -15,4 +15,8 @@ private const val BUNDLE = "messages.KotlinJvmBundle"
|
||||
object KotlinJvmBundle : AbstractKotlinBundle(BUNDLE) {
|
||||
@JvmStatic
|
||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||
|
||||
@JvmStatic
|
||||
fun htmlMessage(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String =
|
||||
getMessage(key, *params).withHtml()
|
||||
}
|
||||
@@ -15,6 +15,10 @@ object KotlinBundle : AbstractKotlinBundle(BUNDLE) {
|
||||
@JvmStatic
|
||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||
|
||||
@JvmStatic
|
||||
fun htmlMessage(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String =
|
||||
getMessage(key, *params).withHtml()
|
||||
|
||||
@JvmStatic
|
||||
fun lazyMessage(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): () -> String = { getMessage(key, *params) }
|
||||
}
|
||||
Reference in New Issue
Block a user