i18n: replace KotlinBundleBase with AbstractKotlinBundle
This commit is contained in:
@@ -1,28 +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.idea.core.util
|
|
||||||
|
|
||||||
import java.lang.ref.Reference
|
|
||||||
import java.lang.ref.SoftReference
|
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
abstract class KotlinBundleBase {
|
|
||||||
private var bundleCache: Reference<ResourceBundle>? = null
|
|
||||||
|
|
||||||
protected abstract fun createBundle(): ResourceBundle
|
|
||||||
|
|
||||||
val bundle: ResourceBundle
|
|
||||||
get() {
|
|
||||||
val cachedValue = bundleCache?.get()
|
|
||||||
if (cachedValue != null) {
|
|
||||||
return cachedValue
|
|
||||||
}
|
|
||||||
|
|
||||||
val newValue = createBundle()
|
|
||||||
bundleCache = SoftReference(newValue)
|
|
||||||
return newValue
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -5,20 +5,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.git
|
package org.jetbrains.kotlin.idea.git
|
||||||
|
|
||||||
import com.intellij.CommonBundle
|
|
||||||
import org.jetbrains.annotations.NonNls
|
import org.jetbrains.annotations.NonNls
|
||||||
import org.jetbrains.annotations.PropertyKey
|
import org.jetbrains.annotations.PropertyKey
|
||||||
import org.jetbrains.kotlin.idea.core.util.KotlinBundleBase
|
import org.jetbrains.kotlin.util.AbstractKotlinBundle
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
object KotlinGitBundle : KotlinBundleBase() {
|
@NonNls
|
||||||
@NonNls
|
private const val BUNDLE = "messages.KotlinGitBundle"
|
||||||
private const val BUNDLE = "messages.KotlinGitBundle"
|
|
||||||
|
|
||||||
override fun createBundle(): ResourceBundle = ResourceBundle.getBundle(BUNDLE)
|
|
||||||
|
|
||||||
|
object KotlinGitBundle : AbstractKotlinBundle(BUNDLE) {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): String {
|
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||||
return CommonBundle.message(bundle, key, *params)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+5
-11
@@ -5,20 +5,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.ide.konan
|
package org.jetbrains.kotlin.ide.konan
|
||||||
|
|
||||||
import com.intellij.CommonBundle
|
|
||||||
import org.jetbrains.annotations.NonNls
|
import org.jetbrains.annotations.NonNls
|
||||||
import org.jetbrains.annotations.PropertyKey
|
import org.jetbrains.annotations.PropertyKey
|
||||||
import org.jetbrains.kotlin.idea.core.util.KotlinBundleBase
|
import org.jetbrains.kotlin.util.AbstractKotlinBundle
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
object KotlinGradleNativeBundle : KotlinBundleBase() {
|
@NonNls
|
||||||
@NonNls
|
private const val BUNDLE = "messages.KotlinGradleNativeBundle"
|
||||||
private const val BUNDLE = "messages.KotlinGradleNativeBundle"
|
|
||||||
|
|
||||||
override fun createBundle(): ResourceBundle = ResourceBundle.getBundle(BUNDLE)
|
|
||||||
|
|
||||||
|
object KotlinGradleNativeBundle : AbstractKotlinBundle(BUNDLE) {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): String {
|
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||||
return CommonBundle.message(bundle, key, *params)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -5,20 +5,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea
|
package org.jetbrains.kotlin.idea
|
||||||
|
|
||||||
import com.intellij.CommonBundle
|
|
||||||
import org.jetbrains.annotations.NonNls
|
import org.jetbrains.annotations.NonNls
|
||||||
import org.jetbrains.annotations.PropertyKey
|
import org.jetbrains.annotations.PropertyKey
|
||||||
import org.jetbrains.kotlin.idea.core.util.KotlinBundleBase
|
import org.jetbrains.kotlin.util.AbstractKotlinBundle
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
object KotlinJvmBundle : KotlinBundleBase() {
|
@NonNls
|
||||||
@NonNls
|
private const val BUNDLE = "messages.KotlinJvmBundle"
|
||||||
private const val BUNDLE = "messages.KotlinJvmBundle"
|
|
||||||
|
|
||||||
override fun createBundle(): ResourceBundle = ResourceBundle.getBundle(BUNDLE)
|
|
||||||
|
|
||||||
|
object KotlinJvmBundle : AbstractKotlinBundle(BUNDLE) {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): String {
|
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||||
return CommonBundle.message(bundle, key, *params)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -5,20 +5,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.maven
|
package org.jetbrains.kotlin.idea.maven
|
||||||
|
|
||||||
import com.intellij.CommonBundle
|
|
||||||
import org.jetbrains.annotations.NonNls
|
import org.jetbrains.annotations.NonNls
|
||||||
import org.jetbrains.annotations.PropertyKey
|
import org.jetbrains.annotations.PropertyKey
|
||||||
import org.jetbrains.kotlin.idea.core.util.KotlinBundleBase
|
import org.jetbrains.kotlin.util.AbstractKotlinBundle
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
object KotlinMavenBundle : KotlinBundleBase() {
|
@NonNls
|
||||||
@NonNls
|
private const val BUNDLE = "messages.KotlinMavenBundle"
|
||||||
private const val BUNDLE = "messages.KotlinMavenBundle"
|
|
||||||
|
|
||||||
override fun createBundle(): ResourceBundle = ResourceBundle.getBundle(BUNDLE)
|
|
||||||
|
|
||||||
|
object KotlinMavenBundle : AbstractKotlinBundle(BUNDLE) {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): String {
|
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||||
return CommonBundle.message(bundle, key, *params)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -5,20 +5,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.ide.konan
|
package org.jetbrains.kotlin.ide.konan
|
||||||
|
|
||||||
import com.intellij.CommonBundle
|
|
||||||
import org.jetbrains.annotations.NonNls
|
import org.jetbrains.annotations.NonNls
|
||||||
import org.jetbrains.annotations.PropertyKey
|
import org.jetbrains.annotations.PropertyKey
|
||||||
import org.jetbrains.kotlin.idea.core.util.KotlinBundleBase
|
import org.jetbrains.kotlin.util.AbstractKotlinBundle
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
object KotlinNativeBundle : KotlinBundleBase() {
|
@NonNls
|
||||||
@NonNls
|
private const val BUNDLE = "messages.KotlinNativeBundle"
|
||||||
private const val BUNDLE = "messages.KotlinNativeBundle"
|
|
||||||
|
|
||||||
override fun createBundle(): ResourceBundle = ResourceBundle.getBundle(BUNDLE)
|
|
||||||
|
|
||||||
|
object KotlinNativeBundle : AbstractKotlinBundle(BUNDLE) {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): String {
|
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||||
return CommonBundle.message(bundle, key, *params)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+5
-11
@@ -5,20 +5,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.tools.projectWizard.wizard
|
package org.jetbrains.kotlin.tools.projectWizard.wizard
|
||||||
|
|
||||||
import com.intellij.CommonBundle
|
|
||||||
import org.jetbrains.annotations.NonNls
|
import org.jetbrains.annotations.NonNls
|
||||||
import org.jetbrains.annotations.PropertyKey
|
import org.jetbrains.annotations.PropertyKey
|
||||||
import org.jetbrains.kotlin.idea.core.util.KotlinBundleBase
|
import org.jetbrains.kotlin.util.AbstractKotlinBundle
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
object KotlinNewProjectWizardBundle : KotlinBundleBase() {
|
@NonNls
|
||||||
@NonNls
|
private const val BUNDLE = "messages.KotlinNewProjectWizardBundle"
|
||||||
private const val BUNDLE = "org.jetbrains.kotlin.tools.projectWizard.wizard.KotlinNewProjectWizardBundle"
|
|
||||||
|
|
||||||
override fun createBundle(): ResourceBundle = ResourceBundle.getBundle(BUNDLE)
|
|
||||||
|
|
||||||
|
object KotlinNewProjectWizardBundle : AbstractKotlinBundle(BUNDLE) {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): String {
|
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||||
return CommonBundle.message(bundle, key, *params)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+5
-11
@@ -5,20 +5,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.debugger
|
package org.jetbrains.kotlin.idea.debugger
|
||||||
|
|
||||||
import com.intellij.CommonBundle
|
|
||||||
import org.jetbrains.annotations.NonNls
|
import org.jetbrains.annotations.NonNls
|
||||||
import org.jetbrains.annotations.PropertyKey
|
import org.jetbrains.annotations.PropertyKey
|
||||||
import org.jetbrains.kotlin.idea.core.util.KotlinBundleBase
|
import org.jetbrains.kotlin.util.AbstractKotlinBundle
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
object KotlinDebuggerCoreBundle : KotlinBundleBase() {
|
@NonNls
|
||||||
@NonNls
|
private const val BUNDLE = "messages.KotlinDebuggerCoreBundle"
|
||||||
private const val BUNDLE = "messages.KotlinDebuggerCoreBundle"
|
|
||||||
|
|
||||||
override fun createBundle(): ResourceBundle = ResourceBundle.getBundle(BUNDLE)
|
|
||||||
|
|
||||||
|
object KotlinDebuggerCoreBundle : AbstractKotlinBundle(BUNDLE) {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): String {
|
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||||
return CommonBundle.message(bundle, key, *params)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+5
-11
@@ -5,20 +5,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.debugger.coroutine
|
package org.jetbrains.kotlin.idea.debugger.coroutine
|
||||||
|
|
||||||
import com.intellij.CommonBundle
|
|
||||||
import org.jetbrains.annotations.NonNls
|
import org.jetbrains.annotations.NonNls
|
||||||
import org.jetbrains.annotations.PropertyKey
|
import org.jetbrains.annotations.PropertyKey
|
||||||
import org.jetbrains.kotlin.idea.core.util.KotlinBundleBase
|
import org.jetbrains.kotlin.util.AbstractKotlinBundle
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
object KotlinDebuggerCoroutinesBundle : KotlinBundleBase() {
|
@NonNls
|
||||||
@NonNls
|
private const val BUNDLE = "messages.KotlinDebuggerCoroutinesBundle"
|
||||||
private const val BUNDLE = "messages.KotlinDebuggerCoroutinesBundle"
|
|
||||||
|
|
||||||
override fun createBundle(): ResourceBundle = ResourceBundle.getBundle(BUNDLE)
|
|
||||||
|
|
||||||
|
object KotlinDebuggerCoroutinesBundle : AbstractKotlinBundle(BUNDLE) {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): String {
|
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||||
return CommonBundle.message(bundle, key, *params)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
+8
-11
@@ -5,20 +5,17 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.idea.debugger.evaluate
|
package org.jetbrains.kotlin.idea.debugger.evaluate
|
||||||
|
|
||||||
import com.intellij.CommonBundle
|
|
||||||
import org.jetbrains.annotations.NonNls
|
import org.jetbrains.annotations.NonNls
|
||||||
import org.jetbrains.annotations.PropertyKey
|
import org.jetbrains.annotations.PropertyKey
|
||||||
import org.jetbrains.kotlin.idea.core.util.KotlinBundleBase
|
import org.jetbrains.kotlin.util.AbstractKotlinBundle
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
object KotlinDebuggerEvaluationBundle : KotlinBundleBase() {
|
@NonNls
|
||||||
@NonNls
|
private const val BUNDLE = "messages.KotlinDebuggerEvaluationBundle"
|
||||||
private const val BUNDLE = "messages.KotlinDebuggerEvaluationBundle"
|
|
||||||
|
|
||||||
override fun createBundle(): ResourceBundle = ResourceBundle.getBundle(BUNDLE)
|
|
||||||
|
|
||||||
|
object KotlinDebuggerEvaluationBundle : AbstractKotlinBundle(BUNDLE) {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): String {
|
fun message(
|
||||||
return CommonBundle.message(bundle, key, *params)
|
@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String,
|
||||||
}
|
vararg params: Any
|
||||||
|
): String = getMessage(key, *params)
|
||||||
}
|
}
|
||||||
@@ -5,20 +5,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.nj2k
|
package org.jetbrains.kotlin.nj2k
|
||||||
|
|
||||||
import com.intellij.CommonBundle
|
|
||||||
import org.jetbrains.annotations.NonNls
|
import org.jetbrains.annotations.NonNls
|
||||||
import org.jetbrains.annotations.PropertyKey
|
import org.jetbrains.annotations.PropertyKey
|
||||||
import org.jetbrains.kotlin.idea.core.util.KotlinBundleBase
|
import org.jetbrains.kotlin.util.AbstractKotlinBundle
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
object KotlinNJ2KServicesBundle : KotlinBundleBase() {
|
@NonNls
|
||||||
@NonNls
|
private const val BUNDLE = "messages.KotlinNJ2KServicesBundle"
|
||||||
private const val BUNDLE = "messages.KotlinNJ2KServicesBundle"
|
|
||||||
|
|
||||||
override fun createBundle(): ResourceBundle = ResourceBundle.getBundle(BUNDLE)
|
|
||||||
|
|
||||||
|
object KotlinNJ2KServicesBundle : AbstractKotlinBundle(BUNDLE) {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): String {
|
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||||
return CommonBundle.message(bundle, key, *params)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
@@ -5,20 +5,14 @@
|
|||||||
|
|
||||||
package org.jetbrains.kotlin.nj2k
|
package org.jetbrains.kotlin.nj2k
|
||||||
|
|
||||||
import com.intellij.CommonBundle
|
|
||||||
import org.jetbrains.annotations.NonNls
|
import org.jetbrains.annotations.NonNls
|
||||||
import org.jetbrains.annotations.PropertyKey
|
import org.jetbrains.annotations.PropertyKey
|
||||||
import org.jetbrains.kotlin.idea.core.util.KotlinBundleBase
|
import org.jetbrains.kotlin.util.AbstractKotlinBundle
|
||||||
import java.util.*
|
|
||||||
|
|
||||||
object KotlinNJ2KBundle : KotlinBundleBase() {
|
@NonNls
|
||||||
@NonNls
|
private const val BUNDLE = "messages.KotlinNJ2KBundle"
|
||||||
private const val BUNDLE = "messages.KotlinNJ2KBundle"
|
|
||||||
|
|
||||||
override fun createBundle(): ResourceBundle = ResourceBundle.getBundle(BUNDLE)
|
|
||||||
|
|
||||||
|
object KotlinNJ2KBundle : AbstractKotlinBundle(BUNDLE) {
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): String {
|
fun message(@NonNls @PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any): String = getMessage(key, *params)
|
||||||
return CommonBundle.message(bundle, key, *params)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user