简体   繁体   English

如何知道本地化中以前选择的语言?

[英]How to know previously selected language in the localization?

I have two languages, English and Gujarati for UI. 我有两种语言,用于UI的英语和古吉拉特语。 If, At the time of closing UI language is Gujarati, then at the opening time also language should be Gujarati. 如果在关闭UI时语言是古吉拉特语,那么在开放时间,语言也应该是古吉拉特语。 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 在这里,您可以检查操作方法: http : //www.codeproject.com/Articles/3389/Read-write-and-delete-from-registry-with-C

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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