Spell checking #700

Closed
Carpetsmoker opened this Issue May 29, 2015 · 46 comments

Comments

Projects
None yet
@Carpetsmoker
Contributor

Carpetsmoker commented May 29, 2015

I often use spell checking in my browser.

It should support multiple languages, but I would prefer that it's not like dwb where you see both languages intermixed. This is very annoying if you use 3 languages.

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler May 29, 2015

Collaborator

This is something which isn't normally doable using the QtWebKit APIs - however, there's the QupZilla/qtwebkit-plugins repo, which can be used to build a libqtwebkitplugins.so.

After that's copied to /usr/lib/qt/plugins/webkit (at least here on Arch) I at least get underlined words in text fields.

Someone would have to look into more integration like QupZilla has (i.e. a right-click menu), but that's very low-priority for me.

Collaborator

The-Compiler commented May 29, 2015

This is something which isn't normally doable using the QtWebKit APIs - however, there's the QupZilla/qtwebkit-plugins repo, which can be used to build a libqtwebkitplugins.so.

After that's copied to /usr/lib/qt/plugins/webkit (at least here on Arch) I at least get underlined words in text fields.

Someone would have to look into more integration like QupZilla has (i.e. a right-click menu), but that's very low-priority for me.

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler May 29, 2015

Collaborator

Quick follow-up - my train was going over the border before, so I was a bit in a hurry to send the comment before my connection was gone 😆

I don't know whether the kind of integration QupZilla has with the plugin would be possible with the PyQt APIs, it might not be possible at all.

It seems the plugin does multi-language, at least in the right-click menu in QupZilla you get checkboxes for languages.

Also, all that probably won't work when I add a QtWebEngine/Chromium backend to qutebrowser - I don't know what the plans are to add a spellcheck API there, or if it works out-of-the-box already.

Of course, pull requests regarding this would be welcome (and thanks for all the great other PRs!), but probably #349 (a custom context menu) would have to be done first.

Collaborator

The-Compiler commented May 29, 2015

Quick follow-up - my train was going over the border before, so I was a bit in a hurry to send the comment before my connection was gone 😆

I don't know whether the kind of integration QupZilla has with the plugin would be possible with the PyQt APIs, it might not be possible at all.

It seems the plugin does multi-language, at least in the right-click menu in QupZilla you get checkboxes for languages.

Also, all that probably won't work when I add a QtWebEngine/Chromium backend to qutebrowser - I don't know what the plans are to add a spellcheck API there, or if it works out-of-the-box already.

Of course, pull requests regarding this would be welcome (and thanks for all the great other PRs!), but probably #349 (a custom context menu) would have to be done first.

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler May 31, 2016

Collaborator

FWIW I now packaged qtwebkit-plugins in the Archlinux AUR: https://aur.archlinux.org/packages/qtwebkit-plugins-git/

Collaborator

The-Compiler commented May 31, 2016

FWIW I now packaged qtwebkit-plugins in the Archlinux AUR: https://aur.archlinux.org/packages/qtwebkit-plugins-git/

@lahwaacz

This comment has been minimized.

Show comment
Hide comment
@lahwaacz

lahwaacz Jun 3, 2016

Collaborator

I've installed the package and still don't see any highlighting of misspelled words. Is there some configuration necessary?

Collaborator

lahwaacz commented Jun 3, 2016

I've installed the package and still don't see any highlighting of misspelled words. Is there some configuration necessary?

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Jun 3, 2016

Collaborator

It should just work™. Someone else reported it didn't work for them in IRC as well, but I have no idea why...

When trying to reproduce I had some issues as well, but then I figured out it sometimes just takes a few seconds after typing a misspelled word until it gets highlighted.

If it doesn't work with e.g. Otter Browser either (the situation is different for QupZilla as that has a more sophisticated spell checking integrated), I'd suggest opening a bug at https://github.com/QupZilla/qtwebkit-plugins/issues

FWIW there's QupZilla/qtwebkit-plugins#7 already open, but as said, it works fine for me...

Collaborator

The-Compiler commented Jun 3, 2016

It should just work™. Someone else reported it didn't work for them in IRC as well, but I have no idea why...

When trying to reproduce I had some issues as well, but then I figured out it sometimes just takes a few seconds after typing a misspelled word until it gets highlighted.

If it doesn't work with e.g. Otter Browser either (the situation is different for QupZilla as that has a more sophisticated spell checking integrated), I'd suggest opening a bug at https://github.com/QupZilla/qtwebkit-plugins/issues

FWIW there's QupZilla/qtwebkit-plugins#7 already open, but as said, it works fine for me...

@lahwaacz

This comment has been minimized.

Show comment
Hide comment
@lahwaacz

lahwaacz Jun 3, 2016

Collaborator

