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

I would like to find information about a couple of things related to
dictionaries. The context is LibreOffice 5.2 on Linux.

  • Where are dictionary files stored when installed system-wide (so not
    user-specific)? In my Linux distribution (Gentoo), LibreOffice looks in
    the /usr/share/myspell directory and there picks up dictionaries named
    xx_YY, but not others, such as xx or xx-zzzzz.

  • Given that oxt extension files dictionaries are typically made
    available as contain dictionaries.xml and dictionaries.xcu files that
    seem to be used by LibreOffice to correctly label them and associate
    locales with, where should these files be put if the dictionaries are
    installed system-wide? I’ve seen that user-specific, they are apparently
    put in (for me) in locations such as
    $HOME/.config/libreoffice/4/user/extensions/tmp/extensions/lu32329umnj1w.tmp_/some.oxt/,
    which does not give an indication where they should be put system-wide.

  • What files are effectively required by LibreOffice for proper
    functioning dictionaries. I know that putting xx_YY.aff and xx_YY.dic
    files and such in /usr/share/myspell makes them available, but I have
    the impression that this in an incomplete way, and that, e.g., the xcu
    and xml files should be made available as well. Is this true and are
    there others?

  • Can dictionaries of the form xx or xx-zzzzz be used by LibreOffice, or
    is a _YY region identifier really needed?

(I have also posted this question to user@global.libreoffice.org, but the subscribers seem mostly users and not people that have a detailed understanding of the installation structure. In case that is similar here: where can I get the info I am looking for?)

If I correctly understand your intention, what you need is installing the respective language pack. It will make the respective dictionary available system-wide. Obviously, you can only install a dictionary from the respective RPM or DEB package. I do not know, however, how it works with Gentoo.

Actually, I want to ‘package’ dictionary packs for use in Gentoo (not only for LO, but also other hunspell/myspell ‘clients’). Currently only the dic, aff, idx, and dat files are installed. This results in a sub-optimal experience within LO, which I want to improve. So my question is really as stated and should not be interpreted as a user who wants to install a package. (I would be the person creating those packages.)

I see. Well, as for the last two points in your original post: in my experience, file names can be arbitrary, no real need in those _YY, but that is why you need an .xcu file that specifies both the file names and their mapping to a particular locale.