Commit 66db04b4 authored by Sergey Malenkov's avatar Sergey Malenkov
Browse files

IDEA-CR-45701: IDEA-209426: add English locales for some countries to support AltGr

(cherry picked from commit eb90b189)
parent dc80d909
Showing with 15 additions and 1 deletion
+15 -1
......@@ -27,6 +27,7 @@ import com.intellij.openapi.actionSystem.impl.ActionButtonWithText;
import com.intellij.openapi.actionSystem.impl.PresentationFactory;
import com.intellij.openapi.application.*;
import com.intellij.openapi.application.impl.LaterInvocator;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.keymap.KeyMapBundle;
import com.intellij.openapi.keymap.Keymap;
import com.intellij.openapi.keymap.KeymapManager;
......@@ -87,6 +88,7 @@ import java.util.*;
public final class IdeKeyEventDispatcher implements Disposable {
@NonNls
private static final String GET_CACHED_STROKE_METHOD_NAME = "getCachedStroke";
private static final Logger LOG = Logger.getInstance(IdeKeyEventDispatcher.class);
private KeyStroke myFirstKeyStroke;
/**
......@@ -982,7 +984,11 @@ public final class IdeKeyEventDispatcher implements Disposable {
Locale locale = context.getLocale();
if (locale == null) return false;
String language = locale.getLanguage();
return ALT_GR_LANGUAGES.contains(language);
boolean contains = !"en".equals(language)
? ALT_GR_LANGUAGES.contains(language)
: ALT_GR_COUNTRIES.contains(locale.getCountry());
LOG.debug("AltGr", contains ? "" : " not", " supported for ", locale);
return contains;
}
// http://www.oracle.com/technetwork/java/javase/documentation/jdk12locales-5294582.html
......@@ -1009,4 +1015,12 @@ public final class IdeKeyEventDispatcher implements Disposable {
"sv", // Swedish
"tr" // Turkish
));
@NonNls private static final Set<String> ALT_GR_COUNTRIES = new HashSet<>(Arrays.asList(
"DK", // Denmark
"DE", // Germany
"FI", // Finland
"NL", // Netherlands
"SL", // Slovenia
"SE" // Sweden
));
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment