I have a UWP app that has a resource file for every language that we support. If I change the language on the target machine to French (fr-FR) I correctly see all of our French strings loaded in the app. This all works as expected.
However, in another place in our app, we load a particular file based on the "Language" property from the resource manager, like this:
var rc = ResourceManager.Current.MainResourceMap.GetSubtree("Files").GetValue("File.txt", ResourceContext.GetForCurrentView());
var lang = rc.Qualifiers.FirstOrDefault(q => q.QualifierName == "Language").QualifierValue;
// Get the file
StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri("ms-appx:///" + lang + "/File.txt"));
On disk I have a different copy of "File.txt" in each language:
en-US\File.txt
fr-FR\File.txt
etc.
However I can only ever get the en-US file to be read. How do I compile our app in French, so the above snippet of code returns “fr-FR” for the “Language” qualifier?