Localization - Xamarin
With Xamarin, you can use CultureInfo
to set a language. For more information, see String and Image localization in Xamarin Forms.
using System.Globalization;
using System.Threading;
CultureInfo ci = CultureInfo.GetCultureInfo(DependencyService.Get<IGeneralPreferences>().Language);
CultureInfo.DefaultThreadCurrentCulture = ci;
CultureInfo.DefaultThreadCurrentUICulture = ci;
AppResources.Culture = ci;
CultureInfo.CurrentUICulture = ci;
Thread.CurrentThread.CurrentUICulture = ci;
Thread.CurrentThread.CurrentCulture = ci;