Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist

patch for emacs-inline.patch: Use preferredLanguages instead of currentLocale.

View gist:1250669
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
diff --git a/src/macim.m b/src/macim.m
index d4444db..515cf25 100644
--- a/src/macim.m
+++ b/src/macim.m
@@ -100,7 +100,14 @@ DEFUN ("mac-toggle-input-source", Fmac_toggle_input_source,
}
else
{
- NSString *locale = [[NSLocale currentLocale] localeIdentifier];
+ NSString *locale;
+ NSArray *languages = [NSLocale preferredLanguages];
+ if (languages != nil) {
+ locale = [languages objectAtIndex:0];
+ } else {
+ locale = [[NSLocale currentLocale]
+ objectForKey:NSLocaleLanguageCode];
+ }
is = TISCopyInputSourceForLanguage(locale);
}
if (is) TISSelectInputSource(is);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.