Variables / Interpolation
Variable
Simpleen handles different variables in your text from common i18n libraries. You can add them to your custom translator or change them accordingly. We provide suitable defaults per i18n lbirary or programming language, but these are not suitable for all users. You're free to choose a different one.
Interpolation value | Expected Variables |
---|---|
i18next | {{ variable }} |
polyglot | %{ variable } |
icu | { variable, withParams } |
i18n | { variable } |
ruby | ${ variable } |
laravel | :variable |
default | Automatic/Guessing |
none | none |
The default/automatic one counts the occurrence of each variable and selects the one with the most occurences.
Translation of Variables
Variables are not getting translated. We handle variables accordingly and get most information about them. We can provide more suitable translation results with variables in comparison to others.
If we translate the sentence Today is { date }
into German, Simpleen returns Heute ist der {date}
. If you directly provide to DeepL you will get Heute ist { Datum }
.