Xamarin.Forms : How to use localization independent of device language

前端 未结 3 1146
有刺的猬
有刺的猬 2021-02-19 10:06

I am developing a Xamarin.Forms app (portable class library project) with Visual Studio 2013 CE. First I\'m focusing the iOS version.

Now I\'m thinking about how to make

3条回答
  •  北恋
    北恋 (楼主)
    2021-02-19 10:26

    you can call setLocale method available in each platform projects from PCL using the interface ILocalize like this:

    CultureInfo ci=new CultureInfo("ar");
    Xamarin.Forms.DependencyService.Get().SetLocale(ci);                      
    
    AppResources.Culture = ci;
    

提交回复
热议问题