add Russian language in the list available for spellcheck (#1375)
This commit is contained in:
@@ -716,7 +716,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, Spanish, and Dutch.'}
|
{' Available for English, French, German, Portuguese, Russian, Spanish, and Dutch.'}
|
||||||
</HelpBlock>
|
</HelpBlock>
|
||||||
</Checkbox>);
|
</Checkbox>);
|
||||||
|
|
||||||
|
@@ -29,6 +29,7 @@ function getSpellCheckerLocaleMenus(onSelectSpellCheckerLocale) {
|
|||||||
{language: 'German', locale: 'de-DE'},
|
{language: 'German', locale: 'de-DE'},
|
||||||
{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: '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'},
|
||||||
|
@@ -116,5 +116,8 @@ SpellChecker.getSpellCheckerLocale = (electronLocale) => {
|
|||||||
if (electronLocale.match(/^it-?/)) {
|
if (electronLocale.match(/^it-?/)) {
|
||||||
return 'it-IT';
|
return 'it-IT';
|
||||||
}
|
}
|
||||||
|
if (electronLocale.match(/^ru-?/)) {
|
||||||
|
return 'ru-RU';
|
||||||
|
}
|
||||||
return 'en-US';
|
return 'en-US';
|
||||||
};
|
};
|
||||||
|
6
src/package-lock.json
generated
6
src/package-lock.json
generated
@@ -747,9 +747,9 @@
|
|||||||
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
|
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc="
|
||||||
},
|
},
|
||||||
"simple-spellchecker": {
|
"simple-spellchecker": {
|
||||||
"version": "1.0.0",
|
"version": "1.0.1",
|
||||||
"resolved": "https://registry.npmjs.org/simple-spellchecker/-/simple-spellchecker-1.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/simple-spellchecker/-/simple-spellchecker-1.0.1.tgz",
|
||||||
"integrity": "sha512-gOQdOyXV/SoQJ2MfNj2eEbumnDIMWa6ET01xvK+fbHfZMjMC08ZNGNqa6WZmtoLxzK0l3IRkxALRaOo9Pg0jPg==",
|
"integrity": "sha512-uYwrcM6kYR7g9psVdkKVap5fXJI1OSHWowsbowcUmH4VS178LcUCGS6E6/F9lsfRYVzFghJeF1zZL8W0GrBocA==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"adm-zip": "^0.4.13",
|
"adm-zip": "^0.4.13",
|
||||||
"binarysearch": "^0.2.4",
|
"binarysearch": "^0.2.4",
|
||||||
|
@@ -24,7 +24,7 @@
|
|||||||
"react-dom": "^16.6.3",
|
"react-dom": "^16.6.3",
|
||||||
"react-transition-group": "^2.5.0",
|
"react-transition-group": "^2.5.0",
|
||||||
"semver": "^5.5.0",
|
"semver": "^5.5.0",
|
||||||
"simple-spellchecker": "^1.0.0",
|
"simple-spellchecker": "^1.0.1",
|
||||||
"underscore": "^1.9.1",
|
"underscore": "^1.9.1",
|
||||||
"valid-url": "^1.0.9",
|
"valid-url": "^1.0.9",
|
||||||
"winreg": "^1.2.4",
|
"winreg": "^1.2.4",
|
||||||
|
@@ -33,6 +33,9 @@ describe('main/Spellchecker.js', function() {
|
|||||||
|
|
||||||
SpellChecker.getSpellCheckerLocale('it').should.equal('it-IT');
|
SpellChecker.getSpellCheckerLocale('it').should.equal('it-IT');
|
||||||
SpellChecker.getSpellCheckerLocale('it-IT').should.equal('it-IT');
|
SpellChecker.getSpellCheckerLocale('it-IT').should.equal('it-IT');
|
||||||
|
|
||||||
|
SpellChecker.getSpellCheckerLocale('ru').should.equal('ru-RU');
|
||||||
|
SpellChecker.getSpellCheckerLocale('ru-RU').should.equal('ru-RU');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -112,6 +115,25 @@ describe('main/Spellchecker.js', function() {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('ru-RU', function() {
|
||||||
|
let spellchecker = null;
|
||||||
|
|
||||||
|
before(function(done) {
|
||||||
|
spellchecker = new SpellChecker(
|
||||||
|
'ru-RU',
|
||||||
|
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