Otter Browser seems to have custom spell-checking, which also does not work for me. They have still some issues (OtterBrowser/otter-browser#504 (comment)) and installing qtwebkit-plugins did not make any difference.

Collaborator

lahwaacz commented Jun 3, 2016

Otter Browser seems to have custom spell-checking, which also does not work for me. They have still some issues (OtterBrowser/otter-browser#504 (comment)) and installing qtwebkit-plugins did not make any difference.

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Jun 3, 2016

Collaborator

Can you see any SpellCheck output when you start with --debug? Do you have a dictionary like hunspell-en (on Arch) installed?

Collaborator

The-Compiler commented Jun 3, 2016

Can you see any SpellCheck output when you start with --debug? Do you have a dictionary like hunspell-en (on Arch) installed?

@lahwaacz

This comment has been minimized.

Show comment
Hide comment
@lahwaacz

lahwaacz Jun 3, 2016

Collaborator

We (me and grep) don't see any output related to spell-checking. Both hunspell and hunspell-en are installed.

Collaborator

lahwaacz commented Jun 3, 2016

We (me and grep) don't see any output related to spell-checking. Both hunspell and hunspell-en are installed.

@ids1024

This comment has been minimized.

Show comment
Hide comment
@ids1024

ids1024 Jun 4, 2016

It doesn't seem to work for me either; I have Arch Linux with that AUR package installed, as well as hunspell-en.

ids1024 commented Jun 4, 2016

It doesn't seem to work for me either; I have Arch Linux with that AUR package installed, as well as hunspell-en.

@shioyama

This comment has been minimized.

Show comment
Hide comment
@shioyama

shioyama Jun 4, 2016

Same here doesn't work for me on Arch with the AUR package installed. I have hunspell-en installed.

shioyama commented Jun 4, 2016

Same here doesn't work for me on Arch with the AUR package installed. I have hunspell-en installed.

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Jun 4, 2016

Collaborator

Do you see something interesting when you run QT_DEBUG_PLUGINS=1 qutebrowser --temp-basedir --debug --logfilter qt? For me it's this:

16:18:08 WARNING  qt         Unknown module:none:0 Found metadata in lib /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so, metadata=
{
    "IID": "org.qtwebkit.QtWebKit.QtWebKitPlugin",
    "MetaData": {
    },
    "className": "QtWebKitPlugin",
    "debug": false,
    "version": 329216
}
16:18:08 DEBUG    qt         Unknown module:none:0 loaded library "/usr/lib/qt/plugins/webkit/libqtwebkitplugins.so"
Collaborator

The-Compiler commented Jun 4, 2016

Do you see something interesting when you run QT_DEBUG_PLUGINS=1 qutebrowser --temp-basedir --debug --logfilter qt? For me it's this:

16:18:08 WARNING  qt         Unknown module:none:0 Found metadata in lib /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so, metadata=
{
    "IID": "org.qtwebkit.QtWebKit.QtWebKitPlugin",
    "MetaData": {
    },
    "className": "QtWebKitPlugin",
    "debug": false,
    "version": 329216
}
16:18:08 DEBUG    qt         Unknown module:none:0 loaded library "/usr/lib/qt/plugins/webkit/libqtwebkitplugins.so"
@lahwaacz

This comment has been minimized.

Show comment
Hide comment
@lahwaacz

lahwaacz Jun 4, 2016

Collaborator

Yeah:

16:35:32 WARNING  qt         Unknown module:none:0 Found metadata in lib /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so, metadata=
{
    "IID": "org.qtwebkit.QtWebKit.QtWebKitPlugin",
    "MetaData": {
    },
    "className": "QtWebKitPlugin",
    "debug": false,
    "version": 329216
}


  File "/usr/bin/qutebrowser", line 9, in <module>
    load_entry_point('qutebrowser==0.6.2', 'gui_scripts', 'qutebrowser')()
  File "/usr/lib/python3.5/site-packages/qutebrowser/qutebrowser.py", line 159, in main
    return app.run(args)
  File "/usr/lib/python3.5/site-packages/qutebrowser/app.py", line 111, in run
    ret = qt_mainloop()
  File "/usr/lib/python3.5/site-packages/qutebrowser/app.py", line 121, in qt_mainloop
    return qApp.exec_()
  File "/usr/lib/python3.5/site-packages/qutebrowser/utils/log.py", line 356, in qt_message_handler
    stack = ''.join(traceback.format_stack())

16:35:32 DEBUG    qt         Unknown module:none:0 loaded library "/usr/lib/qt/plugins/webkit/libqtwebkitplugins.so"
  File "/usr/bin/qutebrowser", line 9, in <module>
    load_entry_point('qutebrowser==0.6.2', 'gui_scripts', 'qutebrowser')()
  File "/usr/lib/python3.5/site-packages/qutebrowser/qutebrowser.py", line 159, in main
    return app.run(args)
  File "/usr/lib/python3.5/site-packages/qutebrowser/app.py", line 111, in run
    ret = qt_mainloop()
  File "/usr/lib/python3.5/site-packages/qutebrowser/app.py", line 121, in qt_mainloop
    return qApp.exec_()
  File "/usr/lib/python3.5/site-packages/qutebrowser/utils/log.py", line 356, in qt_message_handler
    stack = ''.join(traceback.format_stack())

16:35:32 WARNING  qt         Unknown module:none:0 QLibraryPrivate::loadPlugin failed on "/usr/lib/qt/plugins/webkit/libqtwebkitplugins.so" : "Cannot load library /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so: (/usr/lib/qt/plugins/webkit/libqtwebkitplugins.so: undefined symbol: _ZTI16QWebSpellChecker)"
  File "/usr/bin/qutebrowser", line 9, in <module>
    load_entry_point('qutebrowser==0.6.2', 'gui_scripts', 'qutebrowser')()
  File "/usr/lib/python3.5/site-packages/qutebrowser/qutebrowser.py", line 159, in main
    return app.run(args)
  File "/usr/lib/python3.5/site-packages/qutebrowser/app.py", line 111, in run
    ret = qt_mainloop()
  File "/usr/lib/python3.5/site-packages/qutebrowser/app.py", line 121, in qt_mainloop
    return qApp.exec_()
  File "/usr/lib/python3.5/site-packages/qutebrowser/utils/log.py", line 356, in qt_message_handler
    stack = ''.join(traceback.format_stack())
Collaborator

lahwaacz commented Jun 4, 2016

Yeah:

16:35:32 WARNING  qt         Unknown module:none:0 Found metadata in lib /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so, metadata=
{
    "IID": "org.qtwebkit.QtWebKit.QtWebKitPlugin",
    "MetaData": {
    },
    "className": "QtWebKitPlugin",
    "debug": false,
    "version": 329216
}


  File "/usr/bin/qutebrowser", line 9, in <module>
    load_entry_point('qutebrowser==0.6.2', 'gui_scripts', 'qutebrowser')()
  File "/usr/lib/python3.5/site-packages/qutebrowser/qutebrowser.py", line 159, in main
    return app.run(args)
  File "/usr/lib/python3.5/site-packages/qutebrowser/app.py", line 111, in run
    ret = qt_mainloop()
  File "/usr/lib/python3.5/site-packages/qutebrowser/app.py", line 121, in qt_mainloop
    return qApp.exec_()
  File "/usr/lib/python3.5/site-packages/qutebrowser/utils/log.py", line 356, in qt_message_handler
    stack = ''.join(traceback.format_stack())

16:35:32 DEBUG    qt         Unknown module:none:0 loaded library "/usr/lib/qt/plugins/webkit/libqtwebkitplugins.so"
  File "/usr/bin/qutebrowser", line 9, in <module>
    load_entry_point('qutebrowser==0.6.2', 'gui_scripts', 'qutebrowser')()
  File "/usr/lib/python3.5/site-packages/qutebrowser/qutebrowser.py", line 159, in main
    return app.run(args)
  File "/usr/lib/python3.5/site-packages/qutebrowser/app.py", line 111, in run
    ret = qt_mainloop()
  File "/usr/lib/python3.5/site-packages/qutebrowser/app.py", line 121, in qt_mainloop
    return qApp.exec_()
  File "/usr/lib/python3.5/site-packages/qutebrowser/utils/log.py", line 356, in qt_message_handler
    stack = ''.join(traceback.format_stack())

16:35:32 WARNING  qt         Unknown module:none:0 QLibraryPrivate::loadPlugin failed on "/usr/lib/qt/plugins/webkit/libqtwebkitplugins.so" : "Cannot load library /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so: (/usr/lib/qt/plugins/webkit/libqtwebkitplugins.so: undefined symbol: _ZTI16QWebSpellChecker)"
  File "/usr/bin/qutebrowser", line 9, in <module>
    load_entry_point('qutebrowser==0.6.2', 'gui_scripts', 'qutebrowser')()
  File "/usr/lib/python3.5/site-packages/qutebrowser/qutebrowser.py", line 159, in main
    return app.run(args)
  File "/usr/lib/python3.5/site-packages/qutebrowser/app.py", line 111, in run
    ret = qt_mainloop()
  File "/usr/lib/python3.5/site-packages/qutebrowser/app.py", line 121, in qt_mainloop
    return qApp.exec_()
  File "/usr/lib/python3.5/site-packages/qutebrowser/utils/log.py", line 356, in qt_message_handler
    stack = ''.join(traceback.format_stack())
@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Jun 4, 2016

Collaborator

Okay - the QLibraryPrivate::loadPlugin failed on "/usr/lib/qt/plugins/webkit/libqtwebkitplugins.so" : "Cannot load library /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so: (/usr/lib/qt/plugins/webkit/libqtwebkitplugins.so: undefined symbol: _ZTI16QWebSpellChecker)" tells us what's going on, now I only have to find out why... 😉

Collaborator

The-Compiler commented Jun 4, 2016

Okay - the QLibraryPrivate::loadPlugin failed on "/usr/lib/qt/plugins/webkit/libqtwebkitplugins.so" : "Cannot load library /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so: (/usr/lib/qt/plugins/webkit/libqtwebkitplugins.so: undefined symbol: _ZTI16QWebSpellChecker)" tells us what's going on, now I only have to find out why... 😉

@lahwaacz

This comment has been minimized.

Show comment
Hide comment
@lahwaacz

lahwaacz Jun 4, 2016

Collaborator

If I remember correctly, you have some custom Qt builds for testing? The _ZTI16QWebSpellChecker symbol might be missing only in the Arch packages, or there is some missing (optional) dependency. You could try to find out which file contains the symbol 😉

Collaborator

lahwaacz commented Jun 4, 2016

If I remember correctly, you have some custom Qt builds for testing? The _ZTI16QWebSpellChecker symbol might be missing only in the Arch packages, or there is some missing (optional) dependency. You could try to find out which file contains the symbol 😉

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Jun 4, 2016

Collaborator

I can only find that symbol in /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so which is the thing built by the package...

Collaborator

The-Compiler commented Jun 4, 2016

I can only find that symbol in /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so which is the thing built by the package...

@ff2000

This comment has been minimized.

Show comment
Hide comment
@ff2000

ff2000 Jun 4, 2016

On Sat, 04 Jun 2016 08:35:44 -0700, Florian Bruhin notifications@github.com wrote:

I can only find that symbol in /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so which is the thing built by the package...

QWebSpellChecker is just an interface (class with only pure virtual methods).
Probably there is something missing in the output. E.g. it cuts exactly after
the class name but before the mangled method name. readelf -Ws shows everything.

I currentl can't check myself because I have no QtWebKit (not even Qt) installed
and my laptop is too week to do so just to look at this issue :/ (Gentoo...)

ff2000 commented Jun 4, 2016

On Sat, 04 Jun 2016 08:35:44 -0700, Florian Bruhin notifications@github.com wrote:

I can only find that symbol in /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so which is the thing built by the package...

QWebSpellChecker is just an interface (class with only pure virtual methods).
Probably there is something missing in the output. E.g. it cuts exactly after
the class name but before the mangled method name. readelf -Ws shows everything.

I currentl can't check myself because I have no QtWebKit (not even Qt) installed
and my laptop is too week to do so just to look at this issue :/ (Gentoo...)

@lahwaacz

This comment has been minimized.

Show comment
Hide comment
@lahwaacz

lahwaacz Jun 4, 2016

Collaborator
$ objdump -T /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so | grep -i spellchecker
0000000000000000      D  *UND*  0000000000000000              _ZTI16QWebSpellChecker
0000000000000000      D  *UND*  0000000000000000              _ZN16QWebSpellChecker11qt_metacastEPKc
0000000000000000      D  *UND*  0000000000000000              _ZTV16QWebSpellChecker
0000000000000000      D  *UND*  0000000000000000              _ZN16QWebSpellChecker11qt_metacallEN11QMetaObject4CallEiPPv
0000000000000000      D  *UND*  0000000000000000              _ZN16QWebSpellChecker16staticMetaObjectE
0000000000006840 g    DF .text  0000000000000002  Base        _ZN10SpellCheck20checkGrammarOfStringERK7QStringR5QListIN16QWebSpellChecker13GrammarDetailEEPiS8_

From objdump(1):

Here the first number is the symbol's value (sometimes refered to as its
address). The next field is actually a set of characters and spaces
indicating the flag bits that are set on the symbol. These characters are
described below. Next is the section with which the symbol is associated or
ABS if the section is absolute (ie not connected with any section), or
UND if the section is referenced in the file being dumped, but not defined
there.
...

If I'm reading this correctly, the symbol is only used in the file, but not defined. Comparing with qupzilla's built-in spell-checker:

$ objdump -T /usr/lib/libQupZilla.so | grep -i spellchecker
00000000004a88f2 g    DF .text  0000000000000050  Base        _ZN16QWebSpellChecker11qt_metacastEPKc
00000000004a8942 g    DF .text  000000000000003f  Base        _ZN16QWebSpellChecker11qt_metacallEN11QMetaObject4CallEiPPv
00000000002619b2  w   DF .text  0000000000000032  Base        _ZN16QWebSpellCheckerC1Ev
0000000000831d50  w   DO .data.rel.ro   00000000000000c0  Base        _ZTV16QWebSpellChecker
00000000004a88aa g    DF .text  0000000000000048  Base        _ZNK16QWebSpellChecker10metaObjectEv
0000000000261816 g    DF .text  000000000000001b  Base        _ZN10SpellCheck20checkGrammarOfStringERK7QStringR5QListIN16QWebSpellChecker13GrammarDetailEEPiS8_
00000000002619b2  w   DF .text  0000000000000032  Base        _ZN16QWebSpellCheckerC2Ev
0000000000565a10  w   DO .rodata    0000000000000013  Base        _ZTS16QWebSpellChecker
00000000004a8a9e  w   DF .text  000000000000002b  Base        _ZN16QWebSpellCheckerD0Ev
0000000000831d20 g    DO .data.rel.ro   0000000000000030  Base        _ZN16QWebSpellChecker16staticMetaObjectE
00000000004a8a70  w   DF .text  000000000000002d  Base        _ZN16QWebSpellCheckerD1Ev
00000000004a8a70  w   DF .text  000000000000002d  Base        _ZN16QWebSpellCheckerD2Ev
0000000000832008  w   DO .data.rel.ro   0000000000000018  Base        _ZTI16QWebSpellChecker

so the symbol is correctly defined there. What does it look like on your side, @The-Compiler?

By the way, the -C flag can be used to demangle the C++ symbols:

$ objdump -TC /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so | grep -i spellchecker
0000000000000000      D  *UND*  0000000000000000              typeinfo for QWebSpellChecker
0000000000000000      D  *UND*  0000000000000000              QWebSpellChecker::qt_metacast(char const*)
0000000000000000      D  *UND*  0000000000000000              vtable for QWebSpellChecker
0000000000000000      D  *UND*  0000000000000000              QWebSpellChecker::qt_metacall(QMetaObject::Call, int, void**)
0000000000000000      D  *UND*  0000000000000000              QWebSpellChecker::staticMetaObject
0000000000006840 g    DF .text  0000000000000002  Base        SpellCheck::checkGrammarOfString(QString const&, QList<QWebSpellChecker::GrammarDetail>&, int*, int*)

so the missing symbol is typeinfo for QWebSpellChecker.

Collaborator

lahwaacz commented Jun 4, 2016

$ objdump -T /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so | grep -i spellchecker
0000000000000000      D  *UND*  0000000000000000              _ZTI16QWebSpellChecker
0000000000000000      D  *UND*  0000000000000000              _ZN16QWebSpellChecker11qt_metacastEPKc
0000000000000000      D  *UND*  0000000000000000              _ZTV16QWebSpellChecker
0000000000000000      D  *UND*  0000000000000000              _ZN16QWebSpellChecker11qt_metacallEN11QMetaObject4CallEiPPv
0000000000000000      D  *UND*  0000000000000000              _ZN16QWebSpellChecker16staticMetaObjectE
0000000000006840 g    DF .text  0000000000000002  Base        _ZN10SpellCheck20checkGrammarOfStringERK7QStringR5QListIN16QWebSpellChecker13GrammarDetailEEPiS8_

From objdump(1):

Here the first number is the symbol's value (sometimes refered to as its
address). The next field is actually a set of characters and spaces
indicating the flag bits that are set on the symbol. These characters are
described below. Next is the section with which the symbol is associated or
ABS if the section is absolute (ie not connected with any section), or
UND if the section is referenced in the file being dumped, but not defined
there.
...

