approximate translation from here :
Cocoa has an API for checking the string language.
NSArray *tagschemes = [NSArray arrayWithObjects:NSLinguisticTagSchemeLanguage, nil]; NSLinguisticTagger *tagger = [[NSLinguisticTagger alloc] initWithTagSchemes:tagschemes options:0]; [tagger setString:@"Das ist ein bisschen deutscher Text. Bitte löschen Sie diesen nicht."]; NSString *language = [tagger tagAtIndex:0 scheme:NSLinguisticTagSchemeLanguage tokenRange:NULL sentenceRange:NULL];
Another approach, if you have several languages in the text, you can use enumerateLinguisticTagsInRange to get the language of a single word in the text.