How can I get windows language? B4A has the "AHLocale" library. With the query "loc.Language" I can find out the current language of the system Android. Is it possible to do this somehow in B4J?
How can I get windows language? B4A has the "AHLocale" library. With the query "loc.Language" I can find out the current language of the system Android. Is it possible to do this somehow in B4J?
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