Has anybody experience with i18n and parameters? E...
# kvision
j
Has anybody experience with i18n and parameters? E.g. translating the string "I have 7 cars". where "7" is a variable that is determined at runtime? The "tr" doesn't have any parameters as far as I can see. How is this done?
r
tr()
is just an simple alias for
<http://I18n.tr|I18n.tr>()
, but there is also
I18n.ngettext(...)
for your use case.
j
If I understand this will just return singular/plural. But how can I add additional parameters. E.g.: "Your name is Robert" - where "Robert" is only known at runtime.
r
I see what you mean
It should be implemented but it's not 😞
In JS you can just add a parameter, but in Kotlin you can't. I should create a vararag version. So please fill an issue.
j