How to localize files in Windows Phone 8

2019-08-10 04:07发布

问题:

We add key/value pairs in AppResources for each language then easily use it in binding. But I have a long list of names of countries in a separate XML file for each language written in its own script.

Now, how can I use for french the french XML file and for english the english one?

(Answer to the coming question: "what have you tried or where is your code?", infact I'm at the beginning so no code, but I searched but didn't find any result, personally, sorry!)

回答1:

First, why not just convert that XML file to a rex file and then use the standard localization APIs?

Failing that, you could add a localizable string to your application that is the file path to the XML file. That way, you use the standard ResourceManager to get the path and then handle it using your custom parsing.