0

In my database I have a table containing localized cities.

Cities
_id |name_en |name_de |name_it
0 |Rome |Rom |Roma
1 |Munich |München |Monaco
...

Now I want show a ListView where each line exists of all names started by the name in the users language. Also the whole list should be sorted by the city in the users language.

Which is the right design-pattern for this kind of problem?

fmo
  • 818
  • 1
  • 8
  • 16

2 Answers2

0

This is quite a broad question, but here's one general approach:

Please post your relevant code if you want specific help.

Community
  • 1
  • 1
Sam
  • 86,580
  • 20
  • 181
  • 179
0

Obviously you need to decide what column to use for SQL request (for both stating which column to retrieve and by which column to sort). So your column names should be public constants. And you need to have a method to return a column name (one of the constants) depending on the current device locale. Use one of the constants as a fallback if the locale does not match any known for the application locales.

Vit Khudenko
  • 28,288
  • 10
  • 63
  • 91