Skip to content

Commit 139c76f

Browse files
committed
Switch from AbstractBundle to DynamicBundle
Replaced `AbstractBundle` with `DynamicBundle` for dynamic message retrieval and lazy loading. Adjusted the implementation of `messagePointer` method to use `getLazyMessage` instead of directly returning the message.
1 parent c6832ff commit 139c76f

1 file changed

Lines changed: 7 additions & 8 deletions

File tree

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
package il.co.sysbind.moodledev
22

3-
import com.intellij.AbstractBundle
3+
import com.intellij.DynamicBundle
44
import org.jetbrains.annotations.NonNls
55
import org.jetbrains.annotations.PropertyKey
66

77
@NonNls
88
private const val BUNDLE = "messages.MoodleBundle"
99

10-
object MoodleBundle : AbstractBundle(BUNDLE) {
10+
object MoodleBundle : DynamicBundle(BUNDLE) {
1111

12-
@Suppress("SpreadOperator")
1312
@JvmStatic
14-
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) = getMessage(key, *params)
13+
fun message(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
14+
getMessage(key, *params)
1515

16-
@Suppress("SpreadOperator")
16+
@Suppress("unused")
1717
@JvmStatic
18-
fun messagePointer(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) = run {
19-
message(key, *params)
20-
}
18+
fun messagePointer(@PropertyKey(resourceBundle = BUNDLE) key: String, vararg params: Any) =
19+
getLazyMessage(key, *params)
2120
}

0 commit comments

Comments
 (0)