Localizable properties in Firestore. Swift example
Have you ever had some content stored in Firebase Firestore that you’d want to be localized? The most straightforward solution would be to have localization string on client and send localization keys from Firebase making all the localization happen on client but in this short article I’d like to show you an example of how you could store localizations actually on Firestore. Let’s say you want your app to support English and Ukrainian. Every text you send from Firestore should therefore have these 2 translations. Now how can we do that? Easy: every text would be an object (or map in Firestore terms) instead of a String and the object will hold different translations. Here’s how it might look like: ...