iOS Question Getting current device language in iOS?

Filippo

Expert
Licensed User
Hi Erel,

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

Filippo

Expert
Licensed User
Mille Grazie Erel! :)
 

Filippo

Expert
Licensed User
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:
 

moster67

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

Filippo

Expert
Licensed User

quimacama

Member
Licensed 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:(
 

moster67

Expert
Licensed 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.
 
Top