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

Eike Rathke erack at redhat.com
Thu Feb 16 15:49:51 UTC 2017


Hi Khaled,

On Wednesday, 2017-02-15 15:35:59 +0200, Khaled Hosny wrote:

> On Wed, Feb 15, 2017 at 12:42:22PM +0000, Caolán McNamara wrote:
> > > Hmm, it seems language tags such as ‘nl’ or ‘fr’ without a region
> > > component, and which are valid according to bcp47 are not recognized
> > > by LO. Is this a bug I should report?
> > 
> > Only if you intend to work on solving it, is my opinion. It would be
> > nice to support a bare "language" dictionary and have it in use for all
> > variants unless there are more specific variants to use, but I don't
> > intend to do it myself, or think my way through hacking firefox,
> > enchant and the rest of the things that parse filenames in
> > /usr/share/myspell|hunspell to also support that.
> 
> Firefox has no problem using ar.{aff,dic} for Arabic, neither does
> gtkspell (or whatever GTK+ apps use). Only LibreOffice (and OpenOffice
> before it) has problem using such dictionaries, and it turn packagers
> duplicates the dictionary files to support LibreOffice e.g. the
> hunspell-ar package on Debian has tens of ar_XX.{aff,dic} symlinks just
> because of this.
> 
> This has long annoyed me, and I might give it a try if there are some
> code pointers.

Hum.. that might be related to how a language is mapped to a default
locale if there exists one with a country designator. It all happens in
i18nlangtag/source/languagetag/languagetag.cxx and
i18nlangtag/source/isolang/mslangid.cxx (where in the latter the tables
of known locales are).

However, there's LanguageTag::getFallbackStrings(), which using and
comparing against available dictionaries should work, and
LanguageTag::makeFallback() that returns a *known* *locale* (plus
getFallback() and getMatchingFallback() for different situations) which
currently may be used in the dictionary context but instead
getFallbackStrings() should be used. Try to grep for those.
If stuck ping me ;-)

  Eike

-- 
LibreOffice Calc developer. Number formatter stricken i18n transpositionizer.
GPG key "ID" 0x65632D3A - 2265 D7F3 A7B0 95CC 3918  630B 6A6C D5B7 6563 2D3A
Better use 64-bit 0x6A6CD5B765632D3A here is why: https://evil32.com/
Care about Free Software, support the FSFE https://fsfe.org/support/?erack
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20170216/cb8f06de/attachment.sig>


More information about the LibreOffice mailing list