locked
Can I get the language I should display my localized text in?

    Question

  • I've got a number of languages specified in the manifest of my application (en-us, de-de, fr-fr, etc). What I'm after is a way I can query for which of these languages I should use based on the users current preferences.

    I can see "Globalization::ApplicationLanguages::ManifestLanguages" which returns all the languages we support in our app, I can see "Globalization::ApplicationLanguages::Languages" which is a list of the languages the user has specified in Windows that they like in order of preference. How do I map one on to the other? (I understand something's going on with the resource system, but we don't use that - I just need access to the locale of the language that's the best match).

    For example, the user is in Austria, locale of de-AT, the system in examples I've seen can map that on to de-DE as the best fit, how do I get it to tell me that's the one I should use? The documentation keeps mentioning there is complex logic for doing this mapping, but I can't find a function that lets me get at the result?

    Thanks,

    -roger

    Thursday, September 25, 2014 12:55 AM

Answers

  • Hi Roger,

    Per my understanding, your scenario is there is a German working in Australia. You app need to provide German language to him. Yes, the matching of language to resources is difficult. So MSDN suggests to let the windows handle the matching. You can find more information from Step 5 Create the application language list.

    In order to reduce this complexity problem, I would recommend you use the first language of "Globalization::ApplicationLanguages::Languages" array. The first language is the most accurate user preference language. Use this property as the default language for your customer. For some special scenario such as a German working in Australia, he want to use English as the default language. Provide a language setting feature in your app. Let the customer to choose what he likes.

    If I misunderstand you, please feel free to let me know.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, September 26, 2014 2:51 AM
    Moderator