For Xamarin.Forms localization, do I need to implement ILocalize?

梦想的初衷 提交于 2019-12-13 03:24:26

问题


In Xamarin help page https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/localization/text?tabs=windows, for "Displaying the Correct Language", it suggests to define interface ILocalize then use DependencyService to get some locale info.

However, My Xamarin.Forms Android app could just pick the right language resource file according to the locale settings of the device, and display rightful language.

So translations are working fine without ILocalize and the implementations. Do I really need ILocalize and the implementations?


回答1:


No need of DependencyService, Xamarin.Forms automatically recognizes it and gets the appropriate resource file. Docs needs to be updated, an issue was opened for the same



来源:https://stackoverflow.com/questions/53026519/for-xamarin-forms-localization-do-i-need-to-implement-ilocalize

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!