Skip to content

Commit dd180b6

Browse files
committed
add I18nLabelValue.withArgs(*args) helper method
1 parent 448853c commit dd180b6

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

translator/core/src/main/kotlin/I18nLabelValue.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,12 @@ class I18nLabelValue constructor(
8181
fun withArgs(newArgs: List<Any?>): I18nLabelValue =
8282
I18nLabelValue(key, namespace, category, defaultLabel, newArgs, defaultI18n)
8383

84+
/**
85+
* Returns the value with the given args.
86+
*/
87+
fun withArgs(vararg newArgs: Any?): I18nLabelValue =
88+
withArgs(listOf(*newArgs))
89+
8490
override fun toString(): String {
8591
return defaultLabel.toString()
8692
}

0 commit comments

Comments
 (0)