feat(spellcheck): add Ukrainian language for spellcheck (#1382)
This commit is contained in:
@@ -714,7 +714,7 @@ export default class SettingsPage extends React.Component {
|
|||||||
{'Check spelling'}
|
{'Check spelling'}
|
||||||
<HelpBlock>
|
<HelpBlock>
|
||||||
{'Highlight misspelled words in your messages.'}
|
{'Highlight misspelled words in your messages.'}
|
||||||
{' Available for English, French, German, Portuguese, Russian, Spanish, and Dutch.'}
|
{' Available for English, French, German, Portuguese, Russian, Ukrainian, Spanish, and Dutch.'}
|
||||||
</HelpBlock>
|
</HelpBlock>
|
||||||
</Checkbox>);
|
</Checkbox>);
|
||||||
|
|
||||||
|
@@ -30,6 +30,7 @@ function getSpellCheckerLocaleMenus(onSelectSpellCheckerLocale) {
|
|||||||
{language: 'Polish', locale: 'pl-PL'},
|
{language: 'Polish', locale: 'pl-PL'},
|
||||||
{language: 'Portuguese (BR)', locale: 'pt-BR'},
|
{language: 'Portuguese (BR)', locale: 'pt-BR'},
|
||||||
{language: 'Russian', locale: 'ru-RU'},
|
{language: 'Russian', locale: 'ru-RU'},
|
||||||
|
{language: 'Ukrainian', locale: 'uk-UA'},
|
||||||
{language: 'Spanish (ES)', locale: 'es-ES'},
|
{language: 'Spanish (ES)', locale: 'es-ES'},
|
||||||
{language: 'Spanish (MX)', locale: 'es-MX'},
|
{language: 'Spanish (MX)', locale: 'es-MX'},
|
||||||
{language: 'Dutch', locale: 'nl-NL'},
|
{language: 'Dutch', locale: 'nl-NL'},
|
||||||
|
@@ -119,5 +119,8 @@ SpellChecker.getSpellCheckerLocale = (electronLocale) => {
|
|||||||
if (electronLocale.match(/^ru-?/)) {
|
if (electronLocale.match(/^ru-?/)) {
|
||||||
return 'ru-RU';
|
return 'ru-RU';
|
||||||
}
|
}
|
||||||
|
if (electronLocale.match(/^uk-?/)) {
|
||||||
|
return 'uk-UA';
|
||||||
|
}
|
||||||
return 'en-US';
|
return 'en-US';
|
||||||
};
|
};
|
||||||
|
@@ -36,6 +36,9 @@ describe('main/Spellchecker.js', function() {
|
|||||||
|
|
||||||
SpellChecker.getSpellCheckerLocale('ru').should.equal('ru-RU');
|
SpellChecker.getSpellCheckerLocale('ru').should.equal('ru-RU');
|
||||||
SpellChecker.getSpellCheckerLocale('ru-RU').should.equal('ru-RU');
|
SpellChecker.getSpellCheckerLocale('ru-RU').should.equal('ru-RU');
|
||||||
|
|
||||||
|
SpellChecker.getSpellCheckerLocale('uk').should.equal('uk-UA');
|
||||||
|
SpellChecker.getSpellCheckerLocale('uk-UA').should.equal('uk-UA');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -134,6 +137,25 @@ describe('main/Spellchecker.js', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('uk-UA', function() {
|
||||||
|
let spellchecker = null;
|
||||||
|
|
||||||
|
before(function(done) {
|
||||||
|
spellchecker = new SpellChecker(
|
||||||
|
'uk-UA',
|
||||||
|
path.resolve(__dirname, '../../src/node_modules/simple-spellchecker/dict'),
|
||||||
|
done
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should spellcheck', function() {
|
||||||
|
spellchecker.spellCheck('українська').should.equal(true);
|
||||||
|
});
|
||||||
|
it('should give suggestions', function() {
|
||||||
|
spellchecker.getSuggestions('украінська', 1).length.should.be.equal(1);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe('de-DE', function() {
|
describe('de-DE', function() {
|
||||||
let spellchecker = null;
|
let spellchecker = null;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user