tag:blogger.com,1999:blog-5359546512544809971.post6930289724958866632..comments2024-03-29T00:46:49.972-07:00Comments on Jeremy Bytes: Changing Culture in WPFJeremyhttp://www.blogger.com/profile/06749690234470413216noreply@blogger.comBlogger8125tag:blogger.com,1999:blog-5359546512544809971.post-64437953249346499312019-08-26T12:03:11.914-07:002019-08-26T12:03:11.914-07:00Yes this is normal. The easiest way to get the new...Yes this is normal. The easiest way to get the new culture/language is to close and reopen all windows (including the child windows). Other solutions are a bit more complex and often include libraries that need custom properties added to the UI controls for data binding. That's why I use the hack that is shown in this article. It doesn't address all scenarios (such as needing to maintain data when the form is reopened), but it works well for the scenario described here.Jeremyhttps://www.blogger.com/profile/06749690234470413216noreply@blogger.comtag:blogger.com,1999:blog-5359546512544809971.post-56922807770469945732019-08-26T01:01:16.263-07:002019-08-26T01:01:16.263-07:00Hi I have a multi windows app. I am trying to do ...Hi I have a multi windows app. I am trying to do the selection from a child window. if i use your code, it will change the main window's language, child window doesn't change until i close and reopen. is this normal? any idea how i can fix it? thank youaxismhttps://www.blogger.com/profile/12341730409088621222noreply@blogger.comtag:blogger.com,1999:blog-5359546512544809971.post-30618794341202926332018-03-02T13:57:21.273-08:002018-03-02T13:57:21.273-08:00Nice and easy solution, thanks. For a good user ex...Nice and easy solution, thanks. For a good user experience I'd say that the "context" of the application must be restored, but as you can keep all view models alive it should not be too difficult.Anonymoushttps://www.blogger.com/profile/11278501493321889148noreply@blogger.comtag:blogger.com,1999:blog-5359546512544809971.post-81890659172328480682017-03-06T08:53:53.792-08:002017-03-06T08:53:53.792-08:00When the application starts up, the thread automat...When the application starts up, the thread automatically gets the CurrentCulture, so you don't need to set it in the OnStartup() method. You probably need to add a Resources.hi-IN.resx file if that's the culture you're trying to use. If .NET can't find the specified culture, then it defaults to the en-US resource file (Microsoft is a bit US-centric).<br /><br />For more information, you might want to look at my Pluralsight course on Localization and Globalization (http://www.pluralsight.com/courses/intro-to-localization-globalization-dotnet). You can sign up for a 10-day free-trial which would allow you to watch the course.Jeremyhttps://www.blogger.com/profile/06749690234470413216noreply@blogger.comtag:blogger.com,1999:blog-5359546512544809971.post-60046710128003195382017-03-05T08:45:22.309-08:002017-03-05T08:45:22.309-08:00Do OnStartUp() need to update to following one so ...Do OnStartUp() need to update to following one so that Current culture is used properly to populate Greeting string from Resource.resx file instead of Resources.en.resx.<br /><br />For example if I change Format to hi-IN. In this case above OnStartUp() will not populate greeting string from Resource.resx<br /><br />If if looked, CultureInfo.CurrentCulture is showing hi-IN. Following is the changed code. Please correct if it is wrong.<br /><br /> protected override void OnStartup(StartupEventArgs e)<br /> {<br /> base.OnStartup(e);<br /> Thread.CurrentThread.CurrentCulture = CultureInfo.CurrentCulture;<br /> Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentCulture;<br /> Application.Current.MainWindow = new MainWindow();<br /> Application.Current.MainWindow.Show();<br /> }<br /><br />Anonymoushttps://www.blogger.com/profile/07086382800563824831noreply@blogger.comtag:blogger.com,1999:blog-5359546512544809971.post-54302435370246775552015-10-22T23:22:30.806-07:002015-10-22T23:22:30.806-07:00ThanksThanksBurak SEYHANhttps://www.blogger.com/profile/18102292109791271880noreply@blogger.comtag:blogger.com,1999:blog-5359546512544809971.post-43695587605149858242015-06-10T11:09:08.628-07:002015-06-10T11:09:08.628-07:00Nice!!!Nice!!!Software Dev Tips & Noteshttps://www.blogger.com/profile/05531731349412203107noreply@blogger.comtag:blogger.com,1999:blog-5359546512544809971.post-57322415516703697202014-07-03T13:05:22.712-07:002014-07-03T13:05:22.712-07:00Nice, tyNice, tysalonsohttps://www.blogger.com/profile/12593032309144229807noreply@blogger.com