All Tolgee SDKs are following ICU (International Components for Unicode) message format. Let's see, how to work with it.
The easiest example is how to include external parameters in your message.
If your parameter
John, the output will be
Hello, I am John.
Sometimes you need to specify the form of some part of the message depending on provided number value.
In english this is relatively easy. We need just 2 forms of the word
be verb. If we would like to be even cooler,
we could provide special form for 0 dogs.
If we are translating into other languages, this could be much more complicated. Fortunately, it's simple to cover all the cases. For example in Czech language we will need to cover these cases:
Notice, that you can also you tags like
All supported tags are:
This will cover all the cases we need. For more information about plural rules, read this.
Sometimes we need to change the form of some part of translation depending on exact value match. One of these cases is selecting proper form by gender. Again, this is something you will need in Czech language.
Sometimes, you would like to combine the rules. This is no problem, you can provide messages like this:
To read more about ICU format, you can follow this guide.