Support arguments in i18n
karollewandowski opened this issue · 1 comments
karollewandowski commented
Correct me if I'm wrong, but it looks like it is not possible to pass translation arguments in HTL.
Proposal
Example with single argument
Dictionary entry: user.greeting=Hello {0}!
Usage:
${'user.greeting' @ i18n, args='Karol'} <!-- prints: Hello Karol! -->
Example with multiple arguments
Dictionary entry: user.greeting=Hello {0}, you have {1} unread messages.
Usage:
${'user.greeting' @ i18n, args=['Karol', 21]} <!-- prints: Hello Karol, you have 21 unread messages. -->
karollewandowski commented
I've just found out it should be done with format
option and is even mentioned in specification under format
section. I think it would be good to mention it in i18n
section as well.
My bad, sorry for spam.