Private Sub Application_Start (Nav As NavigationController)
NavControl = Nav
Page1.Initialize("Page1")
Page1.RootPanel.LoadLayout("Page1")
NavControl.ShowPage(Page1)
'Get Language Device and Set Language <----------------
SetDateTimeLocale(GetPreferredLanguage)
Log(DateUtils.GetMonthName(DateTime.Now))
End Sub
Sub SetDateTimeLocale (locale As String)
Dim loc As NativeObject
loc = loc.Initialize("NSLocale").RunMethod("localeWithLocaleIdentifier:", Array(locale))
Dim no As NativeObject = DateTime
no.GetField("dateFormat").SetField("locale", loc)
no.GetField("timeFormat").SetField("locale", loc)
End Sub
Sub GetPreferredLanguage As String
Dim no As NativeObject
Return no.Initialize("NSLocale").RunMethod("preferredLanguages", Null).RunMethod("objectAtIndex:", Array(0)).AsString
End Sub