As this is a string localisation problem only, and you just want the flexibility of selecting an entire set of localised content, there are several methods out there for binding your strings to a resource manager. Most of them are overly complex for the desired result:
Given the following:
- Most solutions I have seen require a binding statement about 80 character long for every single entry. This includes no end of clever Converter use.
- Most solutions I have seen implement every string as a notify property (this seems a massive overhead for strings that hardly ever change).
- Localisation generally do not require an instantaneous update (you can always refresh the current page).
A far simpler approach is to simply place your strings, as name value pairs, in the global App dictionary and reference them via a short/simple StaticResource binding e.g.
Text={StaticResource L_MenuHome}
The remaining problem is then just how to get another set of language strings into the App dictionary (which is actually quite easy):
- Put your default languages strings directly into your App.xaml (this helps in development as missing keys will result in an exception).
- Pull any newly chosen language down from your server via any convenient means (XML file, XAML file, CSV, or from a database via webservice)
- Replace the dictionary entries with the newly loaded data. The only thing you must do is make sure the key is already present, or you must add an entry instead or setting one.
- Reload the current page (take them back to the home page after a language change?)
I don't know why everyone seems to love the really complex solutions when StaticResources do the job just fine and with a lot less effort. We also tend to use a webservice to fetch a set of language strings from a database as it is generally less than 200K and databases are far more flexible for updates.
Anyway, just trying to put some commonsense back into localisation. It works for us. Feel free to use, ignore, suggest improvements etc.
Hope this helps.