[Libreoffice-commits] core.git: 2 commits - i18nlangtag/source

Eike Rathke erack at redhat.com
Fri Aug 30 07:24:17 PDT 2013


 i18nlangtag/source/isolang/inunx.cxx   |    2 +-
 i18nlangtag/source/isolang/isolang.cxx |    7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 012f52c06f4f2efae8750d23db100f3eef6096d9
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Aug 30 16:12:20 2013 +0200

    originally was convertIsoNamesToLanguage(), use makeFallback()
    
    Change-Id: I4e49778a7519e8e4e1e1fce115b1b0ad30040f72

diff --git a/i18nlangtag/source/isolang/inunx.cxx b/i18nlangtag/source/isolang/inunx.cxx
index a20a64d..5f6e642 100644
--- a/i18nlangtag/source/isolang/inunx.cxx
+++ b/i18nlangtag/source/isolang/inunx.cxx
@@ -99,7 +99,7 @@ static void getPlatformSystemLanguageImpl( LanguageType& rSystemLanguage,
 
             if ( osl_getProcessLocale(&procLocale) == osl_Process_E_None )
             {
-                nLang = LanguageTag( *procLocale ).getLanguageType();
+                nLang = LanguageTag( *procLocale ).makeFallback().getLanguageType();
                 OSL_DOUBLE_CHECKED_LOCKING_MEMORY_BARRIER();
                 rSystemLanguage = nLang;
 #ifdef DEBUG
commit 6c3d74e8b779b1eb2d9779ed84f1518e078113c4
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Aug 30 15:05:21 2013 +0200

    take a shortcut for unknown "x-..." or "i-..."
    
    Change-Id: I4996fd68ba6bd62bd7126924418242fde78fe713

diff --git a/i18nlangtag/source/isolang/isolang.cxx b/i18nlangtag/source/isolang/isolang.cxx
index 50c154b..447a60a 100644
--- a/i18nlangtag/source/isolang/isolang.cxx
+++ b/i18nlangtag/source/isolang/isolang.cxx
@@ -846,9 +846,10 @@ void MsLangId::Conversion::convertLanguageToLocaleImpl( LanguageType nLang,
         // Locale.
         sal_Int32 nIndex = 0;
         aLowerLang = rLocale.Variant.getToken( 0, '-', nIndex).toAsciiLowerCase();
-        // Cater for "x-..."
-        if (aLowerLang.getLength() == 1 && aLowerLang[0] == 'x' && nIndex > 0)
-            aLowerLang += "-" + rLocale.Variant.getToken( 0, '-', nIndex).toAsciiLowerCase();
+        // Nothing with "x-..." or "i-..." or any 1 letter in lll-CC table that
+        // follows.
+        if (aLowerLang.getLength() == 1)
+            return aLastResortFallbackEntry.getLocale();
     }
 
     // Search for locale and remember first lang-only.


More information about the Libreoffice-commits mailing list