If I'm reading this correctly, the symbol is only used in the file, but not defined. Comparing with qupzilla's built-in spell-checker:

$ objdump -T /usr/lib/libQupZilla.so | grep -i spellchecker
00000000004a88f2 g    DF .text  0000000000000050  Base        _ZN16QWebSpellChecker11qt_metacastEPKc
00000000004a8942 g    DF .text  000000000000003f  Base        _ZN16QWebSpellChecker11qt_metacallEN11QMetaObject4CallEiPPv
00000000002619b2  w   DF .text  0000000000000032  Base        _ZN16QWebSpellCheckerC1Ev
0000000000831d50  w   DO .data.rel.ro   00000000000000c0  Base        _ZTV16QWebSpellChecker
00000000004a88aa g    DF .text  0000000000000048  Base        _ZNK16QWebSpellChecker10metaObjectEv
0000000000261816 g    DF .text  000000000000001b  Base        _ZN10SpellCheck20checkGrammarOfStringERK7QStringR5QListIN16QWebSpellChecker13GrammarDetailEEPiS8_
00000000002619b2  w   DF .text  0000000000000032  Base        _ZN16QWebSpellCheckerC2Ev
0000000000565a10  w   DO .rodata    0000000000000013  Base        _ZTS16QWebSpellChecker
00000000004a8a9e  w   DF .text  000000000000002b  Base        _ZN16QWebSpellCheckerD0Ev
0000000000831d20 g    DO .data.rel.ro   0000000000000030  Base        _ZN16QWebSpellChecker16staticMetaObjectE
00000000004a8a70  w   DF .text  000000000000002d  Base        _ZN16QWebSpellCheckerD1Ev
00000000004a8a70  w   DF .text  000000000000002d  Base        _ZN16QWebSpellCheckerD2Ev
0000000000832008  w   DO .data.rel.ro   0000000000000018  Base        _ZTI16QWebSpellChecker

