Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Dutch spellcheck in LibreOffice
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 323

PostPosted: Thu Oct 10, 2019 1:09 pm    Post subject: Dutch spellcheck in LibreOffice Reply with quote

Hi All,

I'm using LibreOffice (recently updated to app-office/libreoffice-6.2.5.2), and i lost Dutch spellcheck some time ago and can't get it working again.
The spellcheck itself works fine for English, it's just Dutch (and may other languages that i don't care about) that doesn't work anymore.

I think part of the problem is that i get redirected to this site for dictionaries:
https://extensions.libreoffice.org/extensions?getCategories=Dictionary&getCompatibility=any
... and it doesn't contain any Dutch dictionary like it used to do.

During my searches on the interwebs i found some references to myspell-nl and i have it installed:
Code:

~ $ emerge -pvt libreoffice hunspell myspell-nl

These are the packages that would be merged, in reverse order:

Calculating dependencies... done!
[ebuild   R    ] app-office/libreoffice-6.2.5.2::gentoo  USE="bluetooth branding cups dbus gtk mariadb pdfimport vlc -accessibility (-coinmp) -debug -eds (-firebird) -googledrive -gstreamer -gtk2 -java -kde -ldap -odk -postgres -test" LIBREOFFICE_EXTENSIONS="-nlpsolver -scripting-beanshell -scripting-javascript -wiki-publisher" PYTHON_SINGLE_TARGET="python3_6 -python2_7 -python3_5 (-python3_7)" PYTHON_TARGETS="python2_7 python3_6 -python3_5 (-python3_7)" 0 KiB
[ebuild   R    ]  app-text/hunspell-1.6.2-r1:0/1.6::gentoo  USE="ncurses nls readline -static-libs" L10N="en nl -af -bg -ca -cs -cy -da -de -de-1901 -el -eo -es -et -fo -fr -ga -gl -he -hr -hu -ia -id -is -it -kk -km -ku -lt -lv -mi -mk -ms -nb -nn -pl -pt -pt-BR -ro -ru -sk -sl -sq -sv -sw -tn -uk -zu" 0 KiB
[ebuild   R    ]   app-dicts/myspell-nl-2.10g-r1::gentoo  0 KiB

Total: 3 packages (3 reinstalls), Size of downloads: 0 KiB

Do you have any suggestions on how to solve this?

Thanks in advance.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1774
Location: United Kingdom

PostPosted: Thu Oct 10, 2019 1:37 pm    Post subject: Reply with quote

Try installing hunspell (with USE="nl") which is what LibreOffice uses these days instead of myspell, if I recall correctly.

If that does not work, install the LanguageTool grammar, style and spell checker for LibreOffice, which you can find at:

https://www.languagetool.org/#libreoffice

Click on the button to download the add-on for LibreOffice, or just use the following link for V4.7:

https://www.languagetool.org/download/LanguageTool-4.7.oxt

"Use Tools → Extension Manager → Add… in LibreOffice/OpenOffice to install this file. Then restart LibreOffice/OpenOffice (including quickstarter)."
_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 323

PostPosted: Thu Oct 10, 2019 1:55 pm    Post subject: Reply with quote

Thanks for your suggestions Fitzcarraldo.

I do have hunspell installed (see the output in my first post), and as far as I can see the USE flags are correct.
I've tried the LanguageTool and it doesn't work at all for me. Probably because it needs oracle java and I have Icedtea installed and don't want to change.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 323

PostPosted: Thu Oct 10, 2019 2:11 pm    Post subject: Reply with quote

In the mean time i have found a solution, I'm it posting here and hope it might help someone with similar problems.

In one of my searches this page came up:
https://wiki.documentfoundation.org/Language_support_of_LibreOffice

And for the Dutch language it points to this website:
https://extensions.openoffice.org/en/project/dutch-spelling-and-hyphenation-dictionary
I guess i didn't find it earlier because it's listed as an openoffice extension, not libreoffice.

