diff options
author | 2019-02-12 20:42:21 +0100 | |
---|---|---|
committer | 2019-02-12 20:42:21 +0100 | |
commit | 2d5a303b1cc559339c3ecc7a176e9d8bd66755ef (patch) | |
tree | 2a97c1db68a72b8e208bd177af7faad5df2c9f48 | |
parent | feat(Windows): Add option to quit Franz from Taskbar icon (diff) | |
parent | feat(Spell checking): Add option to automatically detect language (diff) | |
download | ferdium-app-2d5a303b1cc559339c3ecc7a176e9d8bd66755ef.tar.gz ferdium-app-2d5a303b1cc559339c3ecc7a176e9d8bd66755ef.tar.zst ferdium-app-2d5a303b1cc559339c3ecc7a176e9d8bd66755ef.zip |
Merge branch 'feature/spellcheck-autodetect' into develop
-rw-r--r-- | package-lock.json | 545 | ||||
-rw-r--r-- | src/components/settings/services/EditServiceForm.js | 10 | ||||
-rw-r--r-- | src/containers/settings/EditServiceScreen.js | 40 | ||||
-rw-r--r-- | src/containers/settings/EditSettingsScreen.js | 16 | ||||
-rw-r--r-- | src/features/spellchecker/index.js | 8 | ||||
-rw-r--r-- | src/helpers/i18n-helpers.js | 27 | ||||
-rw-r--r-- | src/i18n/globalMessages.js | 16 | ||||
-rw-r--r-- | src/i18n/locales/en-US.json | 4 | ||||
-rw-r--r-- | src/webview/contextMenu.js | 12 | ||||
-rw-r--r-- | src/webview/recipe.js | 56 | ||||
-rw-r--r-- | src/webview/spellchecker.js | 11 |
11 files changed, 295 insertions, 450 deletions
diff --git a/package-lock.json b/package-lock.json index 110b3d682..159e8d465 100644 --- a/package-lock.json +++ b/package-lock.json | |||
@@ -350,6 +350,76 @@ | |||
350 | "@babel/template": "^7.1.2", | 350 | "@babel/template": "^7.1.2", |
351 | "@babel/traverse": "^7.1.5", | 351 | "@babel/traverse": "^7.1.5", |
352 | "@babel/types": "^7.3.0" | 352 | "@babel/types": "^7.3.0" |
353 | }, | ||
354 | "dependencies": { | ||
355 | "@babel/generator": { | ||
356 | "version": "7.3.2", | ||
357 | "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.2.tgz", | ||
358 | "integrity": "sha512-f3QCuPppXxtZOEm5GWPra/uYUjmNQlu9pbAD8D/9jze4pTY83rTtB1igTBSwvkeNlC5gR24zFFkz+2WHLFQhqQ==", | ||
359 | "dev": true, | ||
360 | "requires": { | ||
361 | "@babel/types": "^7.3.2", | ||
362 | "jsesc": "^2.5.1", | ||
363 | "lodash": "^4.17.10", | ||
364 | "source-map": "^0.5.0", | ||
365 | "trim-right": "^1.0.1" | ||
366 | } | ||
367 | }, | ||
368 | "@babel/parser": { | ||
369 | "version": "7.3.2", | ||
370 | "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.2.tgz", | ||
371 | "integrity": "sha512-QzNUC2RO1gadg+fs21fi0Uu0OuGNzRKEmgCxoLNzbCdoprLwjfmZwzUrpUNfJPaVRwBpDY47A17yYEGWyRelnQ==", | ||
372 | "dev": true | ||
373 | }, | ||
374 | "@babel/traverse": { | ||
375 | "version": "7.2.3", | ||
376 | "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.2.3.tgz", | ||
377 | "integrity": "sha512-Z31oUD/fJvEWVR0lNZtfgvVt512ForCTNKYcJBGbPb1QZfve4WGH8Wsy7+Mev33/45fhP/hwQtvgusNdcCMgSw==", | ||
378 | "dev": true, | ||
379 | "requires": { | ||
380 | "@babel/code-frame": "^7.0.0", | ||
381 | "@babel/generator": "^7.2.2", | ||
382 | "@babel/helper-function-name": "^7.1.0", | ||
383 | "@babel/helper-split-export-declaration": "^7.0.0", | ||
384 | "@babel/parser": "^7.2.3", | ||
385 | "@babel/types": "^7.2.2", | ||
386 | "debug": "^4.1.0", | ||
387 | "globals": "^11.1.0", | ||
388 | "lodash": "^4.17.10" | ||
389 | } | ||
390 | }, | ||
391 | "@babel/types": { | ||
392 | "version": "7.3.2", | ||
393 | "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.2.tgz", | ||
394 | "integrity": "sha512-3Y6H8xlUlpbGR+XvawiH0UXehqydTmNmEpozWcXymqwcrwYAl5KMvKtQ+TF6f6E08V6Jur7v/ykdDSF+WDEIXQ==", | ||
395 | "dev": true, | ||
396 | "requires": { | ||
397 | "esutils": "^2.0.2", | ||
398 | "lodash": "^4.17.10", | ||
399 | "to-fast-properties": "^2.0.0" | ||
400 | } | ||
401 | }, | ||
402 | "debug": { | ||
403 | "version": "4.1.1", | ||
404 | "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", | ||
405 | "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", | ||
406 | "dev": true, | ||
407 | "requires": { | ||
408 | "ms": "^2.1.1" | ||
409 | } | ||
410 | }, | ||
411 | "ms": { | ||
412 | "version": "2.1.1", | ||
413 | "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", | ||
414 | "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", | ||
415 | "dev": true | ||
416 | }, | ||
417 | "source-map": { | ||
418 | "version": "0.5.7", | ||
419 | "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", | ||
420 | "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", | ||
421 | "dev": true | ||
422 | } | ||
353 | } | 423 | } |
354 | }, | 424 | }, |
355 | "@babel/highlight": { | 425 | "@babel/highlight": { |
@@ -2423,8 +2493,7 @@ | |||
2423 | "ansi-regex": { | 2493 | "ansi-regex": { |
2424 | "version": "3.0.0", | 2494 | "version": "3.0.0", |
2425 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", | 2495 | "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", |
2426 | "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", | 2496 | "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" |
2427 | "dev": true | ||
2428 | }, | 2497 | }, |
2429 | "ansi-styles": { | 2498 | "ansi-styles": { |
2430 | "version": "3.2.1", | 2499 | "version": "3.2.1", |
@@ -3095,8 +3164,7 @@ | |||
3095 | "balanced-match": { | 3164 | "balanced-match": { |
3096 | "version": "1.0.0", | 3165 | "version": "1.0.0", |
3097 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", | 3166 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", |
3098 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", | 3167 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" |
3099 | "dev": true | ||
3100 | }, | 3168 | }, |
3101 | "base": { | 3169 | "base": { |
3102 | "version": "0.11.2", | 3170 | "version": "0.11.2", |
@@ -3367,7 +3435,6 @@ | |||
3367 | "version": "1.1.11", | 3435 | "version": "1.1.11", |
3368 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", | 3436 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", |
3369 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", | 3437 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", |
3370 | "dev": true, | ||
3371 | "requires": { | 3438 | "requires": { |
3372 | "balanced-match": "^1.0.0", | 3439 | "balanced-match": "^1.0.0", |
3373 | "concat-map": "0.0.1" | 3440 | "concat-map": "0.0.1" |
@@ -4264,8 +4331,7 @@ | |||
4264 | "concat-map": { | 4331 | "concat-map": { |
4265 | "version": "0.0.1", | 4332 | "version": "0.0.1", |
4266 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", | 4333 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", |
4267 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", | 4334 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" |
4268 | "dev": true | ||
4269 | }, | 4335 | }, |
4270 | "concat-stream": { | 4336 | "concat-stream": { |
4271 | "version": "1.6.2", | 4337 | "version": "1.6.2", |
@@ -7453,40 +7519,30 @@ | |||
7453 | "dependencies": { | 7519 | "dependencies": { |
7454 | "abbrev": { | 7520 | "abbrev": { |
7455 | "version": "1.1.1", | 7521 | "version": "1.1.1", |
7456 | "bundled": true, | 7522 | "bundled": true |
7457 | "dev": true, | ||
7458 | "optional": true | ||
7459 | }, | 7523 | }, |
7460 | "ansi-regex": { | 7524 | "ansi-regex": { |
7461 | "version": "2.1.1", | 7525 | "version": "2.1.1", |
7462 | "bundled": true, | 7526 | "bundled": true |
7463 | "dev": true | ||
7464 | }, | 7527 | }, |
7465 | "aproba": { | 7528 | "aproba": { |
7466 | "version": "1.2.0", | 7529 | "version": "1.2.0", |
7467 | "bundled": true, | 7530 | "bundled": true |
7468 | "dev": true, | ||
7469 | "optional": true | ||
7470 | }, | 7531 | }, |
7471 | "are-we-there-yet": { | 7532 | "are-we-there-yet": { |
7472 | "version": "1.1.5", | 7533 | "version": "1.1.5", |
7473 | "bundled": true, | 7534 | "bundled": true, |
7474 | "dev": true, | ||
7475 | "optional": true, | ||
7476 | "requires": { | 7535 | "requires": { |
7477 | "delegates": "^1.0.0", | 7536 | "delegates": "^1.0.0" |
7478 | "readable-stream": "^2.0.6" | ||
7479 | } | 7537 | } |
7480 | }, | 7538 | }, |
7481 | "balanced-match": { | 7539 | "balanced-match": { |
7482 | "version": "1.0.0", | 7540 | "version": "1.0.0", |
7483 | "bundled": true, | 7541 | "bundled": true |
7484 | "dev": true | ||
7485 | }, | 7542 | }, |
7486 | "brace-expansion": { | 7543 | "brace-expansion": { |
7487 | "version": "1.1.11", | 7544 | "version": "1.1.11", |
7488 | "bundled": true, | 7545 | "bundled": true, |
7489 | "dev": true, | ||
7490 | "requires": { | 7546 | "requires": { |
7491 | "balanced-match": "^1.0.0", | 7547 | "balanced-match": "^1.0.0", |
7492 | "concat-map": "0.0.1" | 7548 | "concat-map": "0.0.1" |
@@ -7494,94 +7550,69 @@ | |||
7494 | }, | 7550 | }, |
7495 | "chownr": { | 7551 | "chownr": { |
7496 | "version": "1.1.1", | 7552 | "version": "1.1.1", |
7497 | "bundled": true, | 7553 | "bundled": true |
7498 | "dev": true, | ||
7499 | "optional": true | ||
7500 | }, | 7554 | }, |
7501 | "code-point-at": { | 7555 | "code-point-at": { |
7502 | "version": "1.1.0", | 7556 | "version": "1.1.0", |
7503 | "bundled": true, | 7557 | "bundled": true |
7504 | "dev": true | ||
7505 | }, | 7558 | }, |
7506 | "concat-map": { | 7559 | "concat-map": { |
7507 | "version": "0.0.1", | 7560 | "version": "0.0.1", |
7508 | "bundled": true, | 7561 | "bundled": true |
7509 | "dev": true | ||
7510 | }, | 7562 | }, |
7511 | "console-control-strings": { | 7563 | "console-control-strings": { |
7512 | "version": "1.1.0", | 7564 | "version": "1.1.0", |
7513 | "bundled": true, | 7565 | "bundled": true |
7514 | "dev": true | ||
7515 | }, | 7566 | }, |
7516 | "core-util-is": { | 7567 | "core-util-is": { |
7517 | "version": "1.0.2", | 7568 | "version": "1.0.2", |
7518 | "bundled": true, | 7569 | "bundled": true |
7519 | "dev": true, | ||
7520 | "optional": true | ||
7521 | }, | 7570 | }, |
7522 | "debug": { | 7571 | "debug": { |
7523 | "version": "2.6.9", | 7572 | "version": "2.6.9", |
7524 | "bundled": true, | 7573 | "bundled": true, |
7525 | "dev": true, | ||
7526 | "optional": true, | ||
7527 | "requires": { | 7574 | "requires": { |
7528 | "ms": "2.0.0" | 7575 | "ms": "2.0.0" |
7529 | } | 7576 | } |
7530 | }, | 7577 | }, |
7531 | "deep-extend": { | 7578 | "deep-extend": { |
7532 | "version": "0.6.0", | 7579 | "version": "0.6.0", |
7533 | "bundled": true, | 7580 | "bundled": true |
7534 | "dev": true, | ||
7535 | "optional": true | ||
7536 | }, | 7581 | }, |
7537 | "delegates": { | 7582 | "delegates": { |
7538 | "version": "1.0.0", | 7583 | "version": "1.0.0", |
7539 | "bundled": true, | 7584 | "bundled": true |
7540 | "dev": true, | ||
7541 | "optional": true | ||
7542 | }, | 7585 | }, |
7543 | "detect-libc": { | 7586 | "detect-libc": { |
7544 | "version": "1.0.3", | 7587 | "version": "1.0.3", |
7545 | "bundled": true, | 7588 | "bundled": true |
7546 | "dev": true, | ||
7547 | "optional": true | ||
7548 | }, | 7589 | }, |
7549 | "fs-minipass": { | 7590 | "fs-minipass": { |
7550 | "version": "1.2.5", | 7591 | "version": "1.2.5", |
7551 | "bundled": true, | 7592 | "bundled": true, |
7552 | "dev": true, | ||
7553 | "optional": true, | ||
7554 | "requires": { | 7593 | "requires": { |
7555 | "minipass": "^2.2.1" | 7594 | "minipass": "^2.2.1" |
7556 | } | 7595 | } |
7557 | }, | 7596 | }, |
7558 | "fs.realpath": { | 7597 | "fs.realpath": { |
7559 | "version": "1.0.0", | 7598 | "version": "1.0.0", |
7560 | "bundled": true, | 7599 | "bundled": true |
7561 | "dev": true, | ||
7562 | "optional": true | ||
7563 | }, | 7600 | }, |
7564 | "gauge": { | 7601 | "gauge": { |
7565 | "version": "2.7.4", | 7602 | "version": "2.7.4", |
7566 | "bundled": true, | 7603 | "bundled": true, |
7567 | "dev": true, | ||
7568 | "optional": true, | ||
7569 | "requires": { | 7604 | "requires": { |
7570 | "aproba": "^1.0.3", | 7605 | "aproba": "^1.0.3", |
7571 | "console-control-strings": "^1.0.0", | 7606 | "console-control-strings": "^1.0.0", |
7572 | "has-unicode": "^2.0.0", | 7607 | "has-unicode": "^2.0.0", |
7573 | "object-assign": "^4.1.0", | 7608 | "object-assign": "^4.1.0", |
7574 | "signal-exit": "^3.0.0", | 7609 | "signal-exit": "^3.0.0", |
7575 | "string-width": "^1.0.1", | ||
7576 | "strip-ansi": "^3.0.1", | ||
7577 | "wide-align": "^1.1.0" | 7610 | "wide-align": "^1.1.0" |
7578 | } | 7611 | } |
7579 | }, | 7612 | }, |
7580 | "glob": { | 7613 | "glob": { |
7581 | "version": "7.1.3", | 7614 | "version": "7.1.3", |
7582 | "bundled": true, | 7615 | "bundled": true, |
7583 | "dev": true, | ||
7584 | "optional": true, | ||
7585 | "requires": { | 7616 | "requires": { |
7586 | "fs.realpath": "^1.0.0", | 7617 | "fs.realpath": "^1.0.0", |
7587 | "inflight": "^1.0.4", | 7618 | "inflight": "^1.0.4", |
@@ -7593,15 +7624,11 @@ | |||
7593 | }, | 7624 | }, |
7594 | "has-unicode": { | 7625 | "has-unicode": { |
7595 | "version": "2.0.1", | 7626 | "version": "2.0.1", |
7596 | "bundled": true, | 7627 | "bundled": true |
7597 | "dev": true, | ||
7598 | "optional": true | ||
7599 | }, | 7628 | }, |
7600 | "iconv-lite": { | 7629 | "iconv-lite": { |
7601 | "version": "0.4.24", | 7630 | "version": "0.4.24", |
7602 | "bundled": true, | 7631 | "bundled": true, |
7603 | "dev": true, | ||
7604 | "optional": true, | ||
7605 | "requires": { | 7632 | "requires": { |
7606 | "safer-buffer": ">= 2.1.2 < 3" | 7633 | "safer-buffer": ">= 2.1.2 < 3" |
7607 | } | 7634 | } |
@@ -7609,8 +7636,6 @@ | |||
7609 | "ignore-walk": { | 7636 | "ignore-walk": { |
7610 | "version": "3.0.1", | 7637 | "version": "3.0.1", |
7611 | "bundled": true, | 7638 | "bundled": true, |
7612 | "dev": true, | ||
7613 | "optional": true, | ||
7614 | "requires": { | 7639 | "requires": { |
7615 | "minimatch": "^3.0.4" | 7640 | "minimatch": "^3.0.4" |
7616 | } | 7641 | } |
@@ -7618,8 +7643,6 @@ | |||
7618 | "inflight": { | 7643 | "inflight": { |
7619 | "version": "1.0.6", | 7644 | "version": "1.0.6", |
7620 | "bundled": true, | 7645 | "bundled": true, |
7621 | "dev": true, | ||
7622 | "optional": true, | ||
7623 | "requires": { | 7646 | "requires": { |
7624 | "once": "^1.3.0", | 7647 | "once": "^1.3.0", |
7625 | "wrappy": "1" | 7648 | "wrappy": "1" |
@@ -7627,345 +7650,18 @@ | |||
7627 | }, | 7650 | }, |
7628 | "inherits": { | 7651 | "inherits": { |
7629 | "version": "2.0.3", | 7652 | "version": "2.0.3", |
7630 | "bundled": true, | 7653 | "bundled": true |
7631 | "dev": true | ||
7632 | }, | 7654 | }, |
7633 | "ini": { | 7655 | "ini": { |
7634 | "version": "1.3.5", | 7656 | "version": "1.3.5", |
7635 | "bundled": true, | 7657 | "bundled": true |
7636 | "dev": true, | ||
7637 | "optional": true | ||
7638 | }, | 7658 | }, |
7639 | "is-fullwidth-code-point": { | 7659 | "is-fullwidth-code-point": { |
7640 | "version": "1.0.0", | 7660 | "version": "1.0.0", |
7641 | "bundled": true, | 7661 | "bundled": true, |
7642 | "dev": true, | ||
7643 | "requires": { | 7662 | "requires": { |
7644 | "number-is-nan": "^1.0.0" | 7663 | "number-is-nan": "^1.0.0" |
7645 | } | 7664 | } |
7646 | }, | ||
7647 | "isarray": { | ||
7648 | "version": "1.0.0", | ||
7649 | "bundled": true, | ||
7650 | "dev": true, | ||
7651 | "optional": true | ||
7652 | }, | ||
7653 | "minimatch": { | ||
7654 | "version": "3.0.4", | ||
7655 | "bundled": true, | ||
7656 | "dev": true, | ||
7657 | "requires": { | ||
7658 | "brace-expansion": "^1.1.7" | ||
7659 | } | ||
7660 | }, | ||
7661 | "minimist": { | ||
7662 | "version": "0.0.8", | ||
7663 | "bundled": true, | ||
7664 | "dev": true | ||
7665 | }, | ||
7666 | "minipass": { | ||
7667 | "version": "2.3.5", | ||
7668 | "bundled": true, | ||
7669 | "dev": true, | ||
7670 | "requires": { | ||
7671 | "safe-buffer": "^5.1.2", | ||
7672 | "yallist": "^3.0.0" | ||
7673 | } | ||
7674 | }, | ||
7675 | "minizlib": { | ||
7676 | "version": "1.2.1", | ||
7677 | "bundled": true, | ||
7678 | "dev": true, | ||
7679 | "optional": true, | ||
7680 | "requires": { | ||
7681 | "minipass": "^2.2.1" | ||
7682 | } | ||
7683 | }, | ||
7684 | "mkdirp": { | ||
7685 | "version": "0.5.1", | ||
7686 | "bundled": true, | ||
7687 | "dev": true, | ||
7688 | "requires": { | ||
7689 | "minimist": "0.0.8" | ||
7690 | } | ||
7691 | }, | ||
7692 | "ms": { | ||
7693 | "version": "2.0.0", | ||
7694 | "bundled": true, | ||
7695 | "dev": true, | ||
7696 | "optional": true | ||
7697 | }, | ||
7698 | "needle": { | ||
7699 | "version": "2.2.4", | ||
7700 | "bundled": true, | ||
7701 | "dev": true, | ||
7702 | "optional": true, | ||
7703 | "requires": { | ||
7704 | "debug": "^2.1.2", | ||
7705 | "iconv-lite": "^0.4.4", | ||
7706 | "sax": "^1.2.4" | ||
7707 | } | ||
7708 | }, | ||
7709 | "node-pre-gyp": { | ||
7710 | "version": "0.10.3", | ||
7711 | "bundled": true, | ||
7712 | "dev": true, | ||
7713 | "optional": true, | ||
7714 | "requires": { | ||
7715 | "detect-libc": "^1.0.2", | ||
7716 | "mkdirp": "^0.5.1", | ||
7717 | "needle": "^2.2.1", | ||
7718 | "nopt": "^4.0.1", | ||
7719 | "npm-packlist": "^1.1.6", | ||
7720 | "npmlog": "^4.0.2", | ||
7721 | "rc": "^1.2.7", | ||
7722 | "rimraf": "^2.6.1", | ||
7723 | "semver": "^5.3.0", | ||
7724 | "tar": "^4" | ||
7725 | } | ||
7726 | }, | ||
7727 | "nopt": { | ||
7728 | "version": "4.0.1", | ||
7729 | "bundled": true, | ||
7730 | "dev": true, | ||
7731 | "optional": true, | ||
7732 | "requires": { | ||
7733 | "abbrev": "1", | ||
7734 | "osenv": "^0.1.4" | ||
7735 | } | ||
7736 | }, | ||
7737 | "npm-bundled": { | ||
7738 | "version": "1.0.5", | ||
7739 | "bundled": true, | ||
7740 | "dev": true, | ||
7741 | "optional": true | ||
7742 | }, | ||
7743 | "npm-packlist": { | ||
7744 | "version": "1.2.0", | ||
7745 | "bundled": true, | ||
7746 | "dev": true, | ||
7747 | "optional": true, | ||
7748 | "requires": { | ||
7749 | "ignore-walk": "^3.0.1", | ||
7750 | "npm-bundled": "^1.0.1" | ||
7751 | } | ||
7752 | }, | ||
7753 | "npmlog": { | ||
7754 | "version": "4.1.2", | ||
7755 | "bundled": true, | ||
7756 | "dev": true, | ||
7757 | "optional": true, | ||
7758 | "requires": { | ||
7759 | "are-we-there-yet": "~1.1.2", | ||
7760 | "console-control-strings": "~1.1.0", | ||
7761 | "gauge": "~2.7.3", | ||
7762 | "set-blocking": "~2.0.0" | ||
7763 | } | ||
7764 | }, | ||
7765 | "number-is-nan": { | ||
7766 | "version": "1.0.1", | ||
7767 | "bundled": true, | ||
7768 | "dev": true | ||
7769 | }, | ||
7770 | "object-assign": { | ||
7771 | "version": "4.1.1", | ||
7772 | "bundled": true, | ||
7773 | "dev": true, | ||
7774 | "optional": true | ||
7775 | }, | ||
7776 | "once": { | ||
7777 | "version": "1.4.0", | ||
7778 | "bundled": true, | ||
7779 | "dev": true, | ||
7780 | "requires": { | ||
7781 | "wrappy": "1" | ||
7782 | } | ||
7783 | }, | ||
7784 | "os-homedir": { | ||
7785 | "version": "1.0.2", | ||
7786 | "bundled": true, | ||
7787 | "dev": true, | ||
7788 | "optional": true | ||
7789 | }, | ||
7790 | "os-tmpdir": { | ||
7791 | "version": "1.0.2", | ||
7792 | "bundled": true, | ||
7793 | "dev": true, | ||
7794 | "optional": true | ||
7795 | }, | ||
7796 | "osenv": { | ||
7797 | "version": "0.1.5", | ||
7798 | "bundled": true, | ||
7799 | "dev": true, | ||
7800 | "optional": true, | ||
7801 | "requires": { | ||
7802 | "os-homedir": "^1.0.0", | ||
7803 | "os-tmpdir": "^1.0.0" | ||
7804 | } | ||
7805 | }, | ||
7806 | "path-is-absolute": { | ||
7807 | "version": "1.0.1", | ||
7808 | "bundled": true, | ||
7809 | "dev": true, | ||
7810 | "optional": true | ||
7811 | }, | ||
7812 | "process-nextick-args": { | ||
7813 | "version": "2.0.0", | ||
7814 | "bundled": true, | ||
7815 | "dev": true, | ||
7816 | "optional": true | ||
7817 | }, | ||
7818 | "rc": { | ||
7819 | "version": "1.2.8", | ||
7820 | "bundled": true, | ||
7821 | "dev": true, | ||
7822 | "optional": true, | ||
7823 | "requires": { | ||
7824 | "deep-extend": "^0.6.0", | ||
7825 | "ini": "~1.3.0", | ||
7826 | "minimist": "^1.2.0", | ||
7827 | "strip-json-comments": "~2.0.1" | ||
7828 | }, | ||
7829 | "dependencies": { | ||
7830 | "minimist": { | ||
7831 | "version": "1.2.0", | ||
7832 | "bundled": true, | ||
7833 | "dev": true, | ||
7834 | "optional": true | ||
7835 | } | ||
7836 | } | ||
7837 | }, | ||
7838 | "readable-stream": { | ||
7839 | "version": "2.3.6", | ||
7840 | "bundled": true, | ||
7841 | "dev": true, | ||
7842 | "optional": true, | ||
7843 | "requires": { | ||
7844 | "core-util-is": "~1.0.0", | ||
7845 | "inherits": "~2.0.3", | ||
7846 | "isarray": "~1.0.0", | ||
7847 | "process-nextick-args": "~2.0.0", | ||
7848 | "safe-buffer": "~5.1.1", | ||
7849 | "string_decoder": "~1.1.1", | ||
7850 | "util-deprecate": "~1.0.1" | ||
7851 | } | ||
7852 | }, | ||
7853 | "rimraf": { | ||
7854 | "version": "2.6.3", | ||
7855 | "bundled": true, | ||
7856 | "dev": true, | ||
7857 | "optional": true, | ||
7858 | "requires": { | ||
7859 | "glob": "^7.1.3" | ||
7860 | } | ||
7861 | }, | ||
7862 | "safe-buffer": { | ||
7863 | "version": "5.1.2", | ||
7864 | "bundled": true, | ||
7865 | "dev": true | ||
7866 | }, | ||
7867 | "safer-buffer": { | ||
7868 | "version": "2.1.2", | ||
7869 | "bundled": true, | ||
7870 | "dev": true, | ||
7871 | "optional": true | ||
7872 | }, | ||
7873 | "sax": { | ||
7874 | "version": "1.2.4", | ||
7875 | "bundled": true, | ||
7876 | "dev": true, | ||
7877 | "optional": true | ||
7878 | }, | ||
7879 | "semver": { | ||
7880 | "version": "5.6.0", | ||
7881 | "bundled": true, | ||
7882 | "dev": true, | ||
7883 | "optional": true | ||
7884 | }, | ||
7885 | "set-blocking": { | ||
7886 | "version": "2.0.0", | ||
7887 | "bundled": true, | ||
7888 | "dev": true, | ||
7889 | "optional": true | ||
7890 | }, | ||
7891 | "signal-exit": { | ||
7892 | "version": "3.0.2", | ||
7893 | "bundled": true, | ||
7894 | "dev": true, | ||
7895 | "optional": true | ||
7896 | }, | ||
7897 | "string-width": { | ||
7898 | "version": "1.0.2", | ||
7899 | "bundled": true, | ||
7900 | "dev": true, | ||
7901 | "requires": { | ||
7902 | "code-point-at": "^1.0.0", | ||
7903 | "is-fullwidth-code-point": "^1.0.0", | ||
7904 | "strip-ansi": "^3.0.0" | ||
7905 | } | ||
7906 | }, | ||
7907 | "string_decoder": { | ||
7908 | "version": "1.1.1", | ||
7909 | "bundled": true, | ||
7910 | "dev": true, | ||
7911 | "optional": true, | ||
7912 | "requires": { | ||
7913 | "safe-buffer": "~5.1.0" | ||
7914 | } | ||
7915 | }, | ||
7916 | "strip-ansi": { | ||
7917 | "version": "3.0.1", | ||
7918 | "bundled": true, | ||
7919 | "dev": true, | ||
7920 | "requires": { | ||
7921 | "ansi-regex": "^2.0.0" | ||
7922 | } | ||
7923 | }, | ||
7924 | "strip-json-comments": { | ||
7925 | "version": "2.0.1", | ||
7926 | "bundled": true, | ||
7927 | "dev": true, | ||
7928 | "optional": true | ||
7929 | }, | ||
7930 | "tar": { | ||
7931 | "version": "4.4.8", | ||
7932 | "bundled": true, | ||
7933 | "dev": true, | ||
7934 | "optional": true, | ||
7935 | "requires": { | ||
7936 | "chownr": "^1.1.1", | ||
7937 | "fs-minipass": "^1.2.5", | ||
7938 | "minipass": "^2.3.4", | ||
7939 | "minizlib": "^1.1.1", | ||
7940 | "mkdirp": "^0.5.0", | ||
7941 | "safe-buffer": "^5.1.2", | ||
7942 | "yallist": "^3.0.2" | ||
7943 | } | ||
7944 | }, | ||
7945 | "util-deprecate": { | ||
7946 | "version": "1.0.2", | ||
7947 | "bundled": true, | ||
7948 | "dev": true, | ||
7949 | "optional": true | ||
7950 | }, | ||
7951 | "wide-align": { | ||
7952 | "version": "1.1.3", | ||
7953 | "bundled": true, | ||
7954 | "dev": true, | ||
7955 | "optional": true, | ||
7956 | "requires": { | ||
7957 | "string-width": "^1.0.2 || 2" | ||
7958 | } | ||
7959 | }, | ||
7960 | "wrappy": { | ||
7961 | "version": "1.0.2", | ||
7962 | "bundled": true, | ||
7963 | "dev": true | ||
7964 | }, | ||
7965 | "yallist": { | ||
7966 | "version": "3.0.3", | ||
7967 | "bundled": true, | ||
7968 | "dev": true | ||
7969 | } | 7665 | } |
7970 | } | 7666 | } |
7971 | }, | 7667 | }, |
@@ -10591,8 +10287,7 @@ | |||
10591 | "is-fullwidth-code-point": { | 10287 | "is-fullwidth-code-point": { |
10592 | "version": "2.0.0", | 10288 | "version": "2.0.0", |
10593 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", | 10289 | "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", |
10594 | "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", | 10290 | "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" |
10595 | "dev": true | ||
10596 | }, | 10291 | }, |
10597 | "is-function": { | 10292 | "is-function": { |
10598 | "version": "1.0.1", | 10293 | "version": "1.0.1", |
@@ -12027,7 +11722,6 @@ | |||
12027 | "version": "3.0.4", | 11722 | "version": "3.0.4", |
12028 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", | 11723 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", |
12029 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", | 11724 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", |
12030 | "dev": true, | ||
12031 | "requires": { | 11725 | "requires": { |
12032 | "brace-expansion": "^1.1.7" | 11726 | "brace-expansion": "^1.1.7" |
12033 | } | 11727 | } |
@@ -12349,6 +12043,18 @@ | |||
12349 | "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", | 12043 | "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", |
12350 | "dev": true | 12044 | "dev": true |
12351 | }, | 12045 | }, |
12046 | "needle": { | ||
12047 | "version": "2.2.4", | ||
12048 | "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.4.tgz", | ||
12049 | "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", | ||
12050 | "dev": true, | ||
12051 | "optional": true, | ||
12052 | "requires": { | ||
12053 | "debug": "^2.1.2", | ||
12054 | "iconv-lite": "^0.4.4", | ||
12055 | "sax": "^1.2.4" | ||
12056 | } | ||
12057 | }, | ||
12352 | "negotiator": { | 12058 | "negotiator": { |
12353 | "version": "0.4.7", | 12059 | "version": "0.4.7", |
12354 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.4.7.tgz", | 12060 | "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.4.7.tgz", |
@@ -12527,6 +12233,38 @@ | |||
12527 | "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", | 12233 | "integrity": "sha1-jZ2+KJZKSsVxLpExZCEHxx6Q7EA=", |
12528 | "dev": true | 12234 | "dev": true |
12529 | }, | 12235 | }, |
12236 | "node-pre-gyp": { | ||
12237 | "version": "0.10.3", | ||
12238 | "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz", | ||
12239 | "integrity": "sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A==", | ||
12240 | "dev": true, | ||
12241 | "optional": true, | ||
12242 | "requires": { | ||
12243 | "detect-libc": "^1.0.2", | ||
12244 | "mkdirp": "^0.5.1", | ||
12245 | "needle": "^2.2.1", | ||
12246 | "nopt": "^4.0.1", | ||
12247 | "npm-packlist": "^1.1.6", | ||
12248 | "npmlog": "^4.0.2", | ||
12249 | "rc": "^1.2.7", | ||
12250 | "rimraf": "^2.6.1", | ||
12251 | "semver": "^5.3.0", | ||
12252 | "tar": "^4" | ||
12253 | }, | ||
12254 | "dependencies": { | ||
12255 | "nopt": { | ||
12256 | "version": "4.0.1", | ||
12257 | "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", | ||
12258 | "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", | ||
12259 | "dev": true, | ||
12260 | "optional": true, | ||
12261 | "requires": { | ||
12262 | "abbrev": "1", | ||
12263 | "osenv": "^0.1.4" | ||
12264 | } | ||
12265 | } | ||
12266 | } | ||
12267 | }, | ||
12530 | "node-releases": { | 12268 | "node-releases": { |
12531 | "version": "1.1.7", | 12269 | "version": "1.1.7", |
12532 | "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.7.tgz", | 12270 | "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.7.tgz", |
@@ -13140,8 +12878,7 @@ | |||
13140 | "number-is-nan": { | 12878 | "number-is-nan": { |
13141 | "version": "1.0.1", | 12879 | "version": "1.0.1", |
13142 | "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", | 12880 | "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", |
13143 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", | 12881 | "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" |
13144 | "dev": true | ||
13145 | }, | 12882 | }, |
13146 | "oauth-sign": { | 12883 | "oauth-sign": { |
13147 | "version": "0.9.0", | 12884 | "version": "0.9.0", |
@@ -13339,7 +13076,6 @@ | |||
13339 | "version": "1.4.0", | 13076 | "version": "1.4.0", |
13340 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", | 13077 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", |
13341 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", | 13078 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", |
13342 | "dev": true, | ||
13343 | "requires": { | 13079 | "requires": { |
13344 | "wrappy": "1" | 13080 | "wrappy": "1" |
13345 | } | 13081 | } |
@@ -15970,8 +15706,7 @@ | |||
15970 | "signal-exit": { | 15706 | "signal-exit": { |
15971 | "version": "3.0.2", | 15707 | "version": "3.0.2", |
15972 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", | 15708 | "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", |
15973 | "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", | 15709 | "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" |
15974 | "dev": true | ||
15975 | }, | 15710 | }, |
15976 | "simple-swizzle": { | 15711 | "simple-swizzle": { |
15977 | "version": "0.2.2", | 15712 | "version": "0.2.2", |
@@ -16806,7 +16541,6 @@ | |||
16806 | "version": "2.1.1", | 16541 | "version": "2.1.1", |
16807 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", | 16542 | "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", |
16808 | "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", | 16543 | "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", |
16809 | "dev": true, | ||
16810 | "requires": { | 16544 | "requires": { |
16811 | "is-fullwidth-code-point": "^2.0.0", | 16545 | "is-fullwidth-code-point": "^2.0.0", |
16812 | "strip-ansi": "^4.0.0" | 16546 | "strip-ansi": "^4.0.0" |
@@ -16824,7 +16558,6 @@ | |||
16824 | "version": "4.0.0", | 16558 | "version": "4.0.0", |
16825 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", | 16559 | "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", |
16826 | "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", | 16560 | "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", |
16827 | "dev": true, | ||
16828 | "requires": { | 16561 | "requires": { |
16829 | "ansi-regex": "^3.0.0" | 16562 | "ansi-regex": "^3.0.0" |
16830 | } | 16563 | } |
@@ -18670,7 +18403,6 @@ | |||
18670 | "version": "1.1.3", | 18403 | "version": "1.1.3", |
18671 | "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", | 18404 | "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", |
18672 | "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", | 18405 | "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", |
18673 | "dev": true, | ||
18674 | "requires": { | 18406 | "requires": { |
18675 | "string-width": "^1.0.2 || 2" | 18407 | "string-width": "^1.0.2 || 2" |
18676 | } | 18408 | } |
@@ -18816,8 +18548,7 @@ | |||
18816 | "wrappy": { | 18548 | "wrappy": { |
18817 | "version": "1.0.2", | 18549 | "version": "1.0.2", |
18818 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", | 18550 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", |
18819 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", | 18551 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" |
18820 | "dev": true | ||
18821 | }, | 18552 | }, |
18822 | "wreck": { | 18553 | "wreck": { |
18823 | "version": "6.3.0", | 18554 | "version": "6.3.0", |
diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js index 468d85c45..21616b5de 100644 --- a/src/components/settings/services/EditServiceForm.js +++ b/src/components/settings/services/EditServiceForm.js | |||
@@ -128,7 +128,8 @@ export default @observer class EditServiceForm extends Component { | |||
128 | isSaving: PropTypes.bool.isRequired, | 128 | isSaving: PropTypes.bool.isRequired, |
129 | isDeleting: PropTypes.bool.isRequired, | 129 | isDeleting: PropTypes.bool.isRequired, |
130 | isProxyFeatureEnabled: PropTypes.bool.isRequired, | 130 | isProxyFeatureEnabled: PropTypes.bool.isRequired, |
131 | isProxyFeaturePremiumFeature: PropTypes.bool.isRequired, | 131 | isProxyPremiumFeature: PropTypes.bool.isRequired, |
132 | isSpellcheckerPremiumFeature: PropTypes.bool.isRequired, | ||
132 | }; | 133 | }; |
133 | 134 | ||
134 | static defaultProps = { | 135 | static defaultProps = { |
@@ -191,7 +192,8 @@ export default @observer class EditServiceForm extends Component { | |||
191 | isDeleting, | 192 | isDeleting, |
192 | onDelete, | 193 | onDelete, |
193 | isProxyFeatureEnabled, | 194 | isProxyFeatureEnabled, |
194 | isProxyFeaturePremiumFeature, | 195 | isProxyPremiumFeature, |
196 | isSpellcheckerPremiumFeature, | ||
195 | } = this.props; | 197 | } = this.props; |
196 | const { intl } = this.context; | 198 | const { intl } = this.context; |
197 | 199 | ||
@@ -339,14 +341,14 @@ export default @observer class EditServiceForm extends Component { | |||
339 | </div> | 341 | </div> |
340 | </div> | 342 | </div> |
341 | 343 | ||
342 | <PremiumFeatureContainer> | 344 | <PremiumFeatureContainer condition={isSpellcheckerPremiumFeature}> |
343 | <div className="settings__settings-group"> | 345 | <div className="settings__settings-group"> |
344 | <Select field={form.$('spellcheckerLanguage')} /> | 346 | <Select field={form.$('spellcheckerLanguage')} /> |
345 | </div> | 347 | </div> |
346 | </PremiumFeatureContainer> | 348 | </PremiumFeatureContainer> |
347 | 349 | ||
348 | {isProxyFeatureEnabled && ( | 350 | {isProxyFeatureEnabled && ( |
349 | <PremiumFeatureContainer condition={isProxyFeaturePremiumFeature}> | 351 | <PremiumFeatureContainer condition={isProxyPremiumFeature}> |
350 | <div className="settings__settings-group"> | 352 | <div className="settings__settings-group"> |
351 | <h3> | 353 | <h3> |
352 | {intl.formatMessage(messages.headlineProxy)} | 354 | {intl.formatMessage(messages.headlineProxy)} |
diff --git a/src/containers/settings/EditServiceScreen.js b/src/containers/settings/EditServiceScreen.js index b46908344..d08f0a52e 100644 --- a/src/containers/settings/EditServiceScreen.js +++ b/src/containers/settings/EditServiceScreen.js | |||
@@ -19,9 +19,12 @@ import { required, url, oneRequired } from '../../helpers/validation-helpers'; | |||
19 | import { getSelectOptions } from '../../helpers/i18n-helpers'; | 19 | import { getSelectOptions } from '../../helpers/i18n-helpers'; |
20 | 20 | ||
21 | import { config as proxyFeature } from '../../features/serviceProxy'; | 21 | import { config as proxyFeature } from '../../features/serviceProxy'; |
22 | import { config as spellcheckerFeature } from '../../features/spellchecker'; | ||
22 | 23 | ||
23 | import { SPELLCHECKER_LOCALES } from '../../i18n/languages'; | 24 | import { SPELLCHECKER_LOCALES } from '../../i18n/languages'; |
24 | 25 | ||
26 | import globalMessages from '../../i18n/globalMessages'; | ||
27 | |||
25 | const messages = defineMessages({ | 28 | const messages = defineMessages({ |
26 | name: { | 29 | name: { |
27 | id: 'settings.service.form.name', | 30 | id: 'settings.service.form.name', |
@@ -83,14 +86,6 @@ const messages = defineMessages({ | |||
83 | id: 'settings.service.form.proxy.password', | 86 | id: 'settings.service.form.proxy.password', |
84 | defaultMessage: '!!!Password', | 87 | defaultMessage: '!!!Password', |
85 | }, | 88 | }, |
86 | spellcheckerLanguage: { | ||
87 | id: 'settings.service.form.spellcheckerLanguage', | ||
88 | defaultMessage: '!!!Spell checking Language', | ||
89 | }, | ||
90 | spellcheckerSystemDefault: { | ||
91 | id: 'settings.service.form.spellcheckerLanguage.default', | ||
92 | defaultMessage: '!!!Use System Default ({default})', | ||
93 | }, | ||
94 | }); | 89 | }); |
95 | 90 | ||
96 | export default @inject('stores', 'actions') @observer class EditServiceScreen extends Component { | 91 | export default @inject('stores', 'actions') @observer class EditServiceScreen extends Component { |
@@ -118,12 +113,26 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex | |||
118 | } | 113 | } |
119 | 114 | ||
120 | prepareForm(recipe, service, proxy) { | 115 | prepareForm(recipe, service, proxy) { |
116 | const { | ||
117 | intl, | ||
118 | } = this.context; | ||
119 | |||
120 | const { | ||
121 | stores, | ||
122 | } = this.props; | ||
123 | |||
124 | let defaultSpellcheckerLanguage = SPELLCHECKER_LOCALES[stores.settings.app.spellcheckerLanguage]; | ||
125 | |||
126 | if (stores.settings.app.spellcheckerLanguage === 'automatic') { | ||
127 | defaultSpellcheckerLanguage = intl.formatMessage(globalMessages.spellcheckerAutomaticDetectionShort); | ||
128 | } | ||
129 | |||
121 | const spellcheckerLanguage = getSelectOptions({ | 130 | const spellcheckerLanguage = getSelectOptions({ |
122 | locales: SPELLCHECKER_LOCALES, | 131 | locales: SPELLCHECKER_LOCALES, |
123 | resetToDefaultText: this.context.intl.formatMessage(messages.spellcheckerSystemDefault, { default: SPELLCHECKER_LOCALES[this.props.stores.settings.app.spellcheckerLanguage] }), | 132 | resetToDefaultText: intl.formatMessage(globalMessages.spellcheckerSystemDefault, { default: defaultSpellcheckerLanguage }), |
133 | automaticDetectionText: stores.settings.app.spellcheckerLanguage !== 'automatic' ? intl.formatMessage(globalMessages.spellcheckerAutomaticDetection) : '', | ||
124 | }); | 134 | }); |
125 | 135 | ||
126 | const { intl } = this.context; | ||
127 | const config = { | 136 | const config = { |
128 | fields: { | 137 | fields: { |
129 | name: { | 138 | name: { |
@@ -160,13 +169,13 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex | |||
160 | isDarkModeEnabled: { | 169 | isDarkModeEnabled: { |
161 | label: intl.formatMessage(messages.enableDarkMode), | 170 | label: intl.formatMessage(messages.enableDarkMode), |
162 | value: service.isDarkModeEnabled, | 171 | value: service.isDarkModeEnabled, |
163 | default: this.props.stores.settings.app.darkMode, | 172 | default: stores.settings.app.darkMode, |
164 | }, | 173 | }, |
165 | spellcheckerLanguage: { | 174 | spellcheckerLanguage: { |
166 | label: intl.formatMessage(messages.spellcheckerLanguage), | 175 | label: intl.formatMessage(globalMessages.spellcheckerLanguage), |
167 | value: service.spellcheckerLanguage, | 176 | value: service.spellcheckerLanguage, |
168 | options: spellcheckerLanguage, | 177 | options: spellcheckerLanguage, |
169 | disabled: !this.props.stores.settings.app.enableSpellchecking, | 178 | disabled: !stores.settings.app.enableSpellchecking, |
170 | }, | 179 | }, |
171 | }, | 180 | }, |
172 | }; | 181 | }; |
@@ -220,7 +229,7 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex | |||
220 | } | 229 | } |
221 | 230 | ||
222 | if (proxy.isEnabled) { | 231 | if (proxy.isEnabled) { |
223 | const serviceProxyConfig = this.props.stores.settings.proxy[service.id] || {}; | 232 | const serviceProxyConfig = stores.settings.proxy[service.id] || {}; |
224 | 233 | ||
225 | Object.assign(config.fields, { | 234 | Object.assign(config.fields, { |
226 | proxy: { | 235 | proxy: { |
@@ -326,7 +335,8 @@ export default @inject('stores', 'actions') @observer class EditServiceScreen ex | |||
326 | onSubmit={d => this.onSubmit(d)} | 335 | onSubmit={d => this.onSubmit(d)} |
327 | onDelete={() => this.deleteService()} | 336 | onDelete={() => this.deleteService()} |
328 | isProxyFeatureEnabled={proxyFeature.isEnabled} | 337 | isProxyFeatureEnabled={proxyFeature.isEnabled} |
329 | isProxyFeaturePremiumFeature={proxyFeature.isPremium} | 338 | isProxyPremiumFeature={proxyFeature.isPremium} |
339 | isSpellcheckerPremiumFeature={spellcheckerFeature.isPremium} | ||
330 | /> | 340 | /> |
331 | </ErrorBoundary> | 341 | </ErrorBoundary> |
332 | ); | 342 | ); |
diff --git a/src/containers/settings/EditSettingsScreen.js b/src/containers/settings/EditSettingsScreen.js index f1706a721..992c49b09 100644 --- a/src/containers/settings/EditSettingsScreen.js +++ b/src/containers/settings/EditSettingsScreen.js | |||
@@ -14,10 +14,11 @@ import { config as spellcheckerConfig } from '../../features/spellchecker'; | |||
14 | 14 | ||
15 | import { getSelectOptions } from '../../helpers/i18n-helpers'; | 15 | import { getSelectOptions } from '../../helpers/i18n-helpers'; |
16 | 16 | ||
17 | |||
18 | import EditSettingsForm from '../../components/settings/settings/EditSettingsForm'; | 17 | import EditSettingsForm from '../../components/settings/settings/EditSettingsForm'; |
19 | import ErrorBoundary from '../../components/util/ErrorBoundary'; | 18 | import ErrorBoundary from '../../components/util/ErrorBoundary'; |
20 | 19 | ||
20 | import globalMessages from '../../i18n/globalMessages'; | ||
21 | |||
21 | const messages = defineMessages({ | 22 | const messages = defineMessages({ |
22 | autoLaunchOnStart: { | 23 | autoLaunchOnStart: { |
23 | id: 'settings.app.form.autoLaunchOnStart', | 24 | id: 'settings.app.form.autoLaunchOnStart', |
@@ -63,10 +64,6 @@ const messages = defineMessages({ | |||
63 | id: 'settings.app.form.enableGPUAcceleration', | 64 | id: 'settings.app.form.enableGPUAcceleration', |
64 | defaultMessage: '!!!Enable GPU Acceleration', | 65 | defaultMessage: '!!!Enable GPU Acceleration', |
65 | }, | 66 | }, |
66 | spellcheckerLanguage: { | ||
67 | id: 'settings.app.form.spellcheckerLanguage', | ||
68 | defaultMessage: '!!!Language for spell checking', | ||
69 | }, | ||
70 | beta: { | 67 | beta: { |
71 | id: 'settings.app.form.beta', | 68 | id: 'settings.app.form.beta', |
72 | defaultMessage: '!!!Include beta versions', | 69 | defaultMessage: '!!!Include beta versions', |
@@ -125,6 +122,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
125 | 122 | ||
126 | const spellcheckingLanguages = getSelectOptions({ | 123 | const spellcheckingLanguages = getSelectOptions({ |
127 | locales: SPELLCHECKER_LOCALES, | 124 | locales: SPELLCHECKER_LOCALES, |
125 | automaticDetectionText: this.context.intl.formatMessage(globalMessages.spellcheckerAutomaticDetection), | ||
128 | }); | 126 | }); |
129 | 127 | ||
130 | const config = { | 128 | const config = { |
@@ -166,11 +164,11 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
166 | }, | 164 | }, |
167 | enableSpellchecking: { | 165 | enableSpellchecking: { |
168 | label: intl.formatMessage(messages.enableSpellchecking), | 166 | label: intl.formatMessage(messages.enableSpellchecking), |
169 | value: !this.props.stores.user.data.isPremium && spellcheckerConfig.isPremiumFeature ? false : settings.all.app.enableSpellchecking, | 167 | value: !this.props.stores.user.data.isPremium && spellcheckerConfig.isPremium ? false : settings.all.app.enableSpellchecking, |
170 | default: !this.props.stores.user.data.isPremium && spellcheckerConfig.isPremiumFeature ? false : DEFAULT_APP_SETTINGS.enableSpellchecking, | 168 | default: !this.props.stores.user.data.isPremium && spellcheckerConfig.isPremium ? false : DEFAULT_APP_SETTINGS.enableSpellchecking, |
171 | }, | 169 | }, |
172 | spellcheckerLanguage: { | 170 | spellcheckerLanguage: { |
173 | label: intl.formatMessage(messages.spellcheckerLanguage), | 171 | label: intl.formatMessage(globalMessages.spellcheckerLanguage), |
174 | value: settings.all.app.spellcheckerLanguage, | 172 | value: settings.all.app.spellcheckerLanguage, |
175 | options: spellcheckingLanguages, | 173 | options: spellcheckingLanguages, |
176 | default: DEFAULT_APP_SETTINGS.spellcheckerLanguage, | 174 | default: DEFAULT_APP_SETTINGS.spellcheckerLanguage, |
@@ -230,7 +228,7 @@ export default @inject('stores', 'actions') @observer class EditSettingsScreen e | |||
230 | cacheSize={cacheSize} | 228 | cacheSize={cacheSize} |
231 | isClearingAllCache={isClearingAllCache} | 229 | isClearingAllCache={isClearingAllCache} |
232 | onClearAllCache={clearAllCache} | 230 | onClearAllCache={clearAllCache} |
233 | isSpellcheckerPremiumFeature={spellcheckerConfig.isPremiumFeature} | 231 | isSpellcheckerPremiumFeature={spellcheckerConfig.isPremium} |
234 | /> | 232 | /> |
235 | </ErrorBoundary> | 233 | </ErrorBoundary> |
236 | ); | 234 | ); |
diff --git a/src/features/spellchecker/index.js b/src/features/spellchecker/index.js index 63506103c..94883ad17 100644 --- a/src/features/spellchecker/index.js +++ b/src/features/spellchecker/index.js | |||
@@ -5,7 +5,7 @@ import { DEFAULT_FEATURES_CONFIG } from '../../config'; | |||
5 | const debug = require('debug')('Franz:feature:spellchecker'); | 5 | const debug = require('debug')('Franz:feature:spellchecker'); |
6 | 6 | ||
7 | export const config = observable({ | 7 | export const config = observable({ |
8 | isPremiumFeature: DEFAULT_FEATURES_CONFIG.isSpellcheckerPremiumFeature, | 8 | isPremium: DEFAULT_FEATURES_CONFIG.isSpellcheckerPremiumFeature, |
9 | }); | 9 | }); |
10 | 10 | ||
11 | export default function init(stores) { | 11 | export default function init(stores) { |
@@ -14,9 +14,11 @@ export default function init(stores) { | |||
14 | autorun(() => { | 14 | autorun(() => { |
15 | const { isSpellcheckerPremiumFeature } = stores.features.features; | 15 | const { isSpellcheckerPremiumFeature } = stores.features.features; |
16 | 16 | ||
17 | config.isPremiumFeature = isSpellcheckerPremiumFeature !== undefined ? isSpellcheckerPremiumFeature : DEFAULT_FEATURES_CONFIG.isSpellcheckerPremiumFeature; | 17 | console.log('isSpellcheckerPremiumFeature', isSpellcheckerPremiumFeature); |
18 | 18 | ||
19 | if (!stores.user.data.isPremium && config.isPremiumFeature && stores.settings.app.enableSpellchecking) { | 19 | config.isPremium = isSpellcheckerPremiumFeature !== undefined ? isSpellcheckerPremiumFeature : DEFAULT_FEATURES_CONFIG.isSpellcheckerPremiumFeature; |
20 | |||
21 | if (!stores.user.data.isPremium && config.isPremium && stores.settings.app.enableSpellchecking) { | ||
20 | debug('Override settings.spellcheckerEnabled flag to false'); | 22 | debug('Override settings.spellcheckerEnabled flag to false'); |
21 | 23 | ||
22 | Object.assign(stores.settings.app, { | 24 | Object.assign(stores.settings.app, { |
diff --git a/src/helpers/i18n-helpers.js b/src/helpers/i18n-helpers.js index 091b86b06..84146dd8c 100644 --- a/src/helpers/i18n-helpers.js +++ b/src/helpers/i18n-helpers.js | |||
@@ -28,22 +28,33 @@ export function getLocale({ | |||
28 | return localeStr; | 28 | return localeStr; |
29 | } | 29 | } |
30 | 30 | ||
31 | export function getSelectOptions({ locales, resetToDefaultText = '' }) { | 31 | export function getSelectOptions({ locales, resetToDefaultText = '', automaticDetectionText = '' }) { |
32 | let options = []; | 32 | const options = []; |
33 | 33 | ||
34 | if (resetToDefaultText) { | 34 | if (resetToDefaultText) { |
35 | options = [ | 35 | options.push( |
36 | { | 36 | { |
37 | value: '', | 37 | value: '', |
38 | label: resetToDefaultText, | 38 | label: resetToDefaultText, |
39 | }, { | ||
40 | value: '───', | ||
41 | label: '───', | ||
42 | disabled: true, | ||
43 | }, | 39 | }, |
44 | ]; | 40 | ); |
45 | } | 41 | } |
46 | 42 | ||
43 | if (automaticDetectionText) { | ||
44 | options.push( | ||
45 | { | ||
46 | value: 'automatic', | ||
47 | label: automaticDetectionText, | ||
48 | }, | ||
49 | ); | ||
50 | } | ||
51 | |||
52 | options.push({ | ||
53 | value: '───', | ||
54 | label: '───', | ||
55 | disabled: true, | ||
56 | }); | ||
57 | |||
47 | Object.keys(locales).sort(Intl.Collator().compare).forEach((key) => { | 58 | Object.keys(locales).sort(Intl.Collator().compare).forEach((key) => { |
48 | options.push({ | 59 | options.push({ |
49 | value: key, | 60 | value: key, |
diff --git a/src/i18n/globalMessages.js b/src/i18n/globalMessages.js index 2c724ff6f..7b1618602 100644 --- a/src/i18n/globalMessages.js +++ b/src/i18n/globalMessages.js | |||
@@ -13,4 +13,20 @@ export default defineMessages({ | |||
13 | id: 'global.notConnectedToTheInternet', | 13 | id: 'global.notConnectedToTheInternet', |
14 | defaultMessage: '!!!You are not connected to the internet.', | 14 | defaultMessage: '!!!You are not connected to the internet.', |
15 | }, | 15 | }, |
16 | spellcheckerLanguage: { | ||
17 | id: 'global.spellchecking.language', | ||
18 | defaultMessage: '!!!Spell checking language', | ||
19 | }, | ||
20 | spellcheckerSystemDefault: { | ||
21 | id: 'global.spellchecker.useDefault', | ||
22 | defaultMessage: '!!!Use System Default ({default})', | ||
23 | }, | ||
24 | spellcheckerAutomaticDetection: { | ||
25 | id: 'global.spellchecking.autodetect', | ||
26 | defaultMessage: '!!!Detect language automatically', | ||
27 | }, | ||
28 | spellcheckerAutomaticDetectionShort: { | ||
29 | id: 'global.spellchecking.autodetect.short', | ||
30 | defaultMessage: '!!!Automatic', | ||
31 | }, | ||
16 | }); | 32 | }); |
diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 99df6a0ca..4e0c5575d 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json | |||
@@ -1,6 +1,10 @@ | |||
1 | { | 1 | { |
2 | "global.api.unhealthy": "Can't connect to Franz online services", | 2 | "global.api.unhealthy": "Can't connect to Franz online services", |
3 | "global.notConnectedToTheInternet": "You are not connected to the internet.", | 3 | "global.notConnectedToTheInternet": "You are not connected to the internet.", |
4 | "global.spellchecking.language": "Spell checking language", | ||
5 | "global.spellchecker.useDefault": "Use System Default ({default})", | ||
6 | "global.spellchecking.autodetect": "Detect language automatically", | ||
7 | "global.spellchecking.autodetect.short": "Automatic", | ||
4 | "welcome.signupButton": "Create a free account", | 8 | "welcome.signupButton": "Create a free account", |
5 | "welcome.loginButton": "Login to your account", | 9 | "welcome.loginButton": "Login to your account", |
6 | "welcome.slogan": "Messaging that works for you", | 10 | "welcome.slogan": "Messaging that works for you", |
diff --git a/src/webview/contextMenu.js b/src/webview/contextMenu.js index a76c03e5a..afb1d8912 100644 --- a/src/webview/contextMenu.js +++ b/src/webview/contextMenu.js | |||
@@ -207,8 +207,6 @@ const buildMenuTpl = (props, suggestions, isSpellcheckEnabled, defaultSpellcheck | |||
207 | }); | 207 | }); |
208 | }); | 208 | }); |
209 | 209 | ||
210 | console.log('isSpellcheckEnabled', isSpellcheckEnabled); | ||
211 | |||
212 | menuTpl.push({ | 210 | menuTpl.push({ |
213 | type: 'separator', | 211 | type: 'separator', |
214 | }, { | 212 | }, { |
@@ -234,6 +232,16 @@ const buildMenuTpl = (props, suggestions, isSpellcheckEnabled, defaultSpellcheck | |||
234 | }, | 232 | }, |
235 | }, | 233 | }, |
236 | { | 234 | { |
235 | id: 'automaticDetection', | ||
236 | label: 'Automatic language detection', | ||
237 | type: 'radio', | ||
238 | checked: spellcheckerLanguage === 'automatic', | ||
239 | click() { | ||
240 | debug('Detect language automatically'); | ||
241 | ipcRenderer.sendToHost('set-service-spellchecker-language', 'automatic'); | ||
242 | }, | ||
243 | }, | ||
244 | { | ||
237 | type: 'separator', | 245 | type: 'separator', |
238 | visible: defaultSpellcheckerLanguage !== spellcheckerLanguage, | 246 | visible: defaultSpellcheckerLanguage !== spellcheckerLanguage, |
239 | }, | 247 | }, |
diff --git a/src/webview/recipe.js b/src/webview/recipe.js index c718b348e..1e5d74b1f 100644 --- a/src/webview/recipe.js +++ b/src/webview/recipe.js | |||
@@ -1,10 +1,12 @@ | |||
1 | import { ipcRenderer } from 'electron'; | 1 | import { ipcRenderer } from 'electron'; |
2 | import path from 'path'; | 2 | import path from 'path'; |
3 | import { autorun, computed, observable } from 'mobx'; | 3 | import { autorun, computed, observable } from 'mobx'; |
4 | import { loadModule } from 'cld3-asm'; | ||
5 | import { debounce } from 'lodash'; | ||
4 | 6 | ||
5 | import RecipeWebview from './lib/RecipeWebview'; | 7 | import RecipeWebview from './lib/RecipeWebview'; |
6 | 8 | ||
7 | import spellchecker, { switchDict, disable as disableSpellchecker } from './spellchecker'; | 9 | import spellchecker, { switchDict, disable as disableSpellchecker, getSpellcheckerLocaleByFuzzyIdentifier } from './spellchecker'; |
8 | import { injectDarkModeStyle, isDarkModeStyleInjected, removeDarkModeStyle } from './darkmode'; | 10 | import { injectDarkModeStyle, isDarkModeStyleInjected, removeDarkModeStyle } from './darkmode'; |
9 | import contextMenu from './contextMenu'; | 11 | import contextMenu from './contextMenu'; |
10 | import './notifications'; | 12 | import './notifications'; |
@@ -40,6 +42,8 @@ class RecipeController { | |||
40 | return this.settings.service.spellcheckerLanguage || this.settings.app.spellcheckerLanguage; | 42 | return this.settings.service.spellcheckerLanguage || this.settings.app.spellcheckerLanguage; |
41 | } | 43 | } |
42 | 44 | ||
45 | cldIdentifier = null; | ||
46 | |||
43 | async initialize() { | 47 | async initialize() { |
44 | Object.keys(this.ipcEvents).forEach((channel) => { | 48 | Object.keys(this.ipcEvents).forEach((channel) => { |
45 | ipcRenderer.on(channel, (...args) => { | 49 | ipcRenderer.on(channel, (...args) => { |
@@ -87,10 +91,22 @@ class RecipeController { | |||
87 | 91 | ||
88 | if (this.settings.app.enableSpellchecking) { | 92 | if (this.settings.app.enableSpellchecking) { |
89 | debug('Setting spellchecker language to', this.spellcheckerLanguage); | 93 | debug('Setting spellchecker language to', this.spellcheckerLanguage); |
90 | switchDict(this.spellcheckerLanguage); | 94 | let { spellcheckerLanguage } = this; |
95 | if (spellcheckerLanguage === 'automatic') { | ||
96 | this.automaticLanguageDetection(); | ||
97 | debug('Found `automatic` locale, falling back to user locale until detected', this.settings.app.locale); | ||
98 | spellcheckerLanguage = this.settings.app.locale; | ||
99 | } else if (this.cldIdentifier) { | ||
100 | this.cldIdentifier.destroy(); | ||
101 | } | ||
102 | switchDict(spellcheckerLanguage); | ||
91 | } else { | 103 | } else { |
92 | debug('Disable spellchecker'); | 104 | debug('Disable spellchecker'); |
93 | disableSpellchecker(); | 105 | disableSpellchecker(); |
106 | |||
107 | if (this.cldIdentifier) { | ||
108 | this.cldIdentifier.destroy(); | ||
109 | } | ||
94 | } | 110 | } |
95 | 111 | ||
96 | if (this.settings.service.isDarkModeEnabled) { | 112 | if (this.settings.service.isDarkModeEnabled) { |
@@ -113,6 +129,42 @@ class RecipeController { | |||
113 | serviceIdEcho(event) { | 129 | serviceIdEcho(event) { |
114 | event.sender.send('service-id', this.settings.service.id); | 130 | event.sender.send('service-id', this.settings.service.id); |
115 | } | 131 | } |
132 | |||
133 | async automaticLanguageDetection() { | ||
134 | const cldFactory = await loadModule(); | ||
135 | this.cldIdentifier = cldFactory.create(0, 1000); | ||
136 | |||
137 | window.addEventListener('keyup', debounce((e) => { | ||
138 | const element = e.target; | ||
139 | |||
140 | console.log(element); | ||
141 | |||
142 | if (!element) return; | ||
143 | |||
144 | let value = ''; | ||
145 | if (element.isContentEditable) { | ||
146 | value = element.textContent; | ||
147 | } else if (element.value) { | ||
148 | value = element.value; | ||
149 | } | ||
150 | |||
151 | // Force a minimum length to get better detection results | ||
152 | if (value.length < 30) return; | ||
153 | |||
154 | debug('Detecting language for', value); | ||
155 | const findResult = this.cldIdentifier.findLanguage(value); | ||
156 | |||
157 | debug('Language detection result', findResult); | ||
158 | |||
159 | if (findResult.is_reliable) { | ||
160 | const spellcheckerLocale = getSpellcheckerLocaleByFuzzyIdentifier(findResult.language); | ||
161 | debug('Language detected reliably, setting spellchecker language to', spellcheckerLocale); | ||
162 | if (spellcheckerLocale) { | ||
163 | switchDict(spellcheckerLocale); | ||
164 | } | ||
165 | } | ||
166 | }, 225)); | ||
167 | } | ||
116 | } | 168 | } |
117 | 169 | ||
118 | /* eslint-disable no-new */ | 170 | /* eslint-disable no-new */ |
diff --git a/src/webview/spellchecker.js b/src/webview/spellchecker.js index becaed449..9158b3b94 100644 --- a/src/webview/spellchecker.js +++ b/src/webview/spellchecker.js | |||
@@ -3,6 +3,7 @@ import { SpellCheckerProvider } from 'electron-hunspell'; | |||
3 | import path from 'path'; | 3 | import path from 'path'; |
4 | 4 | ||
5 | import { DICTIONARY_PATH } from '../config'; | 5 | import { DICTIONARY_PATH } from '../config'; |
6 | import { SPELLCHECKER_LOCALES } from '../i18n/languages'; | ||
6 | 7 | ||
7 | const debug = require('debug')('Franz:spellchecker'); | 8 | const debug = require('debug')('Franz:spellchecker'); |
8 | 9 | ||
@@ -82,3 +83,13 @@ export function disable() { | |||
82 | currentDict = null; | 83 | currentDict = null; |
83 | } | 84 | } |
84 | } | 85 | } |
86 | |||
87 | export function getSpellcheckerLocaleByFuzzyIdentifier(identifier) { | ||
88 | const locales = Object.keys(SPELLCHECKER_LOCALES).filter(key => key === identifier.toLowerCase() || key.split('-')[0] === identifier.toLowerCase()); | ||
89 | |||
90 | if (locales.length >= 1) { | ||
91 | return locales[0]; | ||
92 | } | ||
93 | |||
94 | return null; | ||
95 | } | ||