Howard Lau
Howard Lau

Reputation: 173

How to create a localized data scheme (by language) for Android in Firestore?

I have a base data scheme like this: enter image description here

My app need to be localization by splitting some of data fields by different display language. For example, "district" should display in different language based on the user's language selection.

One of the solution that i found on the internet is to create another document with language preference. But the drawback of this is that I need to maintain the document(s) together all the time.

is it possible to lookup from another document in FireStore?

Any best practice to do localization in FireStore?

Upvotes: 2

Views: 1668

Answers (1)

vitooh
vitooh

Reputation: 4262

Firestore is document NoSQL database and this problem is general for all databases of this type. I used once a field type map, however I admit this was not commercial, but just practice. Than it looked like this:

enter image description here

If this will not suite your requirements I can only give you few other question of similar topic:

Multilingual data modeling on MongoDB

How to achieve localisation with NoSQL

How to properly structure localized content in Cloud Firestore?

If you need even more I suggest to study Document based NoSQL databases general solutions.

Hope it will help!

Upvotes: 2

Related Questions