Reputation: 198
How can we check that the selected keyboard is not English and it is in Arabic. So on later stage i convert the Arabic digits to English numeric digits for better search on web server.
Upvotes: 0
Views: 458
Reputation: 6152
You can know the current language of the phone. By the following code
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSArray *languages = [defaults objectForKey:@"AppleLanguages"];
NSString *currentLanguage = [languages objectAtIndex:0];
NSLog(@"Current Locale: %@", [[NSLocale currentLocale] localeIdentifier]);
NSLog(@"Current language: %@", currentLanguage);
If it is in Arabic, that means the keyboard will also comes in Arabic and user will enter the Arabic text.
Upvotes: 1