ilteoood / flutter_i18n

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

Emoji not working with NetworkFileTranslationLoader but works with FileTranslationLoader #190

Closed chamartt closed 2 years ago

chamartt commented 2 years ago

Hello,

In my json file, I have some Emojis as 🤝. When I use FileTranslationLoader, emojis are correclty displayed on my app, but when I use NetworkFileTranslationLoader (with same source json files), emojis are converted as specials caracters.

I tried to add decodeStrategies: [JsonDecodeStrategy(), YamlDecodeStrategy(), XmlDecodeStrategy(), TomlDecodeStrategy()] in parameter of my NetworkFileTranslationLoader but nothing changed.

This is the (good) result with FileTranslationLoader: SmartSelect_20220316-124411

This is the (wrong) result with NetworkFileTranslationLoader: SmartSelect_20220316-124033

I'm using flutter_i18n 0.32.1, Flutter sdk 2.10.3 and Dart 2.16.1

Thank you for your work and your time to answer.

ilteoood commented 2 years ago

Hi, do you have a direct link where I can try it?

chamartt commented 2 years ago

Hello,

This is my code implementation :

NetworkFileTranslationLoader(
           useCountryCode: false,
           fallbackFile: 'en',
           baseUri: Uri.https("l-algo-de-paulo-8fb41.appspot.com.storage.googleapis.com", "translations"),
         )

I have one en.json and fr.json in the translations folder.

Thank you!

chamartt commented 2 years ago

Hi @ilteoood,

Do you need additionnals informations to reproduce ? We are waiting this point to upgrade our application.

Let me know if you need something else !

Thank you for your work and your time.

ilteoood commented 2 years ago

This should be fixed with the release 0.32.2

One suggestion: use the decodeStrategies parameter in order to avoid useless network calls.

P.S. this is an open source project, instead of ping me for a solution, you can contribute :smile:

chamartt commented 2 years ago

Hi,

Thank you for the MPR !

Unfortunatly I don't know as you how your plugin works and I had lot of work to look what was the problem, maybe was just one configuration in my call but I'm "happy" to see that was worst !

Thank you also for the suggestion, I tried with all to look results but I will restrict only JSON files !