comahe-de / i18n4k

Internationalization for Kotlin
Apache License 2.0
79 stars 9 forks source link

Named variables #56

Closed nuke-dash closed 7 months ago

nuke-dash commented 10 months ago

Would it be possible to add support for named variables similar to the ICU Message Format? for example: {total.count} channels are now available! We found {tv.channel.count} TV channels and {radio.channel.count} radio channels. instead of {0} channels are now available! We found {1} TV channels and {2} radio channels.

The main reason is to improve readability for both the translator and developer.

for reference https://formatjs.io/docs/core-concepts/basic-internationalization-principles#translating-strings https://unicode-org.github.io/icu/userguide/format_parse/messages/#messageformat

comahe-de commented 10 months ago

Hi @nuke-dash,

Interesting link. I will have a look...

comahe-de commented 10 months ago

See also: https://github.com/unicode-org/message-format-wg/blob/main/spec/syntax.md