summarylogtreecommitdiffstats
path: root/fix-dictionaries.patch
diff options
context:
space:
mode:
Diffstat (limited to 'fix-dictionaries.patch')
-rw-r--r--fix-dictionaries.patch20
1 files changed, 20 insertions, 0 deletions
diff --git a/fix-dictionaries.patch b/fix-dictionaries.patch
new file mode 100644
index 000000000000..4c7ea91cb285
--- /dev/null
+++ b/fix-dictionaries.patch
@@ -0,0 +1,20 @@
+diff -ura package.orig/src/public/lib/SpellCheck.js package.new/src/public/lib/SpellCheck.js
+--- package.orig/src/public/lib/SpellCheck.js 2018-12-31 23:10:21.364014246 +0100
++++ package.new/src/public/lib/SpellCheck.js 2018-12-31 23:21:27.153584606 +0100
+@@ -156,12 +156,10 @@
+ if (this.availableDictionaries.length === 0) {
+ this.multiLanguage = false;
+ // Dictionaries path is correct for build
+- this.dictionariesPath = path.join(
+- app.getAppPath(),
+- app.getAppPath().endsWith('app.asar') ? '..' : '.',
+- 'dictionaries'
+- );
+- this.getDictionariesFromInstallDirectory();
++ if (fs.existsSync('/usr/share/hunspell')) {
++ this.dictionariesPath = '/usr/share/hunspell';
++ this.getDictionariesFromInstallDirectory();
++ }
+ } else {
+ this.multiLanguage = process.platform !== 'win32';
+ this.availableDictionaries = this.availableDictionaries.map((dict) => dict.replace('-', '_'));