summaryrefslogtreecommitdiff
path: root/lingucomponent/source/lingutil
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2013-10-11 22:58:48 +0200
committerEike Rathke <erack@redhat.com>2013-10-11 23:00:44 +0200
commitd5f33e2db4ce6d7c5f81a18705431fcf4d184b9c (patch)
treecd3e25d3faf1e64b65fac57c00cb92f8d79bd597 /lingucomponent/source/lingutil
parent2a198c02b95bd76c8d7c9e7dd7aff8fc7c030fd5 (diff)
the dreaded hu_HU_u8.dic of myspell-hu needs exceptional handling
Change-Id: I2cef8d0dd306ce22552db0b5d8890c754be9e835
Diffstat (limited to 'lingucomponent/source/lingutil')
-rw-r--r--lingucomponent/source/lingutil/lingutil.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/lingucomponent/source/lingutil/lingutil.cxx b/lingucomponent/source/lingutil/lingutil.cxx
index 70f10ccf4aa2..4f721635160c 100644
--- a/lingucomponent/source/lingutil/lingutil.cxx
+++ b/lingucomponent/source/lingutil/lingutil.cxx
@@ -147,12 +147,28 @@ std::vector< SvtLinguConfigDictionaryEntry > GetOldStyleDics( const char *pDicTy
nStartIndex - aSystemPrefix.getLength());
if (sChunk.isEmpty())
continue;
+
// We prefer (now) to use language tags.
// Avoid feeding in the older LANG_REGION scheme to the BCP47
// ctor as that triggers use of liblangtag and initializes its
// database which we do not want during startup. Convert
// instead.
sChunk = sChunk.replace( '_', '-');
+
+ // There's a known exception to the rule, the dreaded
+ // hu_HU_u8.dic of the myspell-hu package, see
+ // http://packages.debian.org/search?arch=any&searchon=contents&keywords=hu_HU_u8.dic
+ // This was ignored because unknown in the old implementation,
+ // truncate to the known locale and either insert because hu_HU
+ // wasn't encountered yet, or skip because it was. It doesn't
+ // really matter because the proper new-style hu_HU dictionary
+ // will take precedence anyway if installed with a Hungarian
+ // languagepack. Again, this is only to not pull in all
+ // liblangtag and stuff during startup, the result would be
+ // !isValidBcp47() and the dictionary ignored.
+ if (sChunk == "hu-HU-u8")
+ sChunk = "hu-HU";
+
LanguageTag aLangTag(sChunk, true);
if (!aLangTag.isValidBcp47())
continue;