IDEA-270005 Package search: the translation file is not applied on package search
authorJakub Chrzanowski <jakub.chrzanowski@jetbrains.com>
Fri, 18 Jun 2021 11:21:47 +0000 (13:21 +0200)
committerintellij-monorepo-bot <intellij-monorepo-bot-no-reply@jetbrains.com>
Fri, 18 Jun 2021 11:21:47 +0000 (11:21 +0000)
GitOrigin-RevId: 948de0ab95e250c00677823d9aced130a69b585d

plugins/package-search/src/com/jetbrains/packagesearch/intellij/plugin/PackageSearchBundle.kt
plugins/package-search/src/com/jetbrains/packagesearch/intellij/plugin/ui/toolwindow/PackageSearchToolWindowFactory.kt

index 7a23147eca03d5946082a93700047c7885fa1644..70786a140003723afdb82a7ff5e046f277b1ab87 100644 (file)
@@ -3,12 +3,19 @@ package com.jetbrains.packagesearch.intellij.plugin
 import com.intellij.AbstractBundle
 import org.jetbrains.annotations.Nls
 import org.jetbrains.annotations.PropertyKey
+import java.util.function.Supplier
 
-object PackageSearchBundle : AbstractBundle("messages.packageSearchBundle") {
+private const val BUNDLE_NAME = "messages.packageSearchBundle"
+
+object PackageSearchBundle : AbstractBundle(BUNDLE_NAME) {
 
     @Nls
     fun message(
-        @PropertyKey(resourceBundle = "messages.packageSearchBundle") key: String,
+        @PropertyKey(resourceBundle = BUNDLE_NAME) key: String,
         vararg params: Any
     ): String = getMessage(key, *params)
+
+    @Nls
+    fun messagePointer(@PropertyKey(resourceBundle = BUNDLE_NAME) key: String, vararg params: Any): Supplier<String> =
+        getLazyMessage(key, *params)
 }
index 82bf57f271d44778e47f5099c432489b0abb06b5..0b0a649d92a0e617c8fb321db6b00e20ad3a10a4 100644 (file)
@@ -21,7 +21,6 @@ import kotlinx.coroutines.flow.launchIn
 import kotlinx.coroutines.flow.map
 import kotlinx.coroutines.flow.onEach
 import kotlinx.coroutines.flow.take
-import java.util.function.Supplier
 
 class PackageSearchToolWindowFactory : ToolWindowFactory, DumbAware {
 
@@ -63,7 +62,7 @@ class PackageSearchToolWindowFactory : ToolWindowFactory, DumbAware {
             .map {
                 RegisterToolWindowTask.closable(
                     ToolWindowId,
-                    Supplier { PackageSearchBundle.message("toolwindow.stripe.Packages") },
+                     PackageSearchBundle.messagePointer("toolwindow.stripe.Packages"),
                     PackageSearchIcons.ArtifactSmall
                 )
             }