badai.xyz
A hacky way to install custom dictionaries on desktop onlyoffice
Onlyoffice is an alternative to Microsoft Office and to LibreOffice. While it’s not as feature-rich as MS Office or LibreOffice, it has advantages over both options. It’s better than MS Office in terms of platform support and price as it’s possible to use onlyoffice free of charge. Libreoffice is also free of charge and free software. It also supports widely different platforms, but there is one thing where onlyoffice is light years away from LibreOffice. It’s stability, and I’m talking specifically about the writer software that both suites offer. This is at least the case when you are working with docx files. Crashes and inconsistent are a regular occurrence and make LibreOffice writer unusable.
And now to the topic of this article: installing custom dictionaries to desktop onlyoffice. As of writing, this article onlyoffice doesn’t have a very wide range of dictionaries available. And there is no official way to add dictionaries on the desktop. Even lack of this functionality it’s possible to use custom dictionaries. It’s very hacky and inconvenient as it’s done by replacing existing dictionaries with the desired custom dictionary.
The following steps work for Arch Linux. Other distributions should be about the same but may differ.
Obviously first, you’ll need the dictionary you want to install. The dictionary must be compatible with Hunspell and its encoding must be UTF-8. I’ll be using in this example Finnish dictionary from https://gitlab.com/4shadoww/hunspell-fi.
Select a language that does have spell checking and you don’t need. The language you select should have only one “.dic” file. So no hyphenation dictionaries if you don’t have one to replace it with.
Onlyoffice installation is located in “/opt/” on Arch Linux. Find then the selected dictionary’s location. In this case, it would be “/opt/onlyoffice/desktopeditors/dictionaries/az_Latn_AZ/”.
Make backups of the dictionaries that will be replaced, if you think you might change your mind later. You can also restore those files by reinstalling the package later.
$ cp az_Latn_AZ.dic az_Latn_AZ.dic.bak $ cp az_Latn_AZ.aff az_Latn_AZ.aff.bak
Last step is to copy the custom dictionaries.
$ cp ~/git/hunspell-fi/fi_FI.dic az_Latn_AZ.dic $ cp ~/git/hunspell-fi/fi_FI.aff az_Latn_AZ.aff
That’s all about it! Now you should have working spell checking which uses the new dictionaries.
After finishing editing, you’ll have to change every time the language back to the real language, if you want it to be saved as the language of the document.