[Libreoffice-commits] .: Branch 'libreoffice-3-5' - cui/source i18npool/inc i18npool/source svtools/inc svtools/source
Eike Rathke
erack at kemper.freedesktop.org
Fri Dec 9 13:37:13 PST 2011
cui/source/options/optgdlg.cxx | 4 ++--
i18npool/inc/i18npool/mslangid.hxx | 15 +++++++++++++--
i18npool/source/isolang/mslangid.cxx | 5 +++--
svtools/inc/svtools/langtab.hxx | 8 +++++++-
svtools/source/misc/langtab.cxx | 4 ++--
svtools/source/misc/langtab.src | 1 +
6 files changed, 28 insertions(+), 9 deletions(-)
New commits:
commit eea858f6c7696becab4e67ca00f5ee0293e63718
Author: Eike Rathke <erack at redhat.com>
Date: Fri Dec 9 22:33:50 2011 +0100
fixed fdo#37349 present Catalan (Valencian) as selectable UI language
Catalan (Valencian) has no ISO 639 code assigned and the UI localization uses
the ca-XV hack where XV is of the reserved ISO 3166 user-assigned range. This
should not escape to document content therefor internally a replacement to
ca-ES is done for all locale attribution. For the UI localization to be
distinguishable under Tools->Options->LanguageSettings->UserInterface this
needed a special handling to allow Catalan (Valencian) again.
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index dabc5a7..79c41d8 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -1280,7 +1280,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe
String aUILang(aStr);
aUILang += String::CreateFromAscii(" - ");
- aUILang += pLanguageTable->GetString( Application::GetSettings().GetUILanguage() );
+ aUILang += pLanguageTable->GetString( Application::GetSettings().GetUILanguage(), true );
aUserInterfaceLB.InsertEntry(aUILang);
aUserInterfaceLB.SetEntryData(0, 0);
@@ -1308,7 +1308,7 @@ OfaLanguagesTabPage::OfaLanguagesTabPage( Window* pParent, const SfxItemSet& rSe
if (aLang != LANGUAGE_DONTKNOW)
{
//sal_uInt16 p = aUserInterfaceLB.InsertLanguage(aLang);
- String aLangStr( pLanguageTable->GetString( aLang ) );
+ String aLangStr( pLanguageTable->GetString( aLang, true ) );
sal_uInt16 p = aUserInterfaceLB.InsertEntry(aLangStr);
aUserInterfaceLB.SetEntryData(p, (void*)(i+1));
}
diff --git a/i18npool/inc/i18npool/mslangid.hxx b/i18npool/inc/i18npool/mslangid.hxx
index 717a5bb..f1da981 100644
--- a/i18npool/inc/i18npool/mslangid.hxx
+++ b/i18npool/inc/i18npool/mslangid.hxx
@@ -203,8 +203,19 @@ public:
/** Map an obsolete user defined LANGID (see lang.h
LANGUAGE_OBSOLETE_USER_...) to the new value defined by MS in the
- meantime. */
- static LanguageType getReplacementForObsoleteLanguage( LanguageType nLang );
+ meantime.
+
+ Also used to map UI localizations using reserved ISO codes to something
+ "official" but not identical in order to not pollute documents with
+ invalid ISO codes.
+
+ @param bUserInterfaceSelection
+ If TRUE, don't replace such UI-only locale. Only use for
+ Tools->Options->LanguageSettings->UserInterface listbox.
+ If FALSE, do replace.
+ */
+ static LanguageType getReplacementForObsoleteLanguage( LanguageType nLang,
+ bool bUserInterfaceSelection = false );
/** @ATTENTION: these are _ONLY_ to be called by the application's
diff --git a/i18npool/source/isolang/mslangid.cxx b/i18npool/source/isolang/mslangid.cxx
index 06941b6..e5661da 100644
--- a/i18npool/source/isolang/mslangid.cxx
+++ b/i18npool/source/isolang/mslangid.cxx
@@ -379,7 +379,7 @@ sal_Int16 MsLangId::getScriptType( LanguageType nLang )
// static
-LanguageType MsLangId::getReplacementForObsoleteLanguage( LanguageType nLang )
+LanguageType MsLangId::getReplacementForObsoleteLanguage( LanguageType nLang, bool bUserInterfaceSelection )
{
switch (nLang)
{
@@ -433,7 +433,8 @@ LanguageType MsLangId::getReplacementForObsoleteLanguage( LanguageType nLang )
// Do not use ca-XV for document content.
/* TODO: remove in case we implement BCP47 language tags. */
case LANGUAGE_USER_CATALAN_VALENCIAN:
- nLang = LANGUAGE_CATALAN;
+ if (!bUserInterfaceSelection)
+ nLang = LANGUAGE_CATALAN;
break;
}
return nLang;
diff --git a/svtools/inc/svtools/langtab.hxx b/svtools/inc/svtools/langtab.hxx
index 9b38297..5785322 100644
--- a/svtools/inc/svtools/langtab.hxx
+++ b/svtools/inc/svtools/langtab.hxx
@@ -43,7 +43,13 @@ public:
SvtLanguageTable();
~SvtLanguageTable();
- const String& GetString( const LanguageType eType ) const;
+ /**
+ @param bUserInterfaceSelection
+ If TRUE, don't replace an UI-only locale. Only use for
+ Tools->Options->LanguageSettings->UserInterface listbox.
+ If FALSE, do replace.
+ */
+ const String& GetString( const LanguageType eType, bool bUserInterfaceSelection = false ) const;
LanguageType GetType( const String& rStr ) const;
sal_uInt32 GetEntryCount() const;
diff --git a/svtools/source/misc/langtab.cxx b/svtools/source/misc/langtab.cxx
index 2ce718e..51e93d4 100644
--- a/svtools/source/misc/langtab.cxx
+++ b/svtools/source/misc/langtab.cxx
@@ -136,9 +136,9 @@ SvtLanguageTable::~SvtLanguageTable()
//------------------------------------------------------------------------
-const String& SvtLanguageTable::GetString( const LanguageType eType ) const
+const String& SvtLanguageTable::GetString( const LanguageType eType, bool bUserInterfaceSelection ) const
{
- LanguageType eLang = MsLangId::getReplacementForObsoleteLanguage( eType);
+ LanguageType eLang = MsLangId::getReplacementForObsoleteLanguage( eType, bUserInterfaceSelection);
sal_uInt32 nPos = FindIndex( eLang );
if ( RESARRAY_INDEX_NOTFOUND != nPos && nPos < Count() )
diff --git a/svtools/source/misc/langtab.src b/svtools/source/misc/langtab.src
index 5d743e3..b82e0f4 100644
--- a/svtools/source/misc/langtab.src
+++ b/svtools/source/misc/langtab.src
@@ -79,6 +79,7 @@ StringArray STR_ARR_SVT_LANGUAGE_TABLE
< "Bulgarian" ; LANGUAGE_BULGARIAN ; > ;
< "Belarusian" ; LANGUAGE_BELARUSIAN ; > ;
< "Catalan" ; LANGUAGE_CATALAN ; > ;
+ < "Catalan (Valencian)" ; LANGUAGE_USER_CATALAN_VALENCIAN ; > ; // UI only!
< "Chinese (traditional)" ; LANGUAGE_CHINESE_TRADITIONAL ; > ;
< "Chinese (simplified)" ; LANGUAGE_CHINESE_SIMPLIFIED ; > ;
< "Chinese (Hong Kong)" ; LANGUAGE_CHINESE_HONGKONG ; > ;
More information about the Libreoffice-commits
mailing list