system-wide location for dictionary files and dictionary file name format

Caolán McNamara caolanm at redhat.com
Mon Feb 13 09:31:04 UTC 2017


On Mon, 2017-02-13 at 09:51 +0100, Stephan Bergmann wrote:
> Any LO extension .oxt file (not just those relating to dictionaries)
> can be installed in one of three ways, per user, "shared", or
> "bundled".
> 
> To install shared, run LO's 'unopkg --shared add ...' for installing 
> that extension.
> 
> To install bundled, unzip the .oxt into a sub-dir of LO's 
> share/extensions/ dir.

For dictionaries (and hyphenation patterns and thesaurus things) under
linux we also check for system installed ones. This is DICT_SYSTEM_DIR
in configure.ac and lingucomponent/source/lingutil/lingutil.cxx.

wrt the dir that's checked: initially hunspell was derived from myspell
so dictionaries tended to be installed in /usr/share/myspell when this
got first cooked up (and this is where they still are in fedora,
because at one stage at least having rpms change the directory they
installed into was a nightmare so it got "stuck" there) while now
dictionaries tend to be installed in /usr/share/hunspell on other
distros (with some distros trying to put old style ones in myspell and
new ones in hunspell for a while at least)

wrt the naming scheme, in some distros myspell, thesaurus, hyphenation
patterns and READMEs were all dumped in the same dir, so hyphenation
patterns are the one that start with hyph_ and end with .dic, thesaurus
start with th_ and end with _v2.dat, while spelling ones just end in
.dic. The rest of the file name has _ converted to - and the resulting
string is assume to be a bcp47 tag, typically the string is just
something like en-IE or de-DE

So for the original question, the answer for installing system wide
dictionaries at a distro level is probably to put the .dic and .aff
into /usr/share/hunspell and it'll "just work". Special variants need
to be named in a bcp47 format to have a chance of getting picked up
right, but that's a lesser used codepath so mileage many vary.

C.


More information about the LibreOffice mailing list