Inflection aware translation library.
To get translated sentence following steps happen:
-
You pass message identifier with appropriate parameters
t.translate("a {age} {animal}", {{"age", {"young"}},{"animal",{"roe deer"}}})
-
Grammatical categories are calculated
in Polish, roe deer have feminine gender -
Sentence template is selected based on results from previous step
-
Word forms used in sentence are chosen.
gender of adjective must match noun, so feminine form is chosen: młoda -
Sentence template is filed with final word forms.
You can look on examples to understand better.