Package: dictionaries-common
Version: 1.28.18
Severity: wishlist
Tags: l10n

Qt WebEngine has the ability to use Hunspell dictionaries for spell checking 
with the WebEngine, but for some reason they require that the dictionary files 
be converted to a special binary format (.bdic).  This conversion can be done 
using qwebengine_convert_dict from the qtwebengine5-dev-tools package.  The 
upstream documentation regarding this is found on Qt's website:

https://doc.qt.io/qt-5/qtwebengine-features.html#spellchecker

Once these libraries are available they can be used by any program that 
includes Qt WebEngine.

The purpose of this bug report is to create a central location for discussion 
about the best way to package these dictionaries.

There are two general questions that should be standardized:

1.  What should be the policy regarding the binary packages?
2.  Where should the dictionaries be placed on the file system?

1.  The binary packages can be built without much difficulty from the same 
source as existing Hunspell dictionaries.  For an example of how this can be 
done, see the following commit by Don Armstrong <d...@debian.org> to the scowl 
sorce package which builds the English Hunspell dictionary binary packages:

https://git.donarmstrong.com/?p=deb_pkgs/scowl.git;a=commitdiff;h=4510f7fed66204384fe8c39fc875e24fd874229b

In this example patch, the compiled Qt WebEngine binary dictionary is shipped 
as part of the existing Hunspell binary packages (for example, hunspell-en-us). 
 Another option would be to create a separate binary package (for example, 
qtwebengine-dict-en-us).  The argument for including it in the existing binary 
package is that the compiled Qt WebEngine dictionary is not very large (691.2 
KiB for en_US).  The argument for splitting it into a separate binary package 
is that most people who install the Hunspell dictionaries don't intent to use a 
program that does spell checking inside of a Qt WebEngine, so it would be 
wasted space on their system.

2.  Qt WebEngine searches for these binary dictionary packages in a number of 
places described in the upstream link above.  One of them is in the system-wide 
QT_INSTALL_PREFIX/qtwebengine_dictionaries.  The current QT_INSTALL_PREFIX can 
be determined by running the following command (assuming qmake is installed):

~$ qmake -query | grep QT_INSTALL_DATA
QT_INSTALL_DATA:/usr/share/qt5

Originally, I had proposed installing the dictionary files directly into 
/usr/share/qt5/qtwebengine_dictionaries with a symlink from the upcoming 
/usr/share/qt6/qtwebengine_dictionaries.  However Don Armstrong proposed that 
they instead be installed in an unversioned directory and then symlinked from 
all the current versioned Qt directories, which makes it easier to maintain.  
His patch, linked above, places the .bdic files into /usr/share/hunspell with 
the original Hunspell files they were compiled from.  Rene Engelhard 
<r...@debian.org> objects to this file location because he feels it should be 
preserved for files in the canonical Hunspell format.  If a different directory 
is used for the Qt WebEngine .bdic files, I would propose something like 
/usr/share/qtwebengine-dict.

There is some discussion about this topic that already exists in the bug report 
for scowl and on the Debian-KDE mailing list.

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1017646
https://lists.debian.org/debian-kde/2022/09/msg00011.html

I don't have a particularly strong opinion about either of these two issues, 
although I do lean slightly towards having separate binary packages and using 
/usr/share/qtwebengine-dict for the file locations.  However, I do think it is 
important that there is a consensus among all those who maintain the dictionary 
language packages and that this consensus be documented in a central location.

Reply via email to