From 978ef6bd92e5785c1f03c6d628a88130e1b8c0c8 Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Thu, 17 Oct 2024 14:28:26 +0100 Subject: [PATCH] Enable remaining client-side dictionaries (#21192) GitOrigin-RevId: da45ae4a93e99a0bb720e09a37c8e291c057cab9 --- services/web/config/settings.defaults.js | 8 ++------ .../source-editor/hunspell/compile.sh | 1 + .../source-editor/hunspell/wasm/README.md | 2 ++ .../source-editor/hunspell/wasm/hunspell.wasm | Bin 884804 -> 884805 bytes 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/services/web/config/settings.defaults.js b/services/web/config/settings.defaults.js index 8bd02a94d2..fe040ac952 100644 --- a/services/web/config/settings.defaults.js +++ b/services/web/config/settings.defaults.js @@ -462,11 +462,7 @@ module.exports = { { code: 'ca', dic: 'ca', name: 'Catalan' }, { code: 'hr', dic: 'hr_HR', name: 'Croatian' }, { code: 'cs', dic: 'cs_CZ', name: 'Czech' }, - { - code: 'da', - // dic: 'da_DK', TODO: re-enable client spell check - name: 'Danish', - }, + { code: 'da', dic: 'da_DK', name: 'Danish' }, { code: 'nl', dic: 'nl', name: 'Dutch' }, { code: 'dz', dic: 'dz', name: 'Dzongkha', server: false }, { code: 'eo', dic: 'eo', name: 'Esperanto' }, @@ -536,7 +532,7 @@ module.exports = { { code: 'ts', name: 'Tsonga' }, { code: 'tn', name: 'Tswana' }, { code: 'tr_TR', dic: 'tr_TR', name: 'Turkish', server: false }, - // { code: 'uk_UA', dic: 'uk_UA', name: 'Ukrainian', server: false }, + { code: 'uk_UA', dic: 'uk_UA', name: 'Ukrainian', server: false }, { code: 'hsb', name: 'Upper Sorbian' }, { code: 'uz_UZ', dic: 'uz_UZ', name: 'Uzbek', server: false }, { code: 'vi_VN', dic: 'vi_VN', name: 'Vietnamese', server: false }, diff --git a/services/web/frontend/js/features/source-editor/hunspell/compile.sh b/services/web/frontend/js/features/source-editor/hunspell/compile.sh index e14639cf65..889c76cea2 100755 --- a/services/web/frontend/js/features/source-editor/hunspell/compile.sh +++ b/services/web/frontend/js/features/source-editor/hunspell/compile.sh @@ -14,6 +14,7 @@ em++ \ -s EXPORTED_FUNCTIONS="['_Hunspell_create', '_Hunspell_destroy', '_Hunspell_spell', '_Hunspell_suggest', '_Hunspell_free_list', '_Hunspell_add_dic', '_Hunspell_add', '_Hunspell_remove', '_free', '_malloc', 'FS']" \ -s EXPORTED_RUNTIME_METHODS="['ccall', 'cwrap', 'getValue', 'stringToNewUTF8', 'UTF8ToString', 'WORKERFS']" \ -s ENVIRONMENT=worker \ + -s STACK_SIZE=5MB \ -s ALLOW_MEMORY_GROWTH \ -lworkerfs.js \ -O2 \ diff --git a/services/web/frontend/js/features/source-editor/hunspell/wasm/README.md b/services/web/frontend/js/features/source-editor/hunspell/wasm/README.md index 317c7031c5..81dd64da36 100644 --- a/services/web/frontend/js/features/source-editor/hunspell/wasm/README.md +++ b/services/web/frontend/js/features/source-editor/hunspell/wasm/README.md @@ -5,3 +5,5 @@ The files in this directory are: * `hunspell.wasm`: [Hunspell](https://github.com/hunspell/hunspell) compiled to WebAssembly using Emscripten, via the [build.sh](../build.sh) script. * `hunspell.mjs`: a JavaScript wrapper for the WebAssembly module, generated by Emscripten. * `hunspell.d.ts`: manually-created types for the exports from the JavaScript module. + +Note: To speed up compilation on ARM architecture (e.g. Apple M1), add `-arm64` to the Docker image tag in `Dockerfile`. diff --git a/services/web/frontend/js/features/source-editor/hunspell/wasm/hunspell.wasm b/services/web/frontend/js/features/source-editor/hunspell/wasm/hunspell.wasm index 9ac85110d068fe6e007796bd3a19d93df8664526..4f8e972184ad939d8c7a886e887eaa75dec574f8 100644 GIT binary patch delta 86 zcmX@oV0N^@Y=bR3|8=H@1|~L6#(GA_hQ3=&&ED+o-t3G(%ml>DK+FQftU$~L#2`5i cAm#*OuI=9J-2c`vhP8Wb;ok1Gh3D6408{`PKmY&$ delta 85 zcmX@wV0NUzY=bR3Uk6h|0}~quV?Co|L!Vr;4|}^0J0lP?0WmWWvj8zG5VHX>NR9)D bIf0mKyAM0}zcq~P?cQ6sw|j5l`E?oq1UMM*