简体   繁体   中英

How to know previously selected language in the localization?

I have two languages, English and Gujarati for UI. If, At the time of closing UI language is Gujarati, then at the opening time also language should be Gujarati. How do I know this: ?? the code for language selection is here.

ComboBoxItem englishLanguageItem = new ComboBoxItem()
        { 
            Content = Strings.MainWindow_Language_Selection_English_Label
        };

        ComboBoxItem gujaratiLanguageItem = new ComboBoxItem()
        {
            Content = Strings.MainWindow_Language_Selection_Gujarati_Label
        };

Please give some code regarding it.

Not sure if I understood your problem. You need to know what was the last selected language, so when your program is re-open, it comes up with that language?

If so, you have to save it somewhere, maybe on registry.

Here you can check how to do it: http://www.codeproject.com/Articles/3389/Read-write-and-delete-from-registry-with-C

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM