Dee Li
Dee Li

Reputation: 1

Flutter: Localization with i18n() for Json file many levels

I use localization 2.1.0 (https://pub.dev/packages/localization). I have a file en_US.json:

"home": {
        "welcome text": "This text is in english",
        "my page": "My page"
    }

How to call "welcome text".i18n() from "home" ?

String text = 'welcome text'.i18n(); // home?
print(text) // prints 'This text is in english'

Thanks

Upvotes: 0

Views: 200

Answers (0)

Related Questions