summaryrefslogtreecommitdiffstats
path: root/i18npool
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2011-12-09 22:33:50 +0100
committerEike Rathke <erack@redhat.com>2011-12-09 22:36:15 +0100
commit8c736b8543ca3d36612270cb4ceb2ae0a7abe2e7 (patch)
tree43dce984ebf949698daf6c272c506ab597c6b8bd /i18npool
parentfdo#38545: Show/hide anchor when the anchoring status changes. (diff)
downloadcore-8c736b8543ca3d36612270cb4ceb2ae0a7abe2e7.tar.gz
core-8c736b8543ca3d36612270cb4ceb2ae0a7abe2e7.zip
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.
Diffstat (limited to 'i18npool')
-rw-r--r--i18npool/inc/i18npool/mslangid.hxx15
-rw-r--r--i18npool/source/isolang/mslangid.cxx5
2 files changed, 16 insertions, 4 deletions
diff --git a/i18npool/inc/i18npool/mslangid.hxx b/i18npool/inc/i18npool/mslangid.hxx
index 717a5bb52c74..f1da9814cf11 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 06941b62d10a..e5661dab2d9d 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;