ilteoood / flutter_i18n

I18n made easy, for Flutter!
MIT License
217 stars 57 forks source link

Cannot translate with key containing special characters #203

Closed DongPhamBK closed 1 year ago

DongPhamBK commented 1 year ago

Hello, I'm using your library with a sentence with periods, commas and spaces, for example: In file i18n/en.json { "'Your phone' is available now.": "'Your phone' is available now." } and in file i18n/es.json { "'Your phone' is available now.": "'Tu teléfono' ya está disponible." }

in my flutter code, I used: I18nText("'Your phone' is available now.") Text(FlutterI18n.translate(context, "'Your phone' is available now."))

But it seems the code is not working!!!

Looking forward to your reply! Thanks !!!

ilteoood commented 1 year ago

The one that you used is not a key but an entire sentence. You should use a key like: phoneAvailable.