fix(spellchecker): add back in split call

Fixes the spec test when only the language (e.g. 'en') is supplied and still
recognize the language.
This commit is contained in:
mbilker 2016-01-27 15:49:37 -05:00
parent 8efb711bfe
commit fab11f649d

View file

@ -12,7 +12,7 @@ class NylasSpellchecker
isLanguageAvailable: (lang) =>
return false unless lang
dicts = @getAvailableDictionaries()
return (lang in dicts) or (lang.replace('_', '-') in dicts) or (lang.replace('-', '_') in dicts)
return (lang in dicts) or (lang.split(/[-_]/)[0] in dicts) or (lang.replace('_', '-') in dicts) or (lang.replace('-', '_') in dicts)
isSpelledCorrectly: (args...) => not @isMisspelled(args...)