TeamWanari / rosetta

Flutter Localization tool with code generation tool.
MIT License
35 stars 7 forks source link

Add support for translation context #63

Open palficsabapeter opened 3 years ago

palficsabapeter commented 3 years ago

In certain situations, providing context for a different translation would come in handy. One example is gender specific translation.

An example from i18next.com to illustrate the problem: { "friend": "A friend", "friend_male": "A boyfriend", "friend_female": "A girlfriend" }

Usage: i18next.t('friend'); // -> "A friend" i18next.t('friend', { context: 'male' }); // -> "A boyfriend" i18next.t('friend', { context: 'female' }); // -> "A girlfriend"

It would be cool if the library had a similar feature.