gpt4 book ai didi

.net - Silverlight 本地化 - 如何覆盖 Windows 区域性

转载 作者:行者123 更新时间:2023-12-05 01:34:56 25 4
gpt4 key购买 nike

我有英语 Windows 版本,目前无法调试它,但我正在将应用程序本地化为俄语和英语两种语言。

据我了解,在 App 构造函数中,以下代码应该足够了:

            if (Language == Language.Russian) {
Thread.CurrentThread.CurrentCulture = RUSSIAN_CULTURE;
Thread.CurrentThread.CurrentUICulture = RUSSIAN_CULTURE;
}
else {
Thread.CurrentThread.CurrentCulture = ENGLISH_CULTURE;
Thread.CurrentThread.CurrentUICulture = ENGLISH_CULTURE;
}

文化对象是正确的文化(ru-RU、en-US)。

然而,当应用程序在俄语窗口上运行时,if 被忽略,并且只使用俄语字符串。

请注意,语言更改在我的机器上完全正确(en windows)

最佳答案

我在 Jeff Richter 的“CLR via C#”一书中读到了这个:

(关于 CurrentUICulture)

By default, when you create a thread, this thread property is set to a CulterInfo object, which identifies the language of the Windows version the application is running on using Win32 GetUserDefaultUILanguage function. If you are running a Multilingual User Interface (MUI) version of windows, you can set this via the "Regional and Language Options" Control Panel settings. On a non-MUI version of Windows, the language is determined by the localised version of the OS installed (or the installed language pack) and the language is not changeable.

关于.net - Silverlight 本地化 - 如何覆盖 Windows 区域性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6770695/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com