ilteoood / flutter_i18n

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

Question: Is it possible to use both FileTranslationLoader and NetworkFileTranslationLoader #140

Closed Wouter12 closed 3 years ago

Wouter12 commented 3 years ago

Hi,

I'm working on an app which both has local translations in a json and fetches translations from our backend service. It seems to me that only the translations from the backend service or the file are available in the app, depending on which TranslationLoader I create last.

defint commented 3 years ago

Hi @Wouter12

You can use only one of the predefined translation loader. But you can easily create your own custom translation loader with the necessary logic to split them.

ilteoood commented 3 years ago

What you can do is download the translation from your backend service and keep it in device memory. To do this, you can use the LocalTranslationLoader; please check this example: https://github.com/ilteoood/flutter_i18n/blob/master/example/lib/local_example.dart