Private Sub FindLocale As String
#if B4A or B4J
Dim jo As JavaObject
jo = jo.InitializeStatic("java.util.Locale").RunMethod("getDefault", Null)
Return jo.RunMethod("getLanguage", Null)
#else if B4i
Dim no As NativeObject
Dim lang As String = no.Initialize("NSLocale") _
.RunMethod("preferredLanguages", Null).RunMethod("objectAtIndex:", Array(0)).AsString
If lang.Length > 2 Then lang = lang.SubString2(0, 2)
Return lang
#end if
End Sub