i18nlangtag/source/isolang/isolang.cxx  |    3 ++-
 i18nlangtag/source/isolang/mslangid.cxx |    2 ++
 include/i18nlangtag/lang.h              |    3 ++-
 svtools/source/misc/langtab.cxx         |    8 +++-----
 4 files changed, 9 insertions(+), 7 deletions(-)

New commits:
commit b959a2290f218dcae081d30e9da11c5a602ba5a5
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Thu Jan 5 18:12:59 2023 +0100
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Fri Jan 6 14:12:04 2023 +0000

    Related: tdf#152781 Stab the 0xE40A {es} vs Latin America quirk
    
    First, the LANGUAGE_SPANISH_LATIN_AMERICA 0xE40A is not a MS
    system LCID, it is Spanish 0x00a with sublanguage 0x39 => user
    defined (in the range 0x20 to 0x3f). Meanwhile MS reserved 0x580A
    for {es-419}, so obsolete the legacy 0xE40A definition and replace
    with 0x580A when encountered.
    
    Second, due to the legacy plain {es} mapping being present, an
    encountered 'es' (from our bundled dictionary extension) got
    mapped to 0xE40A instead of 0xA and thus was added to the
    character language listbox (that otherwise suppresses LCIDs
    without sublanguage), resulting in a "Spanish {es}" entry.
    
    Besides, it's currently not clear how to actually proceed with
    such dictionary situation when, for example, both 'es-ES' and 'es'
    dictionaries are present and the 'es' dictionary apparently is
    meant as base and contains entries the 'es-ES' does not or 'es-ES'
    overrides entries. It might be it's handled half-way in
    linguistics, but maybe not even that, I didn't investigate.
    
    Change-Id: Id859731ba5efa65d4a6de429b7f52027aa69327c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145093
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 375630ae76f46c096421dfadee8d37b406bc10c5)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145114

diff --git a/i18nlangtag/source/isolang/isolang.cxx 
b/i18nlangtag/source/isolang/isolang.cxx
index c5259a53886d..2bd6b5e5e229 100644
--- a/i18nlangtag/source/isolang/isolang.cxx
+++ b/i18nlangtag/source/isolang/isolang.cxx
@@ -273,7 +273,6 @@ IsoLanguageCountryEntry const aImplIsoLangEntries[] =
     { LANGUAGE_SPANISH_NICARAGUA,           "es", "NI", k0    },
     { LANGUAGE_SPANISH_PUERTO_RICO,         "es", "PR", k0    },
     { LANGUAGE_SPANISH_UNITED_STATES,       "es", "US", k0    },
-    { LANGUAGE_SPANISH_LATIN_AMERICA,       "es", ""  , k0    },
     { LANGUAGE_TURKISH,                     "tr", "TR", k0    },
     { LANGUAGE_UKRAINIAN,                   "uk", "UA", k0    },
     { LANGUAGE_VIETNAMESE,                  "vi", "VN", k0    },
@@ -791,6 +790,8 @@ Bcp47CountryEntry const aImplBcp47CountryEntries[] =
 //  { LANGUAGE_YUE_CHINESE_HONGKONG,         "zh-yue-HK", "HK", "", 0 },   // 
MS reserved, prefer yue-HK; do not add unless LanguageTag::simpleExtract() can 
handle it to not call liblangtag for rsc!
     { LANGUAGE_YIDDISH,                          "yi-001",   "", "", k0 },  // 
MS since rev.15, was "yi-Hebr" reserved, "001"="World"
     { LANGUAGE_FRENCH_WEST_INDIES,               "fr-029",   "", "", k0 },  // 
MS since rev.15, was "Neither defined nor reserved", "029"="Caribbean"
+    { LANGUAGE_SPANISH_LATIN_AMERICA,            "es-419",   "", "", k0 },  // 
MS reserved since rev.15, "419"="Latin America and the Caribbean"
+    { LANGUAGE_OBSOLETE_USER_SPANISH_LATIN_AMERICA, "es-419", "", "", 
LANGUAGE_SPANISH_LATIN_AMERICA },
     { LANGUAGE_USER_INTERSLAVIC_LATIN, "art-Latn-x-interslv", "", "", k0 },  
// see discussion in tdf#145853
     { LANGUAGE_USER_INTERSLAVIC_CYRILLIC, "art-Cyrl-x-interslv", "", "", k0 },
     { LANGUAGE_DONTKNOW,                    "", "", "", k0 }    // marks end 
of table
diff --git a/i18nlangtag/source/isolang/mslangid.cxx 
b/i18nlangtag/source/isolang/mslangid.cxx
index 4e446d568858..cac12347fc54 100644
--- a/i18nlangtag/source/isolang/mslangid.cxx
+++ b/i18nlangtag/source/isolang/mslangid.cxx
@@ -567,6 +567,8 @@ LanguageType MsLangId::getReplacementForObsoleteLanguage( 
LanguageType nLang )
         nLang = LANGUAGE_KURDISH_ARABIC_IRAQ;
     else if (nLang == LANGUAGE_OBSOLETE_USER_SPANISH_CUBA)
         nLang = LANGUAGE_SPANISH_CUBA;