I installed the extension and now it works \o/
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1774
Location: United Kingdom

PostPosted: Thu Oct 10, 2019 5:04 pm    Post subject: Reply with quote

Now I'm curious, because I don't understand why you would need to install an OpenOffice extension dating from 2008 ("This extension was not updated recently. It might not work with latest versions of OpenOffice.") to be able to check spelling when hunspell (with USE="nl") should work in LibreOffice. If you have got both libreoffice-l10n and hunspell installed with USE="nl", what is selected under Options > Language Settings > Writing Aids? https://i.imgur.com/LVtniz1l.png
_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 323

PostPosted: Thu Oct 10, 2019 9:10 pm    Post subject: Reply with quote

It lists Hunspell, libhyphen and MyThes as language modules. If i click hunspell and click edit, i get a new dialog with a pulldown menu with languages.
If I enable the extension Dutch is listed there, otherwise it isn't. What is listed (also when i disable the extension) is "{nl}", could that be the source of the problem?

Edit:
This got me on the right track. Apparently LibreOffice uses the file names under /usr/share/myspell to determine the language name. The English dictionaries are installed as en_US.dic (etc), where the Dutch one is installed as just nl.dic. I made some symlinks:
Code:

lrwxrwxrwx 1 root root 12 Oct 10 23:16 th_nl_NL_v2.dat -> th_nl_v2.dat
lrwxrwxrwx 1 root root 12 Oct 10 23:16 th_nl_NL_v2.idx -> th_nl_v2.idx
lrwxrwxrwx 1 root root  6 Oct 10 23:14 nl_NL.aff -> nl.aff
lrwxrwxrwx 1 root root  6 Oct 10 23:14 nl_NL.dic -> nl.dic
lrwxrwxrwx 1 root root 11 Oct 10 23:15 hyph_nl_NL.dic -> hyph_nl.dic

Now LibreOffice shows the Dutch language with spellcheck, Hyphenation and Thesaurus capabilities.

The symlinks are a nice workaround for now, but i think this should be solved in the myspell-nl ebuild, what do you think?

Another edit:
The ebuild actually does rename the files:
Code:

src_prepare() {
        default
        # Fix regions, bug #607080
        mv nl_NL.aff nl.aff || die
        mv nl_NL.dic nl.dic || die
        mv hyph_nl_NL.dic hyph_nl.dic || die

        # remove dutch translated license so it aint installed
        rm -rf licentie* || die
}

This is bug 607080: https://bugs.gentoo.org/607080
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
mike155
Veteran
Veteran


Joined: 17 Sep 2010
Posts: 1730
Location: Frankfurt, Germany

PostPosted: Thu Oct 10, 2019 10:15 pm    Post subject: Reply with quote

I remember that we had a similar problem with the German dictionaries in 2011 and 2012. I also used symlinks as a workaround. After a while, the myspell-de ebuild was improved. Since then, German dictionaries have worked perfectly fine :-)

See: https://forums.gentoo.org/viewtopic-t-962828.html (in German, unfortunately)
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1774
Location: United Kingdom

PostPosted: Fri Oct 11, 2019 8:52 am    Post subject: Reply with quote

pa4wdh wrote:
The ebuild actually does rename the files:
Code:

src_prepare() {
        default
        # Fix regions, bug #607080
        mv nl_NL.aff nl.aff || die
        mv nl_NL.dic nl.dic || die
        mv hyph_nl_NL.dic hyph_nl.dic || die

        # remove dutch translated license so it aint installed
        rm -rf licentie* || die
}

This is bug 607080: https://bugs.gentoo.org/607080

So do you need to add a comment to that bug report explaining that the ebuild should not rename the files? Or would it be better for you to create a new bug report? Actually, thinking about it, perhaps the ebuild should copy the files rather than moving them. Also, you mentioned files in the /usr/share/myspell/ directory, but what about the files in /usr/share/hunspell/ directory? That also contains dictionary and thesaurus files, doesn't it?
_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 323

