Fix subclassing of DynamicBundle in ComposeTemplateBundle

It is not recommended
This commit is contained in:
Yuriy Artamonov 2025-08-30 10:15:28 +02:00
parent b32e3fee01
commit 5d5ef16235
2 changed files with 11 additions and 9 deletions

View File

@ -1,20 +1,22 @@
package org.jetbrains.plugins.template package org.jetbrains.plugins.template
import com.intellij.DynamicBundle import com.intellij.DynamicBundle
import org.jetbrains.annotations.NonNls import org.jetbrains.annotations.Nls
import org.jetbrains.annotations.PropertyKey import org.jetbrains.annotations.PropertyKey
import java.util.function.Supplier
@NonNls
private const val BUNDLE = "messages.ComposeTemplate" private const val BUNDLE = "messages.ComposeTemplate"
object ComposeTemplateBundle : DynamicBundle(BUNDLE) { object ComposeTemplateBundle {
private val instance = DynamicBundle(ComposeTemplateBundle::class.java, BUNDLE)
@JvmStatic @JvmStatic
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) = fun message(key: @PropertyKey(resourceBundle = BUNDLE) String, vararg params: Any?): @Nls String {
getMessage(key, *params) return instance.getMessage(key, *params)
}
@Suppress("unused")
@JvmStatic @JvmStatic
fun messagePointer(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) = fun lazyMessage(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any?): Supplier<@Nls String> {
getLazyMessage(key, *params) return instance.getLazyMessage(key, *params)
}
} }

View File

@ -217,7 +217,7 @@ private fun MyLocationList(
} }
) { ) {
ContextPopupMenuItem( ContextPopupMenuItem(
ComposeTemplateBundle.getMessage("weather.app.context.menu.delete.option"), ComposeTemplateBundle.message("weather.app.context.menu.delete.option"),
AllIconsKeys.General.Delete AllIconsKeys.General.Delete
) { ) {
showPopup.value = false showPopup.value = false