Permalink
Browse files

Assume the current locale's language if none is provided. This is eno…

…ugh to make custom keyboard layouts give the default press-and-hold behavior!
  • Loading branch information...
belkadan committed Apr 23, 2012
1 parent 9cdcc02 commit 6ef2d2d2680068e79d3443d06f46795cd4c5401e
Showing with 7 additions and 5 deletions.
  1. +7 −5 MagicPressAndHold/Server.m
View
@@ -25,12 +25,14 @@ + (void)load
#pragma mark -
- (NSString *)ComBelkadanPressAndHold_accentsStringForString:(NSString *)string language:(NSString *)language
- (NSString *)ComBelkadanPressAndHold_accentsStringForString:(NSString *)input language:(NSString *)language
{
NSLog(@"%@ (%@ / %@)", string, language, [language class]);
id result = [self ComBelkadanPressAndHold_accentsStringForString:string language:language];
NSLog(@"-> %@ (%@)", result, [result class]);
return result;
if ([language length] == 0) {
language = [[NSLocale currentLocale] objectForKey:NSLocaleLanguageCode];
}
// Returns a space-separated list of possible replacements for the input string.
return [self ComBelkadanPressAndHold_accentsStringForString:input language:language];
}
@end

0 comments on commit 6ef2d2d

Please sign in to comment.