PostPosted: Fri Oct 11, 2019 11:52 am    Post subject: Reply with quote

mike155 wrote:
I remember that we had a similar problem with the German dictionaries in 2011 and 2012. I also used symlinks as a workaround. After a while, the myspell-de ebuild was improved. Since then, German dictionaries have worked perfectly fine :-)

See: https://forums.gentoo.org/viewtopic-t-962828.html (in German, unfortunately)

I can read German (a bit :D ), so thanks. It indeed is a similar problem to the one i have.

Quote:

So do you need to add a comment to that bug report explaining that the ebuild should not rename the files? Or would it be better for you to create a new bug report?

I don't really know. Since this bug is closed i think maybe a new one is better?

Quote:

Actually, thinking about it, perhaps the ebuild should copy the files rather than moving them. Also, you mentioned files in the /usr/share/myspell/ directory, but what about the files in /usr/share/hunspell/ directory? That also contains dictionary and thesaurus files, doesn't it?

Actually the /usr/share/myspell directory is full of symlinks to /usr/share/hunspell, /usr/share/mythes and /usr/share/hyphen. The files downloaded by the ebuild (actually libreoffice extensions) just contain the nl_NL.dic and nl_NL.aff files without a specific location, so i guess all the locations and symlinks are determined by the myspell-r2 class inherited by the ebuild.

From reading the referenced bug i get the impression that maybe "nl" is the "politically correct" way of doing things, but technically the applications are expecting nl_NL (for the Netherlands) and nl_BE (for Belgium). Is there actually any application that benefits from having just nl?
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
Fitzcarraldo
Veteran
Veteran


Joined: 30 Aug 2008
Posts: 1774
Location: United Kingdom

PostPosted: Fri Oct 11, 2019 12:47 pm    Post subject: Reply with quote

pa4wdh wrote:
Fitzcarraldo wrote:
So do you need to add a comment to that bug report explaining that the ebuild should not rename the files? Or would it be better for you to create a new bug report?


I don't really know. Since this bug is closed i think maybe a new one is better?

Sounds reasonable. You could reference the old bug in the new bug.


pa4wdh wrote:
From reading the referenced bug i get the impression that maybe "nl" is the "politically correct" way of doing things, but technically the applications are expecting nl_NL (for the Netherlands) and nl_BE (for Belgium).

Actually I don't think that just 'nl' is the 'politically correct' way, because the i18n standard covers language and region, which makes sense to me:

Code:
$ grep  "^nl" /usr/share/i18n/SUPPORTED
nl_AW UTF-8
nl_BE.UTF-8 UTF-8
nl_BE ISO-8859-1
nl_BE@euro ISO-8859-15
nl_NL.UTF-8 UTF-8
nl_NL ISO-8859-1
nl_NL@euro ISO-8859-15


pa4wdh wrote:
Is there actually any application that benefits from having just nl?

I don't know, as I don't use the Dutch language in any applications. But as far as I can tell, the standard is not just 'nl', in the same way that it isn't e.g. just 'en' for English either:

Code:
$ grep  "^en" /usr/share/i18n/SUPPORTED 
en_AG UTF-8
en_AU.UTF-8 UTF-8
en_AU ISO-8859-1
en_BW.UTF-8 UTF-8
en_BW ISO-8859-1
en_CA.UTF-8 UTF-8
en_CA ISO-8859-1
en_DK.UTF-8 UTF-8
en_DK ISO-8859-1
en_GB.UTF-8 UTF-8
en_GB ISO-8859-1
en_HK.UTF-8 UTF-8
en_HK ISO-8859-1
en_IE.UTF-8 UTF-8
en_IE ISO-8859-1
en_IE@euro ISO-8859-15
en_IL UTF-8
en_IN UTF-8
en_NG UTF-8
en_NZ.UTF-8 UTF-8
en_NZ ISO-8859-1
en_PH.UTF-8 UTF-8
en_PH ISO-8859-1
en_SC.UTF-8 UTF-8
en_SG.UTF-8 UTF-8
en_SG ISO-8859-1
en_US.UTF-8 UTF-8
en_US ISO-8859-1
en_ZA.UTF-8 UTF-8
en_ZA ISO-8859-1
en_ZM UTF-8
en_ZW.UTF-8 UTF-8
en_ZW ISO-8859-1

