Problem:
Can we load a resource file without changing the language from device settings?
Solution:
The answer is, Yes!
You can actually force an application to load a French resource by manipulating the Culture Settings in the Thread class. There's a trick about that.
Based on my experiences, I always use this small but efficient method to force loading various languages:
public void SetLang(string lang) { App.RootFrame.Language = XmlLanguage.GetLanguage(AppResources.ResourceLanguage); Thread.CurrentThread.CurrentCulture = new CultureInfo(lang); Thread.CurrentThread.CurrentUICulture = new CultureInfo(lang); NavigationService.Navigate(new Uri(string.Format("/MainPage.xaml?random={0}", Guid.NewGuid()), UriKind.Relative)); NavigationService.RemoveBackEntry(); |

Join the conversation! Your thoughts help the community grow.