so the symbol is correctly defined there. What does it look like on your side, @The-Compiler?

By the way, the -C flag can be used to demangle the C++ symbols:

$ objdump -TC /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so | grep -i spellchecker
0000000000000000      D  *UND*  0000000000000000              typeinfo for QWebSpellChecker
0000000000000000      D  *UND*  0000000000000000              QWebSpellChecker::qt_metacast(char const*)
0000000000000000      D  *UND*  0000000000000000              vtable for QWebSpellChecker
0000000000000000      D  *UND*  0000000000000000              QWebSpellChecker::qt_metacall(QMetaObject::Call, int, void**)
0000000000000000      D  *UND*  0000000000000000              QWebSpellChecker::staticMetaObject
0000000000006840 g    DF .text  0000000000000002  Base        SpellCheck::checkGrammarOfString(QString const&, QList<QWebSpellChecker::GrammarDetail>&, int*, int*)

so the missing symbol is typeinfo for QWebSpellChecker.

@lahwaacz lahwaacz referenced this issue in QupZilla/qtwebkit-plugins Jun 4, 2016

Open

Library vs bundle: unported changes? #8

@lahwaacz

This comment has been minimized.

Show comment
Hide comment
@lahwaacz

lahwaacz Jun 4, 2016

Collaborator

The most notable difference between qtwebkit-plugins-git and qupzilla-qtwebkit-git PKGBUILDs is the qmake-qt5 CONFIG+=debug command in the latter. QupZilla works without debug too, but qtwebkit-plugins does not work even with debug (basically the same error, just stops on different missing symbol).