+    else if (nLang == LANGUAGE_OBSOLETE_USER_SPANISH_LATIN_AMERICA)
+        nLang = LANGUAGE_SPANISH_LATIN_AMERICA;
 
     // The following are not strictly obsolete but should be mapped to a
     // replacement locale when encountered.
diff --git a/include/i18nlangtag/lang.h b/include/i18nlangtag/lang.h
index 158a7c7fe5be..59e20669cddd 100644
--- a/include/i18nlangtag/lang.h
+++ b/include/i18nlangtag/lang.h
@@ -389,7 +389,6 @@ namespace o3tl
 #define LANGUAGE_SPANISH_EL_SALVADOR        LanguageType(0x440A)
 #define LANGUAGE_SPANISH_GUATEMALA          LanguageType(0x100A)
 #define LANGUAGE_SPANISH_HONDURAS           LanguageType(0x480A)
-#define LANGUAGE_SPANISH_LATIN_AMERICA      LanguageType(0xE40A)  /* no locale 
possible */
 #define LANGUAGE_SPANISH_MEXICAN            LanguageType(0x080A)
 #define LANGUAGE_SPANISH_MODERN             LanguageType(0x0C0A)
 #define LANGUAGE_SPANISH_NICARAGUA          LanguageType(0x4C0A)
@@ -532,6 +531,8 @@ namespace o3tl
  * that such a mapping exists in i18nlangtag/source/isolang/isolang.cxx, but
  * mapping ISO back to LANGID will return the new value.
  */
+#define LANGUAGE_OBSOLETE_USER_SPANISH_LATIN_AMERICA LanguageType(0xE40A)  /* 
no locale possible, legacy for es-419, makeLangID( 0x39, getPrimaryLanguage( 
LANGUAGE_SPANISH)) */
+#define LANGUAGE_SPANISH_LATIN_AMERICA      LANGUAGE_es_419_reserved
 #define LANGUAGE_OBSOLETE_USER_LATIN        LanguageType(0x0610)
 #define LANGUAGE_USER_LATIN                 LANGUAGE_LATIN
 #define LANGUAGE_OBSOLETE_USER_LATIN_VATICAN LanguageType(0x8076)  /* 
makeLangID( 0x20, getPrimaryLanguage( LANGUAGE_LATIN)) */
commit 3aa8e02ce9de14225fe8aa1c31618abe1baa4f5e
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Wed Jan 4 21:14:03 2023 +0100
Commit:     Eike Rathke <er...@redhat.com>
CommitDate: Fri Jan 6 14:11:53 2023 +0000

    Related: tdf#152781 Add also non-on-the-fly IDs to language list
    
     This is a combination of 2 commits.
    
    Related: tdf#152781 s/lang-tag of/generated/ in SAL_WARN
    
    Only cosmetical to clarify, if possible a complete UI name is
    generated, not just the language tag as before.
    
    xChange-Id: Id38e397793807762c2698948c325e6eeda989cc0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145048
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 8343376c10eef50a022f600e0bd03f1384e9a288)
    
    Related: tdf#152781 Add also non-on-the-fly IDs to language list
    
    Generating names more than once is unnecessary.
    This may happen for defined mappings that have no explicitly
    predefined language list entry.
    
    xChange-Id: I278e6d77181b661a90d0fb133cb3ca30c2a9b721
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145049
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit cb4c33ef88a0ef252383e7a12678f28c4432347e)
    
    Change-Id: I278e6d77181b661a90d0fb133cb3ca30c2a9b721
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145092
    Tested-by: Jenkins
    Reviewed-by: Eike Rathke <er...@redhat.com>

diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 18099a828f27..0f5f15257856 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -240,13 +240,11 @@ OUString SvtLanguageTableImpl::GetString( const 
LanguageType eType ) const
     OUString sLangTag( lcl_getDescription( LanguageTag(nLang)));
     SAL_WARN("svtools.misc", "Language: 0x"
         << std::hex << nLang
-        << " with unknown name, so returning lang-tag of: "
+        << " with unknown name, so returning generated: "
         << sLangTag);
 
-    // And add it to the table if it is an on-the-fly-id, which it usually is,
-    // so it is available in all subsequent language boxes.
-    if (LanguageTag::isOnTheFlyID( nLang))
-        const_cast<SvtLanguageTableImpl*>(this)->AddEntry( sLangTag, nLang);
+    // And add it to the table, so it is available in all subsequent language 
boxes.
+    const_cast<SvtLanguageTableImpl*>(this)->AddEntry( sLangTag, nLang);
 
     return sLangTag;
 }

Reply via email to