Code:
$ ls -1 /usr/share/hunspell/en
ls: cannot access '/usr/share/hunspell/en': No such file or directory
$ ls -1 /usr/share/hunspell/en*
/usr/share/hunspell/en_AU.aff
/usr/share/hunspell/en_AU.dic
/usr/share/hunspell/en_CA.aff
/usr/share/hunspell/en_CA.dic
/usr/share/hunspell/en_GB.aff
/usr/share/hunspell/en_GB.dic
/usr/share/hunspell/en_US.aff
/usr/share/hunspell/en_US.dic
/usr/share/hunspell/en_ZA.aff
/usr/share/hunspell/en_ZA.dic

I think the Gentoo ebuild maintainer should have left the installed files as they were. Or at least copied the files, not moved them. The files had the '_NL' suffix for a reason, as you found out.
_________________
Clevo W230SS: amd64 nvidia-drivers & xf86-video-intel.
Compal NBLB2: ~amd64 xf86-video-ati. Dual boot Win 7 Pro 64-bit.
OpenRC eudev elogind & KDE on both.

Fitzcarraldo's blog
Back to top
View user's profile Send private message
pa4wdh
Guru
Guru


Joined: 16 Dec 2005
Posts: 323

PostPosted: Fri Oct 11, 2019 5:47 pm    Post subject: Reply with quote

Thanks for your analysis, it looks solid.

To see what's needed i created my own small overlay with just a modified ebuild myspell-nl, for those interested, this is the ebuild:
Code:

# Copyright 1999-2019 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=7

MYSPELL_DICT=(
   "nl_NL.aff"
   "nl_NL.dic"
)

MYSPELL_HYPH=(
   "hyph_nl_NL.dic"
)

MYSPELL_THES=(
   "th_nl_NL_v2.dat"
   "th_nl_NL_v2.idx"
)

inherit myspell-r2

DESCRIPTION="Dutch dictionaries for myspell/hunspell"
HOMEPAGE="https://www.opentaal.org"
# Thesarus is not versioned at all, I suppose we could bump it with each dict
# release, or when people say that the download uri checksum changed.
SRC_URI="
   https://www.opentaal.org/bestanden/license_result/20-woordenlijst-v-${PV//./}-voor-openofficeorg-3?bid=20&agree=1 -> ${P}.oxt
   https://data.opentaal.org/opentaalbank/thesaurus/download/thes_nl.oxt -> ${P}_thes.oxt
"

LICENSE="BSD-2 CC-BY-3.0"
SLOT="0"
KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd"
IUSE=""

src_prepare() {
   default

   # Thesaurus files are named just nl instead of nl_NL
   mv th_nl_v2.dat th_nl_NL_v2.dat
   mv th_nl_v2.idx th_nl_NL_v2.idx

   # remove dutch translated license so it aint installed
   rm -rf licentie* || die
}

This may also give a hint on what started this all: The original dictionary is called nl_NL, the original thesaurus file uses just nl, so either one has to be renamed. For completeness nl_BE and nl_AW may also need to be added, or maybe controlled by use flags just like the regions in myspell-en.
_________________
The gentoo way of bringing peace to the world:
USE="-war" emerge --newuse @world

Free as in Freedom is not limited to software only:
Music: http://www.jamendo.com
Recipes: http://www.opensourcefood.com
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum