사용자가 사용중인 current keyboard
의 language
을 가져올 수 있습니까? 사용자가 영어 키보드 또는 중국어 키보드 또는 다른 언어를 사용하고있는 것을 볼 수 있습니까?iOS 키보드 언어 가져 오기
기기의 언어를 사용할 수는 있지만 사용자의 입력 언어를 사용해야합니다.
미리 감사드립니다.
사용자가 사용중인 current keyboard
의 language
을 가져올 수 있습니까? 사용자가 영어 키보드 또는 중국어 키보드 또는 다른 언어를 사용하고있는 것을 볼 수 있습니까?iOS 키보드 언어 가져 오기
기기의 언어를 사용할 수는 있지만 사용자의 입력 언어를 사용해야합니다.
미리 감사드립니다.
당신이 documentation에서 울부 짖는 소리
[UITextInputMode currentInputMode].primaryLanguage
같이 얻을 수 있습니다, 당신은 더 NSLocale
를 사용하여 언어의 나 displayName을 얻을 수 있습니다.
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:[YOUR_TEXTFIELD_INSTANCE textInputMode].primaryLanguage];
NSLog(@"%@", [locale displayNameForKey:NSLocaleIdentifier value:[YOUR_TEXTFIELD_INSTANCE textInputMode].primaryLanguage]);
NSLog 인쇄 "영어 (미국)"기본 언어는 En-US
경우.
참고 : currentInputMode
은 iOS 7.0에서 사용되지 않습니다. 위와 같이 textInputMode
을 사용해보십시오.
참조 : http : //stackoverflow.com/questions/1414876/detecting-current-iphone-input-language –
http://tech.pro/tutorial/970/a-simple-localization-example- 아이폰 용 – Mohit