I'm working on swift / iOS with a parse.com backend but this question could be applied to any language and is a general conceptual question. I'll use a specific example for illustration purpose.
I have a content type, let's say "user" that is saved in a database. Each user is categorized by countries. The app is localized. Any user, must be able to filter users list by country. And here is the problem:
On database user table "countries" field, each user has entered his own country from a drop down list of countries, but these country names are localized. So for example, an american user, has chosen "United States of Americas" as his country, and that is the string in the "Countries" user table, but a french user looking to filter all users from USA, will launch a search to corresponding localized "Etats-Unis d'Ameriques" which will not match "United States of Americas" users.
To avoid this localization categorization problem, I was thinking of abstracting the name countries by associating each with a numeric ID, in a tuple or array, then store in the database that ID. So when referring to it I would look-up the array ID and refer to localized string other member in the array.
Is this a proper way to handle this scenario ? I guess there is a "right" way to handle this.