2

I would like to localize my app in 4 different languages.

I have data that I retrieve from Firestore (i.e. titles, descriptions, etc) What would be a good approach to do this? I found this library https://pub.dev/packages/easy_localization

What is the right approach? It seems easy to localize hardcoded strings but I can't find anything regarding dynamic data.

Thanks!

Sarthak Raval
  • 1,001
  • 1
  • 10
  • 23
R. Andrew
  • 21
  • 2

1 Answers1

1

Use AssetLoader to retrieve from Firestore, see for details Easy Localization Loader. See HttpAssetLoader for the idea.

user18309290
  • 5,777
  • 2
  • 4
  • 22
  • Thank you for your answer. With the approach found here [link](https://www.thirdrocktechkno.com/blog/how-to-implement-localization-in-flutter/) Do you reckon that i can change the string key value pairs for variables? `{ “welcome_text”:“Hello, Welcome to my blog”, “first_text”:“This is App localization example” }` for example `description : description_EN and the other would be description : description_GR` So i can retrieve the variables with the translations with minor changes from the code i already have. – R. Andrew May 05 '22 at 07:53