iOS Question Getting current device language in iOS?

D

Deleted member 103

Guest
Hi Erel,

can be used with NativeObject this code?
B4X:
NSString * myString = [[NSLocale preferredlanguage]objectAtIndex:0];

stackoverflow-link
 
D

Deleted member 103

Guest
Yes:
B4X:
Sub GetPreferredLanguage As String
    Dim no As NativeObject
    Return no.Initialize("NSLocale") _
        .RunMethod("preferredLanguages", Null).RunMethod("objectAtIndex:", Array(0)).AsString
End Sub
Before iOS-9 provides this function for Germany, for example, "de", now with iOS-9 provides "de-DE" and will no longer be recognized correctly by my app. :(
Because of these errors, if this is an error, I now need to update all of my app's. :mad:
Again two weeks waiting period. :mad::mad:
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
Didn't you test before with the beta versions of iOS9?
 
Upvote 0

quimacama

Member
Licensed User
Longtime User
Before iOS-9 provides this function for Germany, for example, "de", now with iOS-9 provides "de-DE" and will no longer be recognized correctly by my app.
Because of these errors, if this is an error, I now need to update all of my app's. :mad:
Again two weeks waiting period. :mad::mad:

The same happens to me:(
 
Upvote 0

moster67

Expert
Licensed User
Longtime User
That is what I meant with my previous post.

The purpose of the iOS beta is that so you can install it and check your apps BEFORE the final release. If you do this, you can check your apps and make sure that they work correctly. If the apps are not working as expected, you can fix them and upload your apps to the Appstore so they are ready before the final release of the new version of iOS.
 
Upvote 0
Top