问题
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