Installing Finnish language spell checking inside the docker image

Hi.

I have installed CODE in a docker image and successfully hooked it up to Nextcloud. I would like it to provide Finnish language spellcheck, but it is not supported by libreoffice via the typical dictionaries (for what I believe to be grammatical reasons). I found the way to add normal dictionaries to the docker image with parameters of the format -e 'dictionaries=de en es ..'. This does not work for Finnish, however.

Finnish spellcheck depends on the Voikko project, which is available for Ubuntu (which I believe the image to be) via the libreoffice-voikko package, the installation of which sets up (tested today in a Xubuntu vm) everything necessary with at least Libreoffice and the desktop install.

Is there an elegant way to add this package to the docker image (such as it is from docker hub, in all its auto-updating glory), or do I need to fork the docker files and add it in manually? (Thus having to worry about future breakage) Is there some other elegant way to get Finnish spellcheck to work?

Thanks in advance.

Edit: would docker layers be an elegant way to do this?

Edit2: I tried with this small Dockerfile

FROM collabora/code:latest
USER root
RUN apt update
RUN apt install libreoffice-voikko -y
USER lool
RUN whoami

This seems to run all the way, including the whoami command. libreoffice-voikko seems to install correctly, and to correctly hook up with Nextcloud when started with

docker run -t -d -p 9980:9980 --restart always -e "domain=<my nextcloud domain>|<my collabora domain>" -e "extra_params=--o:ssl.enable=false --o:ssl.termination=true" <hash of the docker>

No sign of a Finnish dictionary though, with or without -e "dictionaries=fi".

I’ve been inspecting the ubuntu package for libreoffice-voikko and it seems to copy voikko’s files to /usr/lib/libreoffice/share/extensions/ which doesn’t exist in the docker file as is. I tried soft linking (and hard copying) those files to /opt/collaboraoffice6.4/share/extensions/, which exists and seemed similar. This didn’t seem to work.

Where should one put extensions with CODE?

Hello @fsmnarmosta and sorry for taking so long to answer, it somehow slipped away. I would assume that maybe the directory you are searching is /usr/share/hunspell or /usr/share/mythes

Could you please confirm this @andras.timar ?

Thanks for taking the time to read this.

At least the hunspell directory seems unlikely to work as voikko is - to my knowledge - a completely separate piece of software.

spellchecking in Libreoffice is done via hunspell. There is no hunspell-fi, you might try to use
RUN apt install voikko-fi instead of the libreoffice* package. Didn’t try it myself though. You might need to tweak other configuration options along the usage hunspell in LO.

1 Like

I have the same problem, trying to get the Finnish dictionary into CODE.
voikko-fi is part of the libreoffice-voikko already.

As far as I can see, the problem is that CODE takes the languages from hunspell, but unfortunately there is no hunspell translation for Finnish. Since voikko is, as @fsmnarmosta said, a separate software, I wonder if and how it is possible to load voikko additionally to hunspell.