Add context menu to select spelling language

This commit is contained in:
Yuya Ochiai
2017-04-27 00:42:48 +09:00
parent 3a9227f974
commit 256e317402
10 changed files with 103 additions and 44 deletions

View File

@@ -66,4 +66,23 @@ class SpellChecker {
}
}
SpellChecker.getSpellCheckerLocale = (electronLocale) => {
if (electronLocale.match(/^en-?/)) {
return 'en-US';
}
if (electronLocale.match(/^fr-?/)) {
return 'fr-FR';
}
if (electronLocale.match(/^de-?/)) {
return 'de-DE';
}
if (electronLocale.match(/^es-?/)) {
return 'es-ES';
}
if (electronLocale.match(/^nl-?/)) {
return 'nl-NL';
}
return 'en-US';
};
module.exports = SpellChecker;