I have looked over this article regarding globalization in Xamarin Forms. The article indicates I need to create an interface in order to access the language on each platform. However, in my last App, I was able to simply put this line of code in my shared code and it seemed to work fine for getting the language:
ls_Language = CultureInfo.CurrentUICulture.TwoLetterISOLanguageName;
Is there a reason a line of code similar to this wont work for Globalization using a resource file in Xamarin Forms?
Yes, your code is to set resource Culture when the application first loads, it is the same as using the DependencyService in the Xamarin.Forms App class to call the interface and set our RESX resources culture to the correct value.
You may optionally update this value according to platform-specific events that may be raised on iOS or Android if the user updates their language preferences while the app is running. So you need to use ILocalize interface.