There are differences between the spellcheck.{h,cpp} files used by qtwebkit-plugins and QupZilla (see QupZilla/qtwebkit-plugins#8), other than that I'm fairly clueless...

Collaborator

lahwaacz commented Jun 4, 2016

The most notable difference between qtwebkit-plugins-git and qupzilla-qtwebkit-git PKGBUILDs is the qmake-qt5 CONFIG+=debug command in the latter. QupZilla works without debug too, but qtwebkit-plugins does not work even with debug (basically the same error, just stops on different missing symbol).

There are differences between the spellcheck.{h,cpp} files used by qtwebkit-plugins and QupZilla (see QupZilla/qtwebkit-plugins#8), other than that I'm fairly clueless...

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Jun 4, 2016

Collaborator

I'd really expect qmake to be Qt5 on Arch always, qmake --version confirms that.

Collaborator

The-Compiler commented Jun 4, 2016

I'd really expect qmake to be Qt5 on Arch always, qmake --version confirms that.

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Jun 4, 2016

Collaborator

Sorry - missed the comment above. It seems indeed for me the symbols are defined there, not just referenced:

$ objdump -CT /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so | grep -i spellchecker
0000000000212790  w   DO .data.rel.ro   00000000000000c0  Base        vtable for QWebSpellChecker
000000000000ff00  w   DO .rodata    0000000000000013  Base        typeinfo name for QWebSpellChecker
000000000000cf90 g    DF .text  0000000000000018  Base        QWebSpellChecker::metaObject() const
0000000000212580  w   DO .data.rel.ro   0000000000000018  Base        typeinfo for QWebSpellChecker
000000000000d330 g    DF .text  000000000000005b  Base        QWebSpellChecker::qt_metacast(char const*)
000000000000d4b0 g    DF .text  0000000000000005  Base        QWebSpellChecker::qt_metacall(QMetaObject::Call, int, void**)
0000000000212860 g    DO .data.rel.ro   0000000000000030  Base        QWebSpellChecker::staticMetaObject
0000000000007d30 g    DF .text  0000000000000002  Base        SpellCheck::checkGrammarOfString(QString const&, QList<QWebSpellChecker::GrammarDetail>&, int*, int*)

And yeah, I'm using qt5-*-debug from my qt-debug repo. Not sure what in there would be different what'd cause qtwebkit-plugins to build incorrectly with Arch's normal Qt build...

Collaborator

The-Compiler commented Jun 4, 2016

Sorry - missed the comment above. It seems indeed for me the symbols are defined there, not just referenced:

$ objdump -CT /usr/lib/qt/plugins/webkit/libqtwebkitplugins.so | grep -i spellchecker
0000000000212790  w   DO .data.rel.ro   00000000000000c0  Base        vtable for QWebSpellChecker
000000000000ff00  w   DO .rodata    0000000000000013  Base        typeinfo name for QWebSpellChecker
000000000000cf90 g    DF .text  0000000000000018  Base        QWebSpellChecker::metaObject() const
0000000000212580  w   DO .data.rel.ro   0000000000000018  Base        typeinfo for QWebSpellChecker
000000000000d330 g    DF .text  000000000000005b  Base        QWebSpellChecker::qt_metacast(char const*)
000000000000d4b0 g    DF .text  0000000000000005  Base        QWebSpellChecker::qt_metacall(QMetaObject::Call, int, void**)
0000000000212860 g    DO .data.rel.ro   0000000000000030  Base        QWebSpellChecker::staticMetaObject
0000000000007d30 g    DF .text  0000000000000002  Base        SpellCheck::checkGrammarOfString(QString const&, QList<QWebSpellChecker::GrammarDetail>&, int*, int*)

And yeah, I'm using qt5-*-debug from my qt-debug repo. Not sure what in there would be different what'd cause qtwebkit-plugins to build incorrectly with Arch's normal Qt build...

@lahwaacz

This comment has been minimized.

Show comment
Hide comment
@lahwaacz

lahwaacz Jun 4, 2016

Collaborator

I'd really expect qmake to be Qt5 on Arch always, qmake --version confirms that.

By default, yes. But in Arch, qmake is a symlink to qtchooser, which is configurable (see qtchooser(1)). Not that it matters to this issue though.

Collaborator

lahwaacz commented Jun 4, 2016

I'd really expect qmake to be Qt5 on Arch always, qmake --version confirms that.

By default, yes. But in Arch, qmake is a symlink to qtchooser, which is configurable (see qtchooser(1)). Not that it matters to this issue though.

@raelgc

This comment has been minimized.

Show comment
Hide comment
@raelgc

raelgc Sep 16, 2016

Any luck on this? :)

raelgc commented Sep 16, 2016

Any luck on this? :)

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Sep 18, 2016

Collaborator

@raelgc On what exactly?

Collaborator

The-Compiler commented Sep 18, 2016

@raelgc On what exactly?

@raelgc

This comment has been minimized.

Show comment
Hide comment
@raelgc

raelgc Sep 18, 2016

Make the highlighting of misspelled words works in qt5 using the QupZilla/qtwebkit-plugins. I have the same problem on ScudCloud, but don't know how to solve it.

raelgc commented Sep 18, 2016

Make the highlighting of misspelled words works in qt5 using the QupZilla/qtwebkit-plugins. I have the same problem on ScudCloud, but don't know how to solve it.

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Sep 19, 2016

Collaborator

I don't either, as it works fine for me 😉

Collaborator

The-Compiler commented Sep 19, 2016

I don't either, as it works fine for me 😉

@pclewis

This comment has been minimized.

Show comment
Hide comment
@pclewis

pclewis Jan 24, 2017

Contributor

I ran into this same undefined symbol error on NixOS trying to get notifications to work, and fixed it by adding the qwebkitplatformplugin.h file to the HEADERS in src/src.pro of qtwebkit-plugins. I don't understand Qt well enough to know if this is a correct or advisable fix, but it's working for me. Seems like it might be an include path issue.

For NixOS in postPatch steps in qtwebkit-plugins/default.nix I added

sed -i "s,plugin.h,plugin.h ${qtwebkit.dev}/include/QtWebKit/qwebkitplatformplugin.h," src/src.pro  
Contributor

pclewis commented Jan 24, 2017

I ran into this same undefined symbol error on NixOS trying to get notifications to work, and fixed it by adding the qwebkitplatformplugin.h file to the HEADERS in src/src.pro of qtwebkit-plugins. I don't understand Qt well enough to know if this is a correct or advisable fix, but it's working for me. Seems like it might be an include path issue.

For NixOS in postPatch steps in qtwebkit-plugins/default.nix I added

sed -i "s,plugin.h,plugin.h ${qtwebkit.dev}/include/QtWebKit/qwebkitplatformplugin.h," src/src.pro  
@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Jan 25, 2017

Collaborator

Maybe @nowrep can tell us more about whether this sounds like a good fix or not 😉

Collaborator

The-Compiler commented Jan 25, 2017

Maybe @nowrep can tell us more about whether this sounds like a good fix or not 😉

@nowrep

This comment has been minimized.

Show comment
Hide comment
@lahwaacz

This comment has been minimized.

Show comment
Hide comment
@lahwaacz

lahwaacz Jan 29, 2017

Collaborator

QtWebEngine 5.8 is supposed to support "Spellchecking with Hunspell" - any chance to enable it in qutebrowser?

Collaborator

lahwaacz commented Jan 29, 2017

QtWebEngine 5.8 is supposed to support "Spellchecking with Hunspell" - any chance to enable it in qutebrowser?

@Carpetsmoker

This comment has been minimized.

Show comment
Hide comment
@Carpetsmoker

Carpetsmoker Mar 31, 2017

Contributor

Here's a basic example to use the WebEngine 5.8 API:

diff --git i/qutebrowser/browser/webengine/webenginesettings.py w/qutebrowser/browser/webengine/webenginesettings.py
index b029b4fd5..7aa208c70 100644
--- i/qutebrowser/browser/webengine/webenginesettings.py
+++ w/qutebrowser/browser/webengine/webenginesettings.py
@@ -278,6 +278,10 @@ MAPPINGS = {
     'ui': {
         'smooth-scrolling':
             Attribute(QWebEngineSettings.ScrollAnimatorEnabled),
+        'spell': ProfileSetter(getter='spellCheckEnabled',
+                               setter='setSpellCheckEnabled'),
+        'spell-languages': ProfileSetter(getter='spellCheckLanguages',
+                                         setter='setSpellCheckLanguages'),
     },
     'storage': {
         'local-storage':
diff --git i/qutebrowser/browser/webkit/webkitsettings.py w/qutebrowser/browser/webkit/webkitsettings.py
index caeef296f..c251ad5a0 100644
--- i/qutebrowser/browser/webkit/webkitsettings.py
+++ w/qutebrowser/browser/webkit/webkitsettings.py
@@ -230,6 +230,11 @@ MAPPINGS = {
         #   Attribute(QWebSettings.AcceleratedCompositingEnabled),
         #'tiled-backing-store':
         #   Attribute(QWebSettings.TiledBackingStoreEnabled),
+        # TODO: Give error; would be confusing otherwise.
+        # 'spell': ProfileSetter(getter='spellCheckEnabled',
+        #                        setter='setSpellCheckEnabled'),
+        # 'spell-languages': ProfileSetter(getter='spellCheckLanguages',
+        #                                  setter='setSpellCheckLanguages'),
     },
     'storage': {
         'offline-storage-database':
diff --git i/qutebrowser/config/configdata.py w/qutebrowser/config/configdata.py
index 1fbc22937..38f1a3ef2 100644
--- i/qutebrowser/config/configdata.py
+++ w/qutebrowser/config/configdata.py
@@ -418,6 +418,17 @@ def data(readonly=False):
              SettingValue(typ.Bool(), 'true'),
              "Show a filebrowser in upload/download prompts."),
 
+            # qwebengine_convert_dict /usr/share/hunspell/en_US.dic en_US.bdic
+            # https://doc.qt.io/qt-5/qml-qtwebengine-webengineprofile.html#spellCheckEnabled-prop
+            # http://doc.qt.io/qt-5/qtwebengine-webenginewidgets-spellchecker-example.html
+            ('spell',
+             SettingValue(typ.Bool(), 'true'),
+             "Enable spell checking; only works on QtWebEngine."),
+
+            ('spell-languages',
+             SettingValue(typ.List(typ.String(), none_ok=True), 'en_US'),
+             "Spell checking language; only works on QtWebEngine."),
+
             readonly=readonly
         )),

Since it uses its own dictionary format, you'll need to convert it from the Hunspell ones:

$ qwebengine_convert_dict /usr/share/hunspell/en_US.dic en_US.bdic

Qutebrowser should do this automatically, or we should provide some repository with those compiled files at least for common languages.
There's also some other work to be done, such as making sure that QtWebKit users get a friendly error, showing a more friendly error when the dictionary doesn't exist, and writing some tests for it.

I'm not going to work on this for now, as there are other thing I'd prefer to do first, but anyone is free to take the above code and run with it :-)

Related links:

Contributor

Carpetsmoker commented Mar 31, 2017

Here's a basic example to use the WebEngine 5.8 API:

diff --git i/qutebrowser/browser/webengine/webenginesettings.py w/qutebrowser/browser/webengine/webenginesettings.py
index b029b4fd5..7aa208c70 100644
--- i/qutebrowser/browser/webengine/webenginesettings.py
+++ w/qutebrowser/browser/webengine/webenginesettings.py
@@ -278,6 +278,10 @@ MAPPINGS = {
     'ui': {
         'smooth-scrolling':
             Attribute(QWebEngineSettings.ScrollAnimatorEnabled),
+        'spell': ProfileSetter(getter='spellCheckEnabled',
+                               setter='setSpellCheckEnabled'),
+        'spell-languages': ProfileSetter(getter='spellCheckLanguages',
+                                         setter='setSpellCheckLanguages'),
     },
     'storage': {
         'local-storage':
diff --git i/qutebrowser/browser/webkit/webkitsettings.py w/qutebrowser/browser/webkit/webkitsettings.py
index caeef296f..c251ad5a0 100644
--- i/qutebrowser/browser/webkit/webkitsettings.py
+++ w/qutebrowser/browser/webkit/webkitsettings.py
@@ -230,6 +230,11 @@ MAPPINGS = {
         #   Attribute(QWebSettings.AcceleratedCompositingEnabled),
         #'tiled-backing-store':
         #   Attribute(QWebSettings.TiledBackingStoreEnabled),
+        # TODO: Give error; would be confusing otherwise.
+        # 'spell': ProfileSetter(getter='spellCheckEnabled',
+        #                        setter='setSpellCheckEnabled'),
+        # 'spell-languages': ProfileSetter(getter='spellCheckLanguages',
+        #                                  setter='setSpellCheckLanguages'),
     },
     'storage': {
         'offline-storage-database':
diff --git i/qutebrowser/config/configdata.py w/qutebrowser/config/configdata.py
index 1fbc22937..38f1a3ef2 100644
--- i/qutebrowser/config/configdata.py
+++ w/qutebrowser/config/configdata.py
@@ -418,6 +418,17 @@ def data(readonly=False):
              SettingValue(typ.Bool(), 'true'),
              "Show a filebrowser in upload/download prompts."),
 
+            # qwebengine_convert_dict /usr/share/hunspell/en_US.dic en_US.bdic
+            # https://doc.qt.io/qt-5/qml-qtwebengine-webengineprofile.html#spellCheckEnabled-prop
+            # http://doc.qt.io/qt-5/qtwebengine-webenginewidgets-spellchecker-example.html
+            ('spell',
+             SettingValue(typ.Bool(), 'true'),
+             "Enable spell checking; only works on QtWebEngine."),
+
+            ('spell-languages',
+             SettingValue(typ.List(typ.String(), none_ok=True), 'en_US'),
+             "Spell checking language; only works on QtWebEngine."),
+
             readonly=readonly
         )),

Since it uses its own dictionary format, you'll need to convert it from the Hunspell ones:

$ qwebengine_convert_dict /usr/share/hunspell/en_US.dic en_US.bdic

Qutebrowser should do this automatically, or we should provide some repository with those compiled files at least for common languages.
There's also some other work to be done, such as making sure that QtWebKit users get a friendly error, showing a more friendly error when the dictionary doesn't exist, and writing some tests for it.

I'm not going to work on this for now, as there are other thing I'd prefer to do first, but anyone is free to take the above code and run with it :-)

Related links:

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Mar 31, 2017

Collaborator

Thanks for getting the ball rolling, @Carpetsmoker!

As for "making sure that QtWebKit users get a friendly error": Simply don't use it in webkitsettings.py and add backends=[usertypes.Backend.QtWebEngine] in SettingValue in configdata.py. This will also add a comment about it only working on QtWebEngine.

Collaborator

The-Compiler commented Mar 31, 2017

Thanks for getting the ball rolling, @Carpetsmoker!

As for "making sure that QtWebKit users get a friendly error": Simply don't use it in webkitsettings.py and add backends=[usertypes.Backend.QtWebEngine] in SettingValue in configdata.py. This will also add a comment about it only working on QtWebEngine.

@elshize

This comment has been minimized.

Show comment
Hide comment
@elshize

elshize Jul 30, 2017

Contributor

Hey, so I was thinking of pushing this thing forward. What do you think should be the proper way of handling dictionary conversion? An internal command, like "install-dict", that looks for dictionaries in hunspell directory? Where should we store the .bdic files?

Contributor

elshize commented Jul 30, 2017

Hey, so I was thinking of pushing this thing forward. What do you think should be the proper way of handling dictionary conversion? An internal command, like "install-dict", that looks for dictionaries in hunspell directory? Where should we store the .bdic files?

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Jul 31, 2017

Collaborator

First of all: Note that I won't have the time to review any contributions until September because I'm busy with exams, and I'll also merge the new-config branch then - so if you work on something now, you might need to rebase it and solve conflicts then.

I'm not really sure what's feasible here. The best way would indeed be to have some command to convert dictionaries, but it's probably non-trivial to do that in Python (see QtWebEngine's tool).

Maybe we could just read Chromium's dicts which (on Linux) are in ~/.config/chromium/Dictionaries by default?

Collaborator

The-Compiler commented Jul 31, 2017

First of all: Note that I won't have the time to review any contributions until September because I'm busy with exams, and I'll also merge the new-config branch then - so if you work on something now, you might need to rebase it and solve conflicts then.

I'm not really sure what's feasible here. The best way would indeed be to have some command to convert dictionaries, but it's probably non-trivial to do that in Python (see QtWebEngine's tool).

Maybe we could just read Chromium's dicts which (on Linux) are in ~/.config/chromium/Dictionaries by default?

@elshize

This comment has been minimized.

Show comment
Hide comment
@elshize

elshize Jul 31, 2017

Contributor

About the review, that's totally fine, I'm quite busy myself so probably it will take me some time anyway. I just noticed this thing has been hanging here for a long time, so it's about time someone made it happen. Enabling spell check is straightforward enough, it's the dictionaries that are the issue.

I'll spend some time figuring out how to best approach it, and will get back to you.

Contributor

elshize commented Jul 31, 2017

About the review, that's totally fine, I'm quite busy myself so probably it will take me some time anyway. I just noticed this thing has been hanging here for a long time, so it's about time someone made it happen. Enabling spell check is straightforward enough, it's the dictionaries that are the issue.

I'll spend some time figuring out how to best approach it, and will get back to you.

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Jul 31, 2017

Collaborator

I just opened QTBUG-62236 FWIW - I think QtWebEngine should handle this by loading Chromium's dictionaries.

Also, at least according to the docs the current paths where dictionaries are searched are very cumbersome, at least for typical system-wide qutebrowser/Qt installations on Linux...

FWIW I did a quick test and could get spell-checking to work in QtWebEngine with sudo ln -s /home/florian/.config/chromium/Dictionaries /usr/bin/qtwebengine_dictionaries and then this in :debug-console:

>>> profile = QWebEngineProfile.defaultProfile()
>>> profile.setSpellCheckEnabled(True)
>>> profile.setSpellCheckLanguages(["en-US-7-1"])

Not sure what the -7-1 means, but the file I had in /home/florian/.config/chromium/Dictionaries is en-US-7-1.bdic.

This is all less than optimal, but I guess the best we can do right now is to add an option to set the languages (or even figure them out by ourselves), and document what to do to get things working (create that symlink on Linux, not sure about macOS and Windows).

Collaborator

The-Compiler commented Jul 31, 2017

I just opened QTBUG-62236 FWIW - I think QtWebEngine should handle this by loading Chromium's dictionaries.

Also, at least according to the docs the current paths where dictionaries are searched are very cumbersome, at least for typical system-wide qutebrowser/Qt installations on Linux...

FWIW I did a quick test and could get spell-checking to work in QtWebEngine with sudo ln -s /home/florian/.config/chromium/Dictionaries /usr/bin/qtwebengine_dictionaries and then this in :debug-console:

>>> profile = QWebEngineProfile.defaultProfile()
>>> profile.setSpellCheckEnabled(True)
>>> profile.setSpellCheckLanguages(["en-US-7-1"])

Not sure what the -7-1 means, but the file I had in /home/florian/.config/chromium/Dictionaries is en-US-7-1.bdic.

This is all less than optimal, but I guess the best we can do right now is to add an option to set the languages (or even figure them out by ourselves), and document what to do to get things working (create that symlink on Linux, not sure about macOS and Windows).

@parchd-1

This comment has been minimized.

Show comment
Hide comment
@parchd-1

parchd-1 Aug 1, 2017

I know you will already have considered this, but I'll put it on the record: not everyone who would like to use spell-checking has or wants Chromium installed.

parchd-1 commented Aug 1, 2017

I know you will already have considered this, but I'll put it on the record: not everyone who would like to use spell-checking has or wants Chromium installed.

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Aug 1, 2017

Collaborator

Sure - you could still always download Hunspell dictionaries, merge them using QtWebEngine's convert_dict tool, and use that. But using Chromium's dictionaries would be a nice way to make it work "automatically".

Collaborator

The-Compiler commented Aug 1, 2017

Sure - you could still always download Hunspell dictionaries, merge them using QtWebEngine's convert_dict tool, and use that. But using Chromium's dictionaries would be a nice way to make it work "automatically".

@parchd-1

This comment has been minimized.

Show comment
Hide comment
@parchd-1

parchd-1 Aug 1, 2017

True. Apparently (just been poking about) the dictionaries can also be found here, so just grabbing a single dictionary is also possible.

parchd-1 commented Aug 1, 2017

True. Apparently (just been poking about) the dictionaries can also be found here, so just grabbing a single dictionary is also possible.

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Aug 1, 2017

Collaborator

Ah, nice! This is before Chromium switched to git though. I think this page is the most up-to-date source for them.

Collaborator

The-Compiler commented Aug 1, 2017

Ah, nice! This is before Chromium switched to git though. I think this page is the most up-to-date source for them.

@parchd-1

This comment has been minimized.

Show comment
Hide comment
@parchd-1

parchd-1 Aug 1, 2017

I thought the dates seemed a bit too old!

parchd-1 commented Aug 1, 2017

I thought the dates seemed a bit too old!

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Aug 1, 2017

Collaborator

So I couldn't resist and submitted a change to Qt adding a QTWEBENGINE_DICTIONARIES_DIR environment variable to customize the location to something more sane: https://codereview.qt-project.org/#/c/201422/

Hopefully will made it into Qt 5.10.

Collaborator

The-Compiler commented Aug 1, 2017

So I couldn't resist and submitted a change to Qt adding a QTWEBENGINE_DICTIONARIES_DIR environment variable to customize the location to something more sane: https://codereview.qt-project.org/#/c/201422/

Hopefully will made it into Qt 5.10.

@michal-blippar

This comment has been minimized.

Show comment
Hide comment
@michal-blippar

michal-blippar Aug 1, 2017

That's a good catch with dictionaries in the repository. I think it makes the most sense to use these. I can work on a command installing it locally this weekend. Do you guys think we should maintain a list of possible languages to install? (then one could choose one from the list if not sure what the name is)

That's a good catch with dictionaries in the repository. I think it makes the most sense to use these. I can work on a command installing it locally this weekend. Do you guys think we should maintain a list of possible languages to install? (then one could choose one from the list if not sure what the name is)

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Aug 1, 2017

Collaborator

A qutebrowser command for it won't work, as the dictionaries need to be in a location like /usr/share/qt/qtwebengine_dictionaries, and I don't want to encourage people to run qutebrowser as root.

However, a standalone commandline script would be very nice. It'd ideally get the file list from the repository (dunno if there's an API for the file list - the links at the bottom right get the commit only, or maybe using the GitHub mirror and API). Then it could offer a list of dictionaries to download, and download them to the right location.

With Qt 5.10, we can then revisit this and implement some logic to read Chromium's dictionaries if available.

Collaborator

The-Compiler commented Aug 1, 2017

A qutebrowser command for it won't work, as the dictionaries need to be in a location like /usr/share/qt/qtwebengine_dictionaries, and I don't want to encourage people to run qutebrowser as root.

However, a standalone commandline script would be very nice. It'd ideally get the file list from the repository (dunno if there's an API for the file list - the links at the bottom right get the commit only, or maybe using the GitHub mirror and API). Then it could offer a list of dictionaries to download, and download them to the right location.

With Qt 5.10, we can then revisit this and implement some logic to read Chromium's dictionaries if available.

@elshize

This comment has been minimized.

Show comment
Hide comment
@elshize

elshize Aug 1, 2017

Contributor

(sorry, I used a different account for the post above by accident)
Right, I'll look into this.

Contributor

elshize commented Aug 1, 2017

(sorry, I used a different account for the post above by accident)
Right, I'll look into this.

@The-Compiler

This comment has been minimized.

Show comment
Hide comment
@The-Compiler

The-Compiler Aug 5, 2017

Collaborator

Quick update: Qt 5.10 will have a QTWEBENGINE_DICTIONARIES_PATH environment variable.

Collaborator

The-Compiler commented Aug 5, 2017

Quick update: Qt 5.10 will have a QTWEBENGINE_DICTIONARIES_PATH environment variable.

@elshize

This comment has been minimized.

Show comment
Hide comment
@elshize

elshize Aug 6, 2017

Contributor

It's not exactly ready yet, but mostly working. I created a pull request in case someone has some time to take a look. I'll get back to it next or the following weekend.

Contributor

elshize commented Aug 6, 2017

It's not exactly ready yet, but mostly working. I created a pull request in case someone has some time to take a look. I'll get back to it next or the following weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment