[Libreoffice-commits] core.git: 5 commits - accessibility/source avmedia/source basctl/source basic/source cui/source dbaccess/source desktop/Library_deploymentmisc.mk desktop/Library_unopkgapp.mk desktop/source editeng/source extensions/Library_abp.mk extensions/Library_bib.mk extensions/Library_dbp.mk extensions/Library_scn.mk extensions/source filter/Library_t602filter.mk filter/source forms/source formula/Library_forui.mk formula/source fpicker/Library_fps_office.mk fpicker/source framework/source i18npool/source padmin/source reportdesign/source scaddins/Library_analysis.mk scaddins/Library_date.mk scaddins/Library_pricing.mk scaddins/source sccomp/Library_solver.mk svl/inc svl/source svtools/source svx/source test/source toolkit/source tools/inc tools/source unotools/source vcl/source writerfilter/source xmlsecurity/Library_xmlsecurity.mk

Eike Rathke erack at redhat.com
Fri Mar 29 06:09:24 PDT 2013


 accessibility/source/helper/accresmgr.cxx             |    4 
 avmedia/source/framework/mediamisc.cxx                |    2 
 basctl/source/basicide/iderdll.cxx                    |    3 
 basic/source/runtime/basrdll.cxx                      |    3 
 basic/source/sbx/sbxscan.cxx                          |    3 
 cui/source/dialogs/insdlg.cxx                         |    3 
 cui/source/dialogs/pastedlg.cxx                       |    3 
 cui/source/factory/cuiresmgr.cxx                      |    2 
 dbaccess/source/core/resource/core_resource.cxx       |    4 
 dbaccess/source/ui/misc/moduledbu.cxx                 |    2 
 desktop/Library_deploymentmisc.mk                     |    1 
 desktop/Library_unopkgapp.mk                          |    1 
 desktop/source/app/app.cxx                            |    6 
 desktop/source/deployment/misc/dp_resource.cxx        |  122 --------------
 desktop/source/lib/init.cxx                           |    4 
 desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx        |    2 
 desktop/source/pkgchk/unopkg/unopkg_shared.h          |   13 -
 editeng/source/editeng/eerdll.cxx                     |    2 
 extensions/Library_abp.mk                             |    1 
 extensions/Library_bib.mk                             |    1 
 extensions/Library_dbp.mk                             |    1 
 extensions/Library_scn.mk                             |    1 
 extensions/source/resource/oooresourceloader.cxx      |    3 
 filter/Library_t602filter.mk                          |    1 
 filter/source/flash/swfdialog.cxx                     |    2 
 filter/source/graphicfilter/eps/eps.cxx               |    4 
 filter/source/pdf/impdialog.cxx                       |    2 
 filter/source/pdf/pdfexport.cxx                       |    2 
 filter/source/t602/t602filter.cxx                     |    2 
 filter/source/xsltdialog/xmlfilterdialogcomponent.cxx |    2 
 forms/source/resource/frm_resource.cxx                |    2 
 formula/Library_forui.mk                              |    1 
 formula/source/core/resource/core_resource.cxx        |    4 
 fpicker/Library_fps_office.mk                         |    1 
 fpicker/source/win32/misc/resourceprovider.cxx        |    2 
 framework/source/classes/fwlresid.cxx                 |    2 
 framework/source/fwe/classes/fwkresid.cxx             |    2 
 framework/source/services/license.cxx                 |   19 --
 framework/source/uielement/controlmenucontroller.cxx  |    4 
 i18npool/source/languagetag/languagetag.cxx           |   15 +
 padmin/source/helper.cxx                              |   12 -
 reportdesign/source/core/resource/core_resource.cxx   |    4 
 scaddins/Library_analysis.mk                          |    1 
 scaddins/Library_date.mk                              |    1 
 scaddins/Library_pricing.mk                           |    1 
 scaddins/source/analysis/analysis.cxx                 |    2 
 scaddins/source/datefunc/datefunc.cxx                 |    2 
 scaddins/source/pricing/pricing.cxx                   |    2 
 sccomp/Library_solver.mk                              |    1 
 svl/inc/svl/inettype.hxx                              |    4 
 svl/source/items/ctypeitm.cxx                         |    2 
 svl/source/misc/getstringresource.cxx                 |   13 -
 svl/source/misc/getstringresource.hxx                 |    2 
 svl/source/misc/inettype.cxx                          |    2 
 svtools/source/contnr/DocumentInfoPreview.cxx         |    2 
 svtools/source/filter/SvFilterOptionsDialog.cxx       |    2 
 svtools/source/graphic/provider.cxx                   |    2 
 svtools/source/misc/ehdl.cxx                          |    9 -
 svtools/source/misc/svtresid.cxx                      |    4 
 svx/source/dialog/dialmgr.cxx                         |    2 
 svx/source/form/datanavi.cxx                          |    2 
 svx/source/gallery2/galmisc.cxx                       |    2 
 svx/source/gallery2/galobj.cxx                        |    2 
 svx/source/svdraw/svdetc.cxx                          |    2 
 test/source/bootstrapfixture.cxx                      |    5 
 toolkit/source/helper/tkresmgr.cxx                    |    4 
 tools/inc/tools/resmgr.hxx                            |   11 -
 tools/inc/tools/simplerm.hxx                          |   11 -
 tools/source/rc/resmgr.cxx                            |  151 ++++++------------
 unotools/source/config/pathoptions.cxx                |    1 
 vcl/source/app/svapp.cxx                              |    4 
 vcl/source/app/svdata.cxx                             |    2 
 vcl/source/filter/graphicfilter.cxx                   |    2 
 writerfilter/source/rtftok/rtftokenizer.cxx           |    2 
 xmlsecurity/Library_xmlsecurity.mk                    |    1 
 75 files changed, 170 insertions(+), 356 deletions(-)

New commits:
commit 5be14df2444d9fcc3518c5f54872c87b924e3e98
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Mar 29 14:07:33 2013 +0100

    ResMgr with LanguageTag
    
    Change-Id: Ie5ce9157a7ea59db7b0509fbaec61d07f8f9edf0

diff --git a/accessibility/source/helper/accresmgr.cxx b/accessibility/source/helper/accresmgr.cxx
index 81e675d..5487bda 100644
--- a/accessibility/source/helper/accresmgr.cxx
+++ b/accessibility/source/helper/accresmgr.cxx
@@ -43,9 +43,7 @@ void TkResMgr::ensureImplExists()
     if (m_pImpl)
         return;
 
-    ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale();
-
-    m_pImpl = SimpleResMgr::Create("acc", aLocale );
+    m_pImpl = SimpleResMgr::Create("acc", Application::GetSettings().GetUILanguageTag() );
 
     if (m_pImpl)
     {
diff --git a/avmedia/source/framework/mediamisc.cxx b/avmedia/source/framework/mediamisc.cxx
index 87468d8..686a22b 100644
--- a/avmedia/source/framework/mediamisc.cxx
+++ b/avmedia/source/framework/mediamisc.cxx
@@ -29,7 +29,7 @@ ResMgr* GetResMgr()
 
     if( !pResMgr )
     {
-        pResMgr = ResMgr::CreateResMgr("avmedia", Application::GetSettings().GetUILanguageTag().getLocale());
+        pResMgr = ResMgr::CreateResMgr("avmedia", Application::GetSettings().GetUILanguageTag());
     }
 
     return pResMgr;
diff --git a/basctl/source/basicide/iderdll.cxx b/basctl/source/basicide/iderdll.cxx
index e88f1bb..82a311d 100644
--- a/basctl/source/basicide/iderdll.cxx
+++ b/basctl/source/basicide/iderdll.cxx
@@ -127,8 +127,7 @@ Dll::Dll () :
     (void)pFact;
 
     ResMgr* pMgr = ResMgr::CreateResMgr(
-        "basctl", Application::GetSettings().GetUILanguageTag().getLocale()
-    );
+        "basctl", Application::GetSettings().GetUILanguageTag());
 
     Module::Get() = new Module( pMgr, &DocShell::Factory() );
 
diff --git a/basic/source/runtime/basrdll.cxx b/basic/source/runtime/basrdll.cxx
index 6a8b37d..59be107 100644
--- a/basic/source/runtime/basrdll.cxx
+++ b/basic/source/runtime/basrdll.cxx
@@ -36,8 +36,7 @@ BasResId::BasResId( sal_uInt32 nId ) :
 BasicDLL::BasicDLL()
 {
     BASIC_DLL() = this;
-    ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale();
-    pBasResMgr = ResMgr::CreateResMgr("sb", aLocale );
+    pBasResMgr = ResMgr::CreateResMgr("sb", Application::GetSettings().GetUILanguageTag() );
     bDebugMode = false;
     bBreakEnabled = true;
 }
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 68faaf0..ff6109e 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -656,8 +656,7 @@ ResMgr* implGetResMgr( void )
     static ResMgr* pResMgr = NULL;
     if( !pResMgr )
     {
-        ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale();
-        pResMgr = ResMgr::CreateResMgr("sb", aLocale );
+        pResMgr = ResMgr::CreateResMgr("sb", Application::GetSettings().GetUILanguageTag() );
     }
     return pResMgr;
 }
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index bca33d8..8d2091d 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -70,8 +70,7 @@ using namespace ::com::sun::star::ui::dialogs;
 static String impl_getSvtResString( sal_uInt32 nId )
 {
     String aRet;
-    com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale();
-    ResMgr* pMgr = ResMgr::CreateResMgr( "svt", aLocale );
+    ResMgr* pMgr = ResMgr::CreateResMgr( "svt", Application::GetSettings().GetUILanguageTag() );
     if( pMgr )
     {
         aRet = String( ResId( nId, *pMgr ) );
diff --git a/cui/source/dialogs/pastedlg.cxx b/cui/source/dialogs/pastedlg.cxx
index 43c6e6e..a299791 100644
--- a/cui/source/dialogs/pastedlg.cxx
+++ b/cui/source/dialogs/pastedlg.cxx
@@ -199,8 +199,7 @@ sal_uLong SvPasteObjectDialog::GetFormat( const TransferableDataHelper& rHelper,
 
         if( !aTypeName.Len() && !aSourceName.Len() )
         {
-            com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale();
-            ResMgr* pMgr = ResMgr::CreateResMgr( "svt", aLocale );
+            ResMgr* pMgr = ResMgr::CreateResMgr( "svt", Application::GetSettings().GetUILanguageTag() );
             // global resource from svtools (former so3 resource)
             if( pMgr )
                 aSourceName = String( ResId( STR_UNKNOWN_SOURCE, *pMgr ) );
diff --git a/cui/source/factory/cuiresmgr.cxx b/cui/source/factory/cuiresmgr.cxx
index cd882e2..318ce4d 100644
--- a/cui/source/factory/cuiresmgr.cxx
+++ b/cui/source/factory/cuiresmgr.cxx
@@ -28,7 +28,7 @@ ResMgr* CuiResMgr::GetResMgr()
 
     if ( !pResMgr )
     {
-        pResMgr = ResMgr::CreateResMgr("cui", Application::GetSettings().GetUILanguageTag().getLocale());
+        pResMgr = ResMgr::CreateResMgr("cui", Application::GetSettings().GetUILanguageTag());
     }
 
     return pResMgr;
diff --git a/dbaccess/source/core/resource/core_resource.cxx b/dbaccess/source/core/resource/core_resource.cxx
index 6c3e6f4..01284eb 100644
--- a/dbaccess/source/core/resource/core_resource.cxx
+++ b/dbaccess/source/core/resource/core_resource.cxx
@@ -50,9 +50,7 @@ namespace dbaccess
         if (m_pImpl)
             return;
 
-        ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale();
-
-        m_pImpl = ResMgr::CreateResMgr("dba", aLocale);
+        m_pImpl = ResMgr::CreateResMgr("dba", Application::GetSettings().GetUILanguageTag());
     }
 
     //------------------------------------------------------------------
diff --git a/desktop/Library_deploymentmisc.mk b/desktop/Library_deploymentmisc.mk
index 544ebc3..f0c01dc 100644
--- a/desktop/Library_deploymentmisc.mk
+++ b/desktop/Library_deploymentmisc.mk
@@ -50,6 +50,7 @@ $(eval $(call gb_Library_use_libraries,deploymentmisc,\
     ucbhelper \
     utl \
     xmlscript \
+    i18nisolang1 \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/desktop/Library_unopkgapp.mk b/desktop/Library_unopkgapp.mk
index a0f678a..8f79d0f 100644
--- a/desktop/Library_unopkgapp.mk
+++ b/desktop/Library_unopkgapp.mk
@@ -52,6 +52,7 @@ $(eval $(call gb_Library_use_libraries,unopkgapp,\
     ucbhelper \
     utl \
     vcl \
+    i18nisolang1 \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx
index e9301bf..3eb4ab1 100644
--- a/desktop/source/app/app.cxx
+++ b/desktop/source/app/app.cxx
@@ -340,9 +340,7 @@ ResMgr* Desktop::GetDesktopResManager()
             OUString aUILocaleString = LanguageSelection::getLanguageString();
             LanguageTag aLanguageTag( aUILocaleString);
             //! ResMgr may modify the Locale for fallback!
-            ::com::sun::star::lang::Locale aLocale( aLanguageTag.getLocale());
-            Desktop::pResMgr = ResMgr::SearchCreateResMgr( "dkt", aLocale);
-            aLanguageTag.reset( aLocale);
+            Desktop::pResMgr = ResMgr::SearchCreateResMgr( "dkt", aLanguageTag);
             AllSettings as = GetSettings();
             as.SetUILanguageTag(aLanguageTag);
             SetSettings(as);
@@ -1495,7 +1493,7 @@ int Desktop::Main()
         }
 
         // create title string
-        ::com::sun::star::lang::Locale aLocale;
+        LanguageTag aLocale( LANGUAGE_SYSTEM);
         ResMgr* pLabelResMgr = ResMgr::SearchCreateResMgr( "ofa", aLocale );
         String aTitle = pLabelResMgr ? String( ResId( RID_APPTITLE, *pLabelResMgr ) ) : String();
         delete pLabelResMgr;
diff --git a/desktop/source/deployment/misc/dp_resource.cxx b/desktop/source/deployment/misc/dp_resource.cxx
index 0cf266e..2073578 100644
--- a/desktop/source/deployment/misc/dp_resource.cxx
+++ b/desktop/source/deployment/misc/dp_resource.cxx
@@ -51,7 +51,7 @@ struct OfficeLocale :
 struct DeploymentResMgr : public rtl::StaticWithInit<
     ResMgr *, DeploymentResMgr> {
     ResMgr * operator () () {
-        return ResMgr::CreateResMgr( "deployment", getOfficeLocale() );
+        return ResMgr::CreateResMgr( "deployment", LanguageTag( OfficeLocale::get()) );
     }
 };
 
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 06f5eac..5108ecc 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -68,10 +68,10 @@ static void
 force_c_locale( void )
 {
     // force locale (and resource files loaded) to en-US
-    css::lang::Locale aLocale( "en", "US", "");
+    OUString aLangISO( "en-US" );
+    LanguageTag aLocale( aLangISO );
     ResMgr::SetDefaultLocale( aLocale );
     SvtSysLocaleOptions aLocalOptions;
-    OUString aLangISO( "en-US" );
     aLocalOptions.SetLocaleConfigString( aLangISO );
     aLocalOptions.SetUILocaleConfigString( aLangISO );
 }
diff --git a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
index 3a782ca..3368f75 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
+++ b/desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx
@@ -162,7 +162,7 @@ void CommandEnvironmentImpl::printLicense(
     Reference< css::i18n::XCollator > xCollator =
         css::i18n::Collator::create( m_xComponentContext );
     xCollator->loadDefaultCollator(
-        toLocale(utl::ConfigManager::getLocale()),
+        LanguageTag(utl::ConfigManager::getLocale()).getLocale(),
         css::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE);
 
     do
diff --git a/desktop/source/pkgchk/unopkg/unopkg_shared.h b/desktop/source/pkgchk/unopkg/unopkg_shared.h
index 93afa90..4340e9f8 100644
--- a/desktop/source/pkgchk/unopkg/unopkg_shared.h
+++ b/desktop/source/pkgchk/unopkg/unopkg_shared.h
@@ -25,26 +25,17 @@
 #include "tools/resmgr.hxx"
 #include "rtl/ustring.hxx"
 #include "unotools/configmgr.hxx"
+#include <i18npool/languagetag.hxx>
 
 #define APP_NAME "unopkg"
 
 namespace unopkg {
 
-    inline ::com::sun::star::lang::Locale toLocale( ::rtl::OUString const & slang )
-    {
-        ::com::sun::star::lang::Locale locale;
-        sal_Int32 nIndex = 0;
-        locale.Language = slang.getToken( 0, '-', nIndex );
-        locale.Country = slang.getToken( 0, '-', nIndex );
-        locale.Variant = slang.getToken( 0, '-', nIndex );
-        return locale;
-    }
-
 struct DeploymentResMgr :  public rtl::StaticWithInit< ResMgr *, DeploymentResMgr >
 {
     ResMgr * operator () () {
         return ResMgr::CreateResMgr(
-            "deployment", toLocale( utl::ConfigManager::getLocale() ) );
+            "deployment", LanguageTag( utl::ConfigManager::getLocale() ) );
     }
 };
 
diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx
index 0ad2efc..59086ea 100644
--- a/editeng/source/editeng/eerdll.cxx
+++ b/editeng/source/editeng/eerdll.cxx
@@ -204,7 +204,7 @@ EditResId::EditResId( sal_uInt16 nId ):
 EditDLL::EditDLL()
 {
     pGlobalData = new GlobalEditData;
-    pResMgr = ResMgr::CreateResMgr( "editeng", Application::GetSettings().GetUILanguageTag().getLocale() );
+    pResMgr = ResMgr::CreateResMgr( "editeng", Application::GetSettings().GetUILanguageTag() );
 }
 
 EditDLL::~EditDLL()
diff --git a/extensions/Library_abp.mk b/extensions/Library_abp.mk
index 2ecbd0c..c8d0570 100644
--- a/extensions/Library_abp.mk
+++ b/extensions/Library_abp.mk
@@ -87,6 +87,7 @@ $(eval $(call gb_Library_use_libraries,abp,\
 	tl \
 	utl \
 	vcl \
+	i18nisolang1 \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/extensions/Library_bib.mk b/extensions/Library_bib.mk
index 6de36bc..d12adec 100644
--- a/extensions/Library_bib.mk
+++ b/extensions/Library_bib.mk
@@ -76,6 +76,7 @@ $(eval $(call gb_Library_use_libraries,bib,\
 	cppu \
 	sal \
 	salhelper \
+	i18nisolang1 \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/extensions/Library_dbp.mk b/extensions/Library_dbp.mk
index 0767444..42ea5a0 100644
--- a/extensions/Library_dbp.mk
+++ b/extensions/Library_dbp.mk
@@ -72,6 +72,7 @@ $(eval $(call gb_Library_use_libraries,dbp,\
 	cppu \
 	sal \
 	salhelper \
+	i18nisolang1 \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/extensions/Library_scn.mk b/extensions/Library_scn.mk
index 26d6f44..be21b78 100644
--- a/extensions/Library_scn.mk
+++ b/extensions/Library_scn.mk
@@ -45,6 +45,7 @@ $(eval $(call gb_Library_use_libraries,scn,\
 	cppuhelper \
 	cppu \
 	sal \
+	i18nisolang1 \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/extensions/source/resource/oooresourceloader.cxx b/extensions/source/resource/oooresourceloader.cxx
index 25900c8..72930af 100644
--- a/extensions/source/resource/oooresourceloader.cxx
+++ b/extensions/source/resource/oooresourceloader.cxx
@@ -193,7 +193,8 @@ namespace extensions { namespace resource
         ,m_pResourceManager( NULL )
     {
         ::rtl::OUString sBaseName( _rBaseName );
-        m_pResourceManager = new SimpleResMgr( rtl::OUStringToOString( sBaseName, RTL_TEXTENCODING_UTF8 ).getStr(), m_aLocale );
+        m_pResourceManager = new SimpleResMgr( rtl::OUStringToOString( sBaseName, RTL_TEXTENCODING_UTF8 ).getStr(),
+                LanguageTag( m_aLocale) );
 
         if ( !m_pResourceManager->IsValid() )
         {
diff --git a/filter/Library_t602filter.mk b/filter/Library_t602filter.mk
index a0acfe3..dae8f62 100644
--- a/filter/Library_t602filter.mk
+++ b/filter/Library_t602filter.mk
@@ -29,6 +29,7 @@ $(eval $(call gb_Library_use_libraries,t602filter,\
 	cppuhelper \
 	cppu \
 	sal \
+	i18nisolang1 \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/filter/source/flash/swfdialog.cxx b/filter/source/flash/swfdialog.cxx
index 83c8f6f..5d3201e 100644
--- a/filter/source/flash/swfdialog.cxx
+++ b/filter/source/flash/swfdialog.cxx
@@ -91,7 +91,7 @@ Reference< XInterface > SAL_CALL SWFDialog_createInstance( const Reference< XMul
 SWFDialog::SWFDialog( const Reference< XComponentContext> &rxContext ) :
     OGenericUnoDialog( rxContext )
 {
-    mpResMgr = ResMgr::CreateResMgr( "flash", Application::GetSettings().GetUILanguageTag().getLocale() );
+    mpResMgr = ResMgr::CreateResMgr( "flash", Application::GetSettings().GetUILanguageTag() );
 }
 
 // -----------------------------------------------------------------------------
diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx
index 47d678e..6f73da1 100644
--- a/filter/source/graphicfilter/eps/eps.cxx
+++ b/filter/source/graphicfilter/eps/eps.cxx
@@ -294,7 +294,7 @@ sal_Bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Fi
     {
         ResMgr*     pResMgr;
 
-        pResMgr = ResMgr::CreateResMgr( "eps", Application::GetSettings().GetUILanguageTag().getLocale() );
+        pResMgr = ResMgr::CreateResMgr( "eps", Application::GetSettings().GetUILanguageTag() );
 
         if( pResMgr )
         {
@@ -435,7 +435,7 @@ sal_Bool PSWriter::WritePS( const Graphic& rGraphic, SvStream& rTargetStream, Fi
     if ( mbStatus && mnLevelWarning && pFilterConfigItem )
     {
         ResMgr* pResMgr;
-        pResMgr = ResMgr::CreateResMgr( "eps", Application::GetSettings().GetUILanguageTag().getLocale() );
+        pResMgr = ResMgr::CreateResMgr( "eps", Application::GetSettings().GetUILanguageTag() );
         if( pResMgr )
         {
             InfoBox aInfoBox( NULL, String( ResId( KEY_VERSION_CHECK, *pResMgr ) ) );
diff --git a/filter/source/pdf/impdialog.cxx b/filter/source/pdf/impdialog.cxx
index b95f341..a826db3 100644
--- a/filter/source/pdf/impdialog.cxx
+++ b/filter/source/pdf/impdialog.cxx
@@ -41,7 +41,7 @@
 
 static ResMgr& getPDFFilterResMgr()
 {
-    static ResMgr *pRes = ResMgr::CreateResMgr( "pdffilter", Application::GetSettings().GetUILanguageTag().getLocale());
+    static ResMgr *pRes = ResMgr::CreateResMgr( "pdffilter", Application::GetSettings().GetUILanguageTag());
     return *pRes;
 }
 
diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx
index 6eea76d..75e6983 100644
--- a/filter/source/pdf/pdfexport.cxx
+++ b/filter/source/pdf/pdfexport.cxx
@@ -882,7 +882,7 @@ sal_Bool PDFExport::Export( const OUString& rFile, const Sequence< PropertyValue
 
                 if ( mxStatusIndicator.is() )
                 {
-                    ResMgr* pResMgr = ResMgr::CreateResMgr( "pdffilter", Application::GetSettings().GetUILanguageTag().getLocale() );
+                    ResMgr* pResMgr = ResMgr::CreateResMgr( "pdffilter", Application::GetSettings().GetUILanguageTag() );
                     if ( pResMgr )
                     {
                         sal_Int32 nTotalPageCount = aRangeEnum.size();
diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx
index 0282d19..d72401f 100644
--- a/filter/source/t602/t602filter.cxx
+++ b/filter/source/t602/t602filter.cxx
@@ -1123,7 +1123,7 @@ void T602ImportFilterDialog::initLocale()
     rtl::OString aModName( "t602filter" );
     aModName += rtl::OString::valueOf( sal_Int32( SUPD ) );
 
-    mpResMgr = ResMgr::CreateResMgr( aModName.getStr(), meLocale );
+    mpResMgr = ResMgr::CreateResMgr( aModName.getStr(), LanguageTag( meLocale) );
 }
 
 ResMgr* T602ImportFilterDialog::getResMgr()
diff --git a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
index 1e21a7a..229e4cf2 100644
--- a/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
+++ b/filter/source/xsltdialog/xmlfilterdialogcomponent.cxx
@@ -349,7 +349,7 @@ sal_Int16 SAL_CALL XMLFilterDialogComponent::execute(  ) throw(RuntimeException)
 
     if( NULL == pXSLTResMgr )
     {
-        pXSLTResMgr = ResMgr::CreateResMgr( "xsltdlg", Application::GetSettings().GetUILanguageTag().getLocale() );
+        pXSLTResMgr = ResMgr::CreateResMgr( "xsltdlg", Application::GetSettings().GetUILanguageTag() );
     }
 
     if( NULL == mpDialog )
diff --git a/forms/source/resource/frm_resource.cxx b/forms/source/resource/frm_resource.cxx
index c269de8..9acd6b1 100644
--- a/forms/source/resource/frm_resource.cxx
+++ b/forms/source/resource/frm_resource.cxx
@@ -48,7 +48,7 @@ namespace frm
         if (m_pImpl)
             return;
 
-        m_pImpl = SimpleResMgr::Create("frm", Application::GetSettings().GetUILanguageTag().getLocale());
+        m_pImpl = SimpleResMgr::Create("frm", Application::GetSettings().GetUILanguageTag());
 
         if (m_pImpl)
         {
diff --git a/formula/Library_forui.mk b/formula/Library_forui.mk
index 130e621..0706a40 100644
--- a/formula/Library_forui.mk
+++ b/formula/Library_forui.mk
@@ -53,6 +53,7 @@ $(eval $(call gb_Library_use_libraries,forui,\
     tl \
     utl \
     vcl \
+	i18nisolang1 \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/formula/source/core/resource/core_resource.cxx b/formula/source/core/resource/core_resource.cxx
index 63279d2..3e7160a 100644
--- a/formula/source/core/resource/core_resource.cxx
+++ b/formula/source/core/resource/core_resource.cxx
@@ -47,9 +47,7 @@ namespace formula
         if (m_pImpl)
             return;
 
-        ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale();
-
-        m_pImpl = ResMgr::CreateResMgr("for", aLocale);
+        m_pImpl = ResMgr::CreateResMgr("for", Application::GetSettings().GetUILanguageTag());
     }
 
     //-------------------------------------------------------------------------
diff --git a/fpicker/Library_fps_office.mk b/fpicker/Library_fps_office.mk
index 10b6d06..f9c69ea 100644
--- a/fpicker/Library_fps_office.mk
+++ b/fpicker/Library_fps_office.mk
@@ -50,6 +50,7 @@ $(eval $(call gb_Library_use_libraries,fps_office,\
 	ucbhelper \
 	utl \
 	vcl \
+	i18nisolang1 \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/fpicker/source/win32/misc/resourceprovider.cxx b/fpicker/source/win32/misc/resourceprovider.cxx
index 6ecbae5..4e4cc9e 100644
--- a/fpicker/source/win32/misc/resourceprovider.cxx
+++ b/fpicker/source/win32/misc/resourceprovider.cxx
@@ -107,7 +107,7 @@ public:
     {
         const SolarMutexGuard aGuard;
         m_ResMgr = new SimpleResMgr(
-            "fps_office", Application::GetSettings().GetUILanguageTag().getLocale());
+            "fps_office", Application::GetSettings().GetUILanguageTag());
     }
 
     //-------------------------------------
diff --git a/framework/source/classes/fwlresid.cxx b/framework/source/classes/fwlresid.cxx
index ba3987a..ff01b34 100644
--- a/framework/source/classes/fwlresid.cxx
+++ b/framework/source/classes/fwlresid.cxx
@@ -34,7 +34,7 @@ ResMgr* FwlResId::GetResManager()
     if ( !pResMgr )
     {
         SolarMutexGuard aSolarGuard;
-        pResMgr = ResMgr::CreateResMgr("fwe", Application::GetSettings().GetUILanguageTag().getLocale());
+        pResMgr = ResMgr::CreateResMgr("fwe", Application::GetSettings().GetUILanguageTag());
     }
 
     return pResMgr;
diff --git a/framework/source/fwe/classes/fwkresid.cxx b/framework/source/fwe/classes/fwkresid.cxx
index ff78bb3..0ae4d3e 100644
--- a/framework/source/fwe/classes/fwkresid.cxx
+++ b/framework/source/fwe/classes/fwkresid.cxx
@@ -34,7 +34,7 @@ ResMgr* FwkResId::GetResManager()
     if ( !pResMgr )
     {
         SolarMutexGuard aSolarGuard;
-        pResMgr = ResMgr::CreateResMgr("fwe", Application::GetSettings().GetUILanguageTag().getLocale());
+        pResMgr = ResMgr::CreateResMgr("fwe", Application::GetSettings().GetUILanguageTag());
     }
 
     return pResMgr;
diff --git a/framework/source/services/license.cxx b/framework/source/services/license.cxx
index 41db42b..56f6ac4 100644
--- a/framework/source/services/license.cxx
+++ b/framework/source/services/license.cxx
@@ -220,21 +220,9 @@ css::uno::Any SAL_CALL License::execute(const css::uno::Sequence< css::beans::Na
             aRet <<= sal_False;
             return aRet;
         }
-        // determine the filename of the license to show
-        AllSettings aSettings(Application::GetSettings());
-        ::com::sun::star::lang::Locale aLocale = aSettings.GetUILanguageTag().getLocale();
 
-        OUString aLangString = aLocale.Language;
-        if ( !aLocale.Country.isEmpty() )
-        {
-            aLangString += ::rtl::OUString("-");
-            aLangString += aLocale.Country;
-            if ( !aLocale.Variant.isEmpty() )
-            {
-                aLangString += ::rtl::OUString("-");
-                aLangString += aLocale.Variant;
-            }
-        }
+        // determine the filename of the license to show
+        OUString aLangString( Application::GetSettings().GetUILanguageTag().getBcp47());
 #if defined(WNT)
         ::rtl::OUString aLicensePath =
             aBaseInstallPath + ::rtl::OUString::createFromAscii(szLicensePath)
@@ -292,7 +280,8 @@ css::uno::Any SAL_CALL License::execute(const css::uno::Sequence< css::beans::Na
         }
         // prepare to show
         // display license dialog
-        boost::scoped_ptr<ResMgr> pResMgr(ResMgr::SearchCreateResMgr("fwe", aLocale));
+        LanguageTag aLanguageTag( Application::GetSettings().GetUILanguageTag());
+        boost::scoped_ptr<ResMgr> pResMgr( ResMgr::SearchCreateResMgr("fwe", aLanguageTag));
         boost::scoped_ptr<LicenseDialog> pDialog(new LicenseDialog(aLicensePath, pResMgr.get()));
         sal_Bool bAgreed = (pDialog->Execute() == 1);
 
diff --git a/framework/source/uielement/controlmenucontroller.cxx b/framework/source/uielement/controlmenucontroller.cxx
index 692fb98..42de11e 100644
--- a/framework/source/uielement/controlmenucontroller.cxx
+++ b/framework/source/uielement/controlmenucontroller.cxx
@@ -202,7 +202,7 @@ ControlMenuController::~ControlMenuController()
 // private function
 void ControlMenuController::updateImagesPopupMenu( PopupMenu* pPopupMenu )
 {
-    ResMgr* pResMgr = ResMgr::CreateResMgr("svx", Application::GetSettings().GetUILanguageTag().getLocale());
+    ResMgr* pResMgr = ResMgr::CreateResMgr("svx", Application::GetSettings().GetUILanguageTag());
     ResId aResId( RID_SVXIMGLIST_FMEXPL, *pResMgr );
     aResId.SetRT( RSC_IMAGELIST );
 
@@ -351,7 +351,7 @@ void ControlMenuController::impl_setPopupMenu()
 {
     if ( m_pResPopupMenu == 0 )
     {
-        ResMgr* pResMgr = ResMgr::CreateResMgr("svx", Application::GetSettings().GetUILanguageTag().getLocale());
+        ResMgr* pResMgr = ResMgr::CreateResMgr("svx", Application::GetSettings().GetUILanguageTag());
         if ( pResMgr )
         {
             ResId aResId( RID_FMSHELL_CONVERSIONMENU, *pResMgr );
diff --git a/padmin/source/helper.cxx b/padmin/source/helper.cxx
index 69c5631..8e16ca4 100644
--- a/padmin/source/helper.cxx
+++ b/padmin/source/helper.cxx
@@ -54,7 +54,7 @@ ResId padmin::PaResId( sal_uInt32 nId )
     static ResMgr* pPaResMgr = NULL;
     if( ! pPaResMgr )
     {
-        ::com::sun::star::lang::Locale aLocale;
+        LanguageTag aLanguageTag( LANGUAGE_SYSTEM);
 
         utl::OConfigurationNode aNode =
             utl::OConfigurationTreeRoot::tryCreateWithComponentContext(
@@ -66,16 +66,12 @@ ResId padmin::PaResId( sal_uInt32 nId )
             Any aValue = aNode.getNodeValue( OUString("ooLocale") );
             if( aValue >>= aLoc )
             {
-                /* FIXME-BCP47: handle language tags! */
-                sal_Int32 nIndex = 0;
-                aLocale.Language = aLoc.getToken( 0, '-', nIndex );
-                aLocale.Country = aLoc.getToken( 0, '-', nIndex );
-                aLocale.Variant = aLoc.getToken( 0, '-', nIndex );
+                aLanguageTag.reset( aLoc);
             }
         }
-        pPaResMgr = ResMgr::SearchCreateResMgr( "spa", aLocale );
+        pPaResMgr = ResMgr::SearchCreateResMgr( "spa", aLanguageTag );
         AllSettings aSettings = Application::GetSettings();
-        aSettings.SetUILanguageTag( LanguageTag( aLocale) );
+        aSettings.SetUILanguageTag( aLanguageTag );
         Application::SetSettings( aSettings );
     }
     return ResId( nId, *pPaResMgr );
diff --git a/reportdesign/source/core/resource/core_resource.cxx b/reportdesign/source/core/resource/core_resource.cxx
index df12dd0..0abc584 100644
--- a/reportdesign/source/core/resource/core_resource.cxx
+++ b/reportdesign/source/core/resource/core_resource.cxx
@@ -54,9 +54,7 @@ namespace reportdesign
             // now that we have an impl class make sure it's deleted on unloading the library
             static ResourceManager::EnsureDelete    s_aDeleteTheImplClass;
 
-            ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale();
-
-            m_pImpl = SimpleResMgr::Create("rpt", aLocale);
+            m_pImpl = SimpleResMgr::Create("rpt", Application::GetSettings().GetUILanguageTag());
         }
     }
 
diff --git a/scaddins/Library_analysis.mk b/scaddins/Library_analysis.mk
index 2b91e97..e502efd 100644
--- a/scaddins/Library_analysis.mk
+++ b/scaddins/Library_analysis.mk
@@ -44,6 +44,7 @@ $(eval $(call gb_Library_use_libraries,analysis,\
 	cppuhelper \
 	sal \
 	tl \
+	i18nisolang1 \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/scaddins/Library_date.mk b/scaddins/Library_date.mk
index 008212d..d9fb4d3 100644
--- a/scaddins/Library_date.mk
+++ b/scaddins/Library_date.mk
@@ -43,6 +43,7 @@ $(eval $(call gb_Library_use_libraries,date,\
 	cppuhelper \
 	sal \
 	tl \
+	i18nisolang1 \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/scaddins/Library_pricing.mk b/scaddins/Library_pricing.mk
index d03a90b..12d8032 100644
--- a/scaddins/Library_pricing.mk
+++ b/scaddins/Library_pricing.mk
@@ -43,6 +43,7 @@ $(eval $(call gb_Library_use_libraries,pricing,\
 	cppuhelper \
 	sal \
 	tl \
+	i18nisolang1 \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/scaddins/source/analysis/analysis.cxx b/scaddins/source/analysis/analysis.cxx
index 2a335f8..e8880fa 100644
--- a/scaddins/source/analysis/analysis.cxx
+++ b/scaddins/source/analysis/analysis.cxx
@@ -138,7 +138,7 @@ void AnalysisAddIn::InitData( void )
         delete pResMgr;
 
     OString             aModName( "analysis" );
-    pResMgr = ResMgr::CreateResMgr( aModName.getStr(), aFuncLoc );
+    pResMgr = ResMgr::CreateResMgr( aModName.getStr(), LanguageTag( aFuncLoc) );
 
     if( pFD )
         delete pFD;
diff --git a/scaddins/source/datefunc/datefunc.cxx b/scaddins/source/datefunc/datefunc.cxx
index 378db18..3794104 100644
--- a/scaddins/source/datefunc/datefunc.cxx
+++ b/scaddins/source/datefunc/datefunc.cxx
@@ -297,7 +297,7 @@ void ScaDateAddIn::InitData()
         delete pResMgr;
 
     OString aModName( "date" );
-    pResMgr = ResMgr::CreateResMgr( aModName.getStr(), aFuncLoc );
+    pResMgr = ResMgr::CreateResMgr( aModName.getStr(), LanguageTag( aFuncLoc) );
 
     if( pFuncDataList )
         delete pFuncDataList;
diff --git a/scaddins/source/pricing/pricing.cxx b/scaddins/source/pricing/pricing.cxx
index 2d7a8c8..cc1a30c 100644
--- a/scaddins/source/pricing/pricing.cxx
+++ b/scaddins/source/pricing/pricing.cxx
@@ -301,7 +301,7 @@ void ScaPricingAddIn::InitData()
         delete pResMgr;
 
     OString aModName( "pricing" );
-    pResMgr = ResMgr::CreateResMgr( aModName.getStr(), aFuncLoc );
+    pResMgr = ResMgr::CreateResMgr( aModName.getStr(), LanguageTag( aFuncLoc) );
 
     if( pFuncDataList )
         delete pFuncDataList;
diff --git a/sccomp/Library_solver.mk b/sccomp/Library_solver.mk
index d0a56c2..5561cc7 100644
--- a/sccomp/Library_solver.mk
+++ b/sccomp/Library_solver.mk
@@ -38,6 +38,7 @@ $(eval $(call gb_Library_use_libraries,solver,\
 	cppuhelper \
 	sal \
 	tl \
+	i18nisolang1 \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/svl/inc/svl/inettype.hxx b/svl/inc/svl/inettype.hxx
index 9764528..a68d791 100644
--- a/svl/inc/svl/inettype.hxx
+++ b/svl/inc/svl/inettype.hxx
@@ -22,7 +22,7 @@
 
 #include "svl/svldllapi.h"
 #include <tools/inetmime.hxx>
-#include <com/sun/star/lang/Locale.hpp>
+#include <i18npool/languagetag.hxx>
 
 //============================================================================
 /** Definitions for frequently used media type names.
@@ -259,7 +259,7 @@ public:
     static rtl::OUString GetContentType(INetContentType eTypeID);
 
     static OUString GetPresentation(INetContentType eTypeID,
-                                    const ::com::sun::star::lang::Locale& aLocale);
+                                    const LanguageTag& aLocale);
 
     static INetContentType GetContentType4Extension(OUString const & rExtension);
 
diff --git a/svl/source/items/ctypeitm.cxx b/svl/source/items/ctypeitm.cxx
index 7d3da74..b62254c 100644
--- a/svl/source/items/ctypeitm.cxx
+++ b/svl/source/items/ctypeitm.cxx
@@ -157,7 +157,7 @@ SfxItemPresentation CntContentTypeItem::GetPresentation(
         if (pIntlWrapper)
             (const_cast< CntContentTypeItem * >(this))->_aPresentation
              = INetContentTypes::GetPresentation(GetEnumValue(),
-                     pIntlWrapper->getLanguageTag().getLocale());
+                     pIntlWrapper->getLanguageTag());
     }
     if (!_aPresentation.isEmpty())
     {
diff --git a/svl/source/misc/getstringresource.cxx b/svl/source/misc/getstringresource.cxx
index 22d5cad..866fd8f 100644
--- a/svl/source/misc/getstringresource.cxx
+++ b/svl/source/misc/getstringresource.cxx
@@ -23,7 +23,7 @@
 
 #include "boost/noncopyable.hpp"
 #include "boost/scoped_ptr.hpp"
-#include "com/sun/star/lang/Locale.hpp"
+#include <i18npool/languagetag.hxx>
 #include "rtl/instance.hxx"
 #include "rtl/ustrbuf.hxx"
 #include "rtl/ustring.hxx"
@@ -39,7 +39,7 @@ class ResMgrMap: private boost::noncopyable {
 public:
     ~ResMgrMap();
 
-    SimpleResMgr * get(css::lang::Locale const & locale);
+    SimpleResMgr * get(LanguageTag const & locale);
 
 private:
     typedef std::map< rtl::OUString, SimpleResMgr * > Map;
@@ -58,11 +58,8 @@ ResMgrMap::~ResMgrMap() {
     }
 }
 
-SimpleResMgr * ResMgrMap::get(css::lang::Locale const & locale) {
-    rtl::OUStringBuffer buf(locale.Language);
-    buf.append(sal_Unicode('-'));
-    buf.append(locale.Country);
-    rtl::OUString code(buf.makeStringAndClear());
+SimpleResMgr * ResMgrMap::get(LanguageTag const & locale) {
+    OUString code( locale.getBcp47());
     Map::iterator i(map_.find(code));
     if (i == map_.end()) {
         boost::scoped_ptr< SimpleResMgr > mgr(
@@ -79,7 +76,7 @@ struct theResMgrMap: public rtl::Static< ResMgrMap, theResMgrMap > {};
 
 namespace svl {
 
-rtl::OUString getStringResource(sal_uInt16 id, css::lang::Locale const & locale)
+rtl::OUString getStringResource(sal_uInt16 id, LanguageTag const & locale)
 {
     return theResMgrMap::get().get(locale)->ReadString(id);
 }
diff --git a/svl/source/misc/getstringresource.hxx b/svl/source/misc/getstringresource.hxx
index 254765b..1410c15 100644
--- a/svl/source/misc/getstringresource.hxx
+++ b/svl/source/misc/getstringresource.hxx
@@ -32,7 +32,7 @@ namespace rtl { class OUString; }
 namespace svl {
 
 rtl::OUString getStringResource(
-    sal_uInt16 id, com::sun::star::lang::Locale const & locale);
+    sal_uInt16 id, LanguageTag const & locale);
 
 }
 
diff --git a/svl/source/misc/inettype.cxx b/svl/source/misc/inettype.cxx
index becc315..3687822 100644
--- a/svl/source/misc/inettype.cxx
+++ b/svl/source/misc/inettype.cxx
@@ -737,7 +737,7 @@ OUString INetContentTypes::GetContentType(INetContentType eTypeID)
 //============================================================================
 //static
 OUString INetContentTypes::GetPresentation(INetContentType eTypeID,
-                                            const ::com::sun::star::lang::Locale& aLocale)
+                                            const LanguageTag& aLocale)
 {
     sal_uInt16 nResID = sal_uInt16();
     if (eTypeID <= CONTENT_TYPE_LAST)
diff --git a/svtools/source/contnr/DocumentInfoPreview.cxx b/svtools/source/contnr/DocumentInfoPreview.cxx
index 76d8676..dd4aae2 100644
--- a/svtools/source/contnr/DocumentInfoPreview.cxx
+++ b/svtools/source/contnr/DocumentInfoPreview.cxx
@@ -91,7 +91,7 @@ void ODocumentInfoPreview::fill(
         }
         else
         {
-            insertNonempty( DI_MIMETYPE, INetContentTypes::GetPresentation(eTypeID, m_aLocale));
+            insertNonempty( DI_MIMETYPE, INetContentTypes::GetPresentation(eTypeID, LanguageTag(m_aLocale)));
         }
     }
 
diff --git a/svtools/source/filter/SvFilterOptionsDialog.cxx b/svtools/source/filter/SvFilterOptionsDialog.cxx
index 4f81901..c85de6f 100644
--- a/svtools/source/filter/SvFilterOptionsDialog.cxx
+++ b/svtools/source/filter/SvFilterOptionsDialog.cxx
@@ -210,7 +210,7 @@ sal_Int16 SvFilterOptionsDialog::execute()
 
             ResMgr*     pResMgr;
 
-            pResMgr = ResMgr::CreateResMgr( "svt", Application::GetSettings().GetUILanguageTag().getLocale() );
+            pResMgr = ResMgr::CreateResMgr( "svt", Application::GetSettings().GetUILanguageTag() );
             aFltCallDlgPara.pResMgr = pResMgr;
 
             aFltCallDlgPara.aFilterExt = aGraphicFilter.GetExportFormatShortName( nFormat );
diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx
index c8e98e2..e743556 100644
--- a/svtools/source/graphic/provider.cxx
+++ b/svtools/source/graphic/provider.cxx
@@ -280,7 +280,7 @@ uno::Reference< ::graphic::XGraphic > GraphicProvider::implLoadResource( const :
         rtl::OString aResMgrName(rtl::OUStringToOString(
             rResourceURL.getToken(0, '/', nIndex), RTL_TEXTENCODING_ASCII_US));
 
-        ResMgr* pResMgr = ResMgr::CreateResMgr( aResMgrName.getStr(), Application::GetSettings().GetUILanguageTag().getLocale() );
+        ResMgr* pResMgr = ResMgr::CreateResMgr( aResMgrName.getStr(), Application::GetSettings().GetUILanguageTag() );
 
         if( pResMgr )
         {
diff --git a/svtools/source/misc/ehdl.cxx b/svtools/source/misc/ehdl.cxx
index 89d43c2..c94ea3a 100644
--- a/svtools/source/misc/ehdl.cxx
+++ b/svtools/source/misc/ehdl.cxx
@@ -151,8 +151,7 @@ SfxErrorHandler::SfxErrorHandler(sal_uInt16 nIdP, sal_uLong lStartP, sal_uLong l
     RegisterDisplay(&aWndFunc);
     if( ! pMgr )
     {
-        com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale();
-        pFreeMgr = pMgr = ResMgr::CreateResMgr("ofa", aLocale );
+        pFreeMgr = pMgr = ResMgr::CreateResMgr("ofa", Application::GetSettings().GetUILanguageTag() );
     }
 }
 
@@ -278,8 +277,7 @@ sal_Bool SfxErrorHandler::GetClassString(sal_uLong lClassId, String &rStr) const
 
 {
     sal_Bool bRet = sal_False;
-    com::sun::star::lang::Locale aLocale( Application::GetSettings().GetUILanguageTag().getLocale() );
-    ResMgr* pResMgr = ResMgr::CreateResMgr("ofa", aLocale );
+    ResMgr* pResMgr = ResMgr::CreateResMgr("ofa", Application::GetSettings().GetUILanguageTag() );
     if( pResMgr )
     {
         ResId aId(RID_ERRHDL, *pResMgr );
@@ -407,8 +405,7 @@ sal_Bool SfxErrorContext::GetString(sal_uLong nErrId, OUString &rStr)
     ResMgr* pFreeMgr = NULL;
     if( ! pMgr )
     {
-        com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale();
-        pFreeMgr = pMgr = ResMgr::CreateResMgr("ofa", aLocale );
+        pFreeMgr = pMgr = ResMgr::CreateResMgr("ofa", Application::GetSettings().GetUILanguageTag() );
     }
     if( pMgr )
     {
diff --git a/svtools/source/misc/svtresid.cxx b/svtools/source/misc/svtresid.cxx
index 33ca09f..5efc447 100644
--- a/svtools/source/misc/svtresid.cxx
+++ b/svtools/source/misc/svtresid.cxx
@@ -25,7 +25,7 @@ static ResMgr* pMgr=NULL;
 
 namespace
 {
-    ResMgr* getResMgr(const ::com::sun::star::lang::Locale aLocale)
+    ResMgr* getResMgr(const LanguageTag& aLocale)
     {
         if (!pMgr)
             pMgr = ResMgr::CreateResMgr("svt", aLocale );
@@ -34,7 +34,7 @@ namespace
 
     ResMgr* getResMgr()
     {
-        return getResMgr(Application::GetSettings().GetUILanguageTag().getLocale());
+        return getResMgr(Application::GetSettings().GetUILanguageTag());
     }
 }
 
diff --git a/svx/source/dialog/dialmgr.cxx b/svx/source/dialog/dialmgr.cxx
index a171a9b..ad4b33f 100644
--- a/svx/source/dialog/dialmgr.cxx
+++ b/svx/source/dialog/dialmgr.cxx
@@ -32,7 +32,7 @@ static ResMgr* pResMgr=0;
 ResMgr* DialogsResMgr::GetResMgr()
 {
     if ( !pResMgr )
-        pResMgr = ResMgr::CreateResMgr( "svx", Application::GetSettings().GetUILanguageTag().getLocale() );
+        pResMgr = ResMgr::CreateResMgr( "svx", Application::GetSettings().GetUILanguageTag() );
 
     return pResMgr;
 }
diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx
index 1f10405..4a09e4b 100644
--- a/svx/source/form/datanavi.cxx
+++ b/svx/source/form/datanavi.cxx
@@ -788,7 +788,7 @@ namespace svxform
             // create a resource manager, for the svx resource file
             // and the UI locale
             ResMgr* pResMgr = ResMgr::CreateResMgr(
-                "svx", Application::GetSettings().GetUILanguageTag().getLocale() );
+                "svx", Application::GetSettings().GetUILanguageTag() );
 
             // load the resources for the AddSubmission modal dialog.
             // This will create our own resource context.
diff --git a/svx/source/gallery2/galmisc.cxx b/svx/source/gallery2/galmisc.cxx
index 9e3094f..fc6834f 100644
--- a/svx/source/gallery2/galmisc.cxx
+++ b/svx/source/gallery2/galmisc.cxx
@@ -65,7 +65,7 @@ ResMgr* GetGalleryResMgr()
     if( !pGalleryResMgr )
     {
         pGalleryResMgr = ResMgr::CreateResMgr(
-            "gal", Application::GetSettings().GetUILanguageTag().getLocale() );
+            "gal", Application::GetSettings().GetUILanguageTag() );
     }
 
     return pGalleryResMgr;
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index 686c41f..4fdc2bc 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -198,7 +198,7 @@ const String SgaObject::GetTitle() const
             {
                 rtl::OString aMgrName(rtl::OUStringToOString(aResourceName, RTL_TEXTENCODING_UTF8));
                 ResMgr* pResMgr = ResMgr::CreateResMgr( aMgrName.getStr(),
-                            Application::GetSettings().GetUILanguageTag().getLocale() );
+                            Application::GetSettings().GetUILanguageTag() );
                 if ( pResMgr )
                 {
                     ResId aResId( (sal_uInt16)nResId, *pResMgr );
diff --git a/svx/source/svdraw/svdetc.cxx b/svx/source/svdraw/svdetc.cxx
index 9fd5624..01358ec 100644
--- a/svx/source/svdraw/svdetc.cxx
+++ b/svx/source/svdraw/svdetc.cxx
@@ -436,7 +436,7 @@ ResMgr* ImpGetResMgr()
     if(!rGlobalData.pResMgr)
     {
         rGlobalData.pResMgr =
-            ResMgr::CreateResMgr( "svx", Application::GetSettings().GetUILanguageTag().getLocale() );
+            ResMgr::CreateResMgr( "svx", Application::GetSettings().GetUILanguageTag() );
     }
 
     return rGlobalData.pResMgr;
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index f6fd67b..3a6e1eb 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -71,11 +71,10 @@ void test::BootstrapFixture::setUp()
 
     // force locale (and resource files loaded) to en-US
 
-    lang::Locale aLocale( "en", "US", "");
-    ResMgr::SetDefaultLocale( aLocale );
+    OUString aLangISO( "en-US" );
+    ResMgr::SetDefaultLocale( LanguageTag( aLangISO) );
 
     SvtSysLocaleOptions aLocalOptions;
-    OUString aLangISO( "en-US" );
     aLocalOptions.SetLocaleConfigString( aLangISO );
     aLocalOptions.SetUILocaleConfigString( aLangISO );
 
diff --git a/toolkit/source/helper/tkresmgr.cxx b/toolkit/source/helper/tkresmgr.cxx
index ae19737..376cc51 100644
--- a/toolkit/source/helper/tkresmgr.cxx
+++ b/toolkit/source/helper/tkresmgr.cxx
@@ -55,9 +55,7 @@ void TkResMgr::ensureImplExists()
     if (m_pSimpleResMgr)
         return;
 
-    ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale();
-
-    m_pSimpleResMgr = SimpleResMgr::Create( "tk", aLocale );
+    m_pSimpleResMgr = SimpleResMgr::Create( "tk", Application::GetSettings().GetUILanguageTag() );
     m_pResMgr = ResMgr::CreateResMgr( "tk" );
 
     if (m_pSimpleResMgr)
diff --git a/tools/inc/tools/resmgr.hxx b/tools/inc/tools/resmgr.hxx
index 37aac4b..10bbfdc 100644
--- a/tools/inc/tools/resmgr.hxx
+++ b/tools/inc/tools/resmgr.hxx
@@ -20,10 +20,9 @@
 #define _TOOLS_RESMGR_HXX
 
 #include "tools/toolsdllapi.h"
-#include <i18npool/lang.h>
+#include <i18npool/languagetag.hxx>
 #include <tools/string.hxx>
 #include <tools/resid.hxx>
-#include <com/sun/star/lang/Locale.hpp>
 
 #include <vector>
 
@@ -136,11 +135,9 @@ public:
     /// Language-dependent resource library
     static const sal_Char*  GetLang( LanguageType& eLanguage, sal_uInt16 nPrio = 0 ); ///< @deprecated see "tools/source/rc/resmgr.cxx"
     static ResMgr*      SearchCreateResMgr( const sal_Char* pPrefixName,
-                                            com::sun::star::lang::Locale& rLocale );
+                                            LanguageTag& rLocale );
      static ResMgr*     CreateResMgr( const sal_Char* pPrefixName,
-                                      com::sun::star::lang::Locale aLocale = com::sun::star::lang::Locale( rtl::OUString(),
-                                                                                                           rtl::OUString(),
-                                                                                                           rtl::OUString()));
+                                      LanguageTag aLocale = LanguageTag( LANGUAGE_SYSTEM) );
 
     /// Test whether resource still exists
     void                TestStack( const Resource * );
@@ -198,7 +195,7 @@ public:
 
     static void         SetReadStringHook( ResHookProc pProc );
     static ResHookProc  GetReadStringHook();
-    static void         SetDefaultLocale( const com::sun::star::lang::Locale& rLocale );
+    static void         SetDefaultLocale( const LanguageTag& rLocale );
 };
 
 inline sal_uInt32 RSHEADER_TYPE::GetId()
diff --git a/tools/inc/tools/simplerm.hxx b/tools/inc/tools/simplerm.hxx
index 9c054ec..6176ad5 100644
--- a/tools/inc/tools/simplerm.hxx
+++ b/tools/inc/tools/simplerm.hxx
@@ -25,9 +25,8 @@
 
 #include <osl/mutex.hxx>
 #include <tools/resid.hxx>
-#include <i18npool/lang.h>
+#include <i18npool/languagetag.hxx>
 #include <tools/string.hxx>
-#include <com/sun/star/lang/Locale.hpp>
 #include "tools/toolsdllapi.h"
 
 class InternalResMgr;
@@ -45,17 +44,15 @@ public:
                                     in ThreadTextEncoding
                                 @param rLocale
                                     denotes the locale of the resource file to
-                                    load. If empty, a default locale will be used.
+                                    load. If empty (SYSTEM), a default locale will be used.
                             */
                             SimpleResMgr( const sal_Char* pPrefixName,
-                                          const ::com::sun::star::lang::Locale& _rLocale);
+                                          const LanguageTag& rLocale);
 
     virtual                 ~SimpleResMgr();
 
     static SimpleResMgr*    Create( const sal_Char* pPrefixName,
-                                      ::com::sun::star::lang::Locale aLocale = ::com::sun::star::lang::Locale( rtl::OUString(),
-                                                                                                               rtl::OUString(),
-                                                                                                               rtl::OUString()));// only in VCL
+                                    LanguageTag aLocale = LanguageTag( LANGUAGE_SYSTEM) );// only in VCL
 
     bool                    IsValid() const { return m_pResImpl != NULL; }
 
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index 7ef6523..42b9580 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -90,13 +90,13 @@ class InternalResMgr
     OUString                        aPrefix;
     OUString                        aResName;
     bool                            bSingular;
-    com::sun::star::lang::Locale    aLocale;
+    LanguageTag                     aLocale;
     boost::unordered_map<sal_uInt64, int>* pResUseDump;
 
                             InternalResMgr( const OUString& rFileURL,
                                             const OUString& aPrefix,
                                             const OUString& aResName,
-                                            const com::sun::star::lang::Locale& rLocale );
+                                            const LanguageTag& rLocale );
                             ~InternalResMgr();
     sal_Bool                Create();
 
@@ -126,9 +126,9 @@ class ResMgrContainer
     };
 
     boost::unordered_map< OUString, ContainerElement, OUStringHash> m_aResFiles;
-    com::sun::star::lang::Locale                             m_aDefLocale;
+    LanguageTag     m_aDefLocale;
 
-    ResMgrContainer() { init(); }
+    ResMgrContainer() : m_aDefLocale( LANGUAGE_SYSTEM) { init(); }
     ~ResMgrContainer();
 
     void init();
@@ -138,16 +138,16 @@ public:
     static void release();
 
     InternalResMgr* getResMgr( const OUString& rPrefix,
-                               com::sun::star::lang::Locale& rLocale,
+                               LanguageTag& rLocale,
                                bool bForceNewInstance = false
                                );
     InternalResMgr* getNextFallback( InternalResMgr* pResMgr );
 
     void freeResMgr( InternalResMgr* pResMgr );
 
-    void setDefLocale( const com::sun::star::lang::Locale& rLocale )
+    void setDefLocale( const LanguageTag& rLocale )
     { m_aDefLocale = rLocale; }
-    const com::sun::star::lang::Locale& getDefLocale() const
+    const LanguageTag& getDefLocale() const
     { return m_aDefLocale; }
 };
 
@@ -216,52 +216,33 @@ void ResMgrContainer::init()
 
     // set default language
     LanguageType nLang = MsLangId::getSystemUILanguage();
-    m_aDefLocale = LanguageTag( nLang).getLocale();
+    m_aDefLocale.reset( nLang);
 }
 
 namespace
 {
-    bool isAlreadyPureenUS(const com::sun::star::lang::Locale &rLocale)
+    bool isAlreadyPureenUS(const LanguageTag &rLocale)
     {
-        return ( rLocale.Language == "en" && rLocale.Country == "US" && rLocale.Variant.isEmpty() );
+        return ( rLocale.getLanguageType() == LANGUAGE_ENGLISH_US );
     }
 }
 
 InternalResMgr* ResMgrContainer::getResMgr( const OUString& rPrefix,
-                                            com::sun::star::lang::Locale& rLocale,
+                                            LanguageTag& rLocale,
                                             bool bForceNewInstance
                                             )
 {
-    com::sun::star::lang::Locale aLocale( rLocale );
-    OUStringBuffer aSearch( rPrefix.getLength() + 16 );
+    LanguageTag aLocale( rLocale );
     boost::unordered_map< OUString, ContainerElement, OUStringHash >::iterator it = m_aResFiles.end();
 
-    /* FIXME-BCP47: handle language tags! */
-    int nTries = 0;
-    if( !aLocale.Language.isEmpty() )
-        nTries = 1;
-    if( !aLocale.Country.isEmpty() )
-        nTries = 2;
-    if( !aLocale.Variant.isEmpty() )
-        nTries = 3;
-    while( nTries-- )
+    ::std::vector< OUString > aFallbacks( aLocale.getFallbackStrings());
+    if (!isAlreadyPureenUS( aLocale))
+        aFallbacks.push_back( "en-US");     // last resort if all fallbacks fail
+
+    for (::std::vector< OUString >::const_iterator fb( aFallbacks.begin()); fb != aFallbacks.end(); ++fb)
     {
-        aSearch.append( rPrefix );
-        if( nTries > -1 )
-        {
-            aSearch.append( aLocale.Language );
-        }
-        if( nTries > 0 )
-        {
-            aSearch.append( sal_Unicode('-') );
-            aSearch.append( aLocale.Country );
-        }
-        if( nTries > 1 )
-        {
-            aSearch.append( sal_Unicode('-') );
-            aSearch.append( aLocale.Variant );
-        }
-        it = m_aResFiles.find( aSearch.makeStringAndClear() );
+        OUString aSearch( rPrefix + *fb );
+        it = m_aResFiles.find( aSearch );
         if( it != m_aResFiles.end() )
         {
             // ensure InternalResMgr existance
@@ -278,20 +259,11 @@ InternalResMgr* ResMgrContainer::getResMgr( const OUString& rPrefix,
             }
             break;
         }
-        if( nTries == 0 && !isAlreadyPureenUS(aLocale) )
-        {
-            // locale fallback failed
-            // fallback to en-US locale
-            nTries = 2;
-            aLocale.Language = "en";
-            aLocale.Country  = "US";
-            aLocale.Variant = "";
-        }
     }
     // try if there is anything with this prefix at all
     if( it == m_aResFiles.end() )
     {
-        aLocale = com::sun::star::lang::Locale();
+        aLocale.reset( LANGUAGE_SYSTEM);
         it = m_aResFiles.find( rPrefix );
         if( it == m_aResFiles.end() )
         {
@@ -316,11 +288,13 @@ InternalResMgr* ResMgrContainer::getResMgr( const OUString& rPrefix,
                     }
                     // try to guess locale
                     sal_Int32 nIndex = rPrefix.getLength();
-                    aLocale.Language = it->first.getToken( 0, '-', nIndex );
-                    if( nIndex > 0 )
-                        aLocale.Country = it->first.getToken( 0, '-', nIndex );
-                    if( nIndex > 0 )
-                        aLocale.Variant = it->first.getToken( 0, '-', nIndex );
+                    if (nIndex < it->first.getLength())
+                        aLocale.reset( it->first.copy( nIndex));
+                    else
+                    {
+                        SAL_WARN( "tools.rc", "ResMgrContainer::getResMgr: it->first " <<
+                                it->first << " shorter than prefix " << rPrefix);
+                    }
                     break;
                 }
             }
@@ -329,20 +303,7 @@ InternalResMgr* ResMgrContainer::getResMgr( const OUString& rPrefix,
     // give up
     if( it == m_aResFiles.end() )
     {
-        /* FIXME-BCP47: handle language tags! */
-        OUStringBuffer sKey = rPrefix;
-        sKey.append( rLocale.Language );
-        if( !rLocale.Country.isEmpty() )
-        {
-            sKey.append( sal_Unicode('-') );
-            sKey.append( rLocale.Country );
-        }
-        if( !rLocale.Variant.isEmpty() )
-        {
-            sKey.append( sal_Unicode('-') );
-            sKey.append( rLocale.Variant );
-        } // if( !aLocale.Variant.isEmpty() )
-        OUString sURL = sKey.makeStringAndClear() + ".res";
+        OUString sURL = rPrefix + rLocale.getBcp47() + ".res";
         if ( m_aResFiles.find(sURL) == m_aResFiles.end() )
         {
             m_aResFiles[ sURL ].aFileURL = sURL;
@@ -390,17 +351,18 @@ InternalResMgr* ResMgrContainer::getResMgr( const OUString& rPrefix,
 
 InternalResMgr* ResMgrContainer::getNextFallback( InternalResMgr* pMgr )
 {
-    /* FIXME-BCP47: handle language tags! */
-    com::sun::star::lang::Locale aLocale = pMgr->aLocale;
-    if( !aLocale.Variant.isEmpty() )
-        aLocale.Variant = OUString();
-    else if( !aLocale.Country.isEmpty() )
-        aLocale.Country = OUString();
-    else if( !isAlreadyPureenUS(aLocale) )
-    {
-        aLocale.Language = "en";
-        aLocale.Country = "US";
-    }
+    /* TODO-BCP47: this is nasty, but the previous code simply stripped a
+     * locale's variant and country in subsequent calls to end up with language
+     * only and then fallback to en-US if all failed, so this is at least
+     * equivalent if not better. Maybe this method could be changed to get
+     * passed / remember a fallback list and an index within to pick the next.
+     * */
+
+    ::std::vector< OUString > aFallbacks( pMgr->aLocale.getFallbackStrings());
+    // The first is the locale itself, use next fallback or en-US.
+    /* TODO: what happens if the chain is "en-US", "en" -> "en-US", ...
+     * This was already an issue with the previous code. */
+    LanguageTag aLocale( ((aFallbacks.size() > 1) ? aFallbacks[1] : OUString( "en-US")));
     InternalResMgr* pNext = getResMgr( pMgr->aPrefix, aLocale, pMgr->bSingular );
     // prevent recursion
     if( pNext == pMgr || ( pNext && pNext->aResName.equals( pMgr->aResName ) ) )
@@ -459,7 +421,7 @@ static ResHookProc pImplResHookProc = 0;
 InternalResMgr::InternalResMgr( const OUString& rFileURL,
                                 const OUString& rPrefix,
                                 const OUString& rResName,
-                                const com::sun::star::lang::Locale& rLocale )
+                                const LanguageTag& rLocale )
     : pContent( NULL )
     , pStringBlock( NULL )
     , pStm( NULL )
@@ -1322,11 +1284,7 @@ ResMgr* ResMgr::CreateFallbackResMgr( const ResId& rId, const Resource* pResourc
             // check that the fallback locale is not already in the chain of
             // fallbacks - prevent fallback loops
             ResMgr* pResMgr = this;
-            while( pResMgr &&
-                   ( pResMgr->pImpRes->aLocale.Language != pRes->aLocale.Language ||
-                     pResMgr->pImpRes->aLocale.Country  != pRes->aLocale.Country  ||
-                     pResMgr->pImpRes->aLocale.Variant  != pRes->aLocale.Variant )
-                 )
+            while( pResMgr && (pResMgr->pImpRes->aLocale != pRes->aLocale))
             {
                 pResMgr = pResMgr->pOriginalResMgr;
             }
@@ -1556,14 +1514,13 @@ const char* ResMgr::GetLang( LanguageType& nType, sal_uInt16 nPrio )
 }
 
 ResMgr* ResMgr::CreateResMgr( const sal_Char* pPrefixName,
-                              com::sun::star::lang::Locale aLocale )
+                              LanguageTag aLocale )
 {
     osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
 
     OUString aPrefix( pPrefixName, strlen( pPrefixName ), osl_getThreadTextEncoding() );
 
-    /* FIXME-BCP47: handle language tags! */
-    if( aLocale.Language.isEmpty() )
+    if( aLocale.isSystemLocale() )
         aLocale = ResMgrContainer::get().getDefLocale();
 
     InternalResMgr* pImp = ResMgrContainer::get().getResMgr( aPrefix, aLocale );
@@ -1572,14 +1529,13 @@ ResMgr* ResMgr::CreateResMgr( const sal_Char* pPrefixName,
 
 ResMgr* ResMgr::SearchCreateResMgr(
     const sal_Char* pPrefixName,
-    com::sun::star::lang::Locale& rLocale )
+    LanguageTag& rLocale )
 {
     osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
 
     OUString aPrefix( pPrefixName, strlen( pPrefixName ), osl_getThreadTextEncoding() );
 
-    /* FIXME-BCP47: handle language tags! */
-    if( rLocale.Language.isEmpty() )
+    if( rLocale.isSystemLocale() )
         rLocale = ResMgrContainer::get().getDefLocale();
 
     InternalResMgr* pImp = ResMgrContainer::get().getResMgr( aPrefix, rLocale );
@@ -1770,7 +1726,7 @@ ResHookProc ResMgr::GetReadStringHook()
     return pImplResHookProc;
 }
 
-void ResMgr::SetDefaultLocale( const com::sun::star::lang::Locale& rLocale )
+void ResMgr::SetDefaultLocale( const LanguageTag& rLocale )
 {
     osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
     ResMgrContainer::get().setDefLocale( rLocale );
@@ -1782,14 +1738,13 @@ const OUString& ResMgr::GetFileName() const
 }
 
 SimpleResMgr::SimpleResMgr( const sal_Char* pPrefixName,
-                            const ::com::sun::star::lang::Locale& rLocale )
+                            const LanguageTag& rLocale )
 {
     OUString aPrefix( pPrefixName, strlen( pPrefixName ), osl_getThreadTextEncoding() );
-    com::sun::star::lang::Locale aLocale( rLocale );
+    LanguageTag aLocale( rLocale );
 
     osl::Guard<osl::Mutex> aGuard( getResMgrMutex() );
-    /* FIXME-BCP47: handle language tags! */
-    if( aLocale.Language.isEmpty() )
+    if( aLocale.isSystemLocale() )
         aLocale = ResMgrContainer::get().getDefLocale();
 
     m_pResImpl = ResMgrContainer::get().getResMgr( aPrefix, aLocale, true );
@@ -1801,7 +1756,7 @@ SimpleResMgr::~SimpleResMgr()
     delete m_pResImpl;
 }
 
-SimpleResMgr* SimpleResMgr::Create( const sal_Char* pPrefixName, com::sun::star::lang::Locale aLocale )
+SimpleResMgr* SimpleResMgr::Create( const sal_Char* pPrefixName, LanguageTag aLocale )
 {
     return new SimpleResMgr( pPrefixName, aLocale );
 }
@@ -1845,9 +1800,7 @@ rtl::OUString SimpleResMgr::ReadString( sal_uInt32 nId )
             if( pFallback )
             {
                 // handle possible recursion
-                if( pFallback->aLocale.Language != m_pResImpl->aLocale.Language ||
-                    pFallback->aLocale.Country  != m_pResImpl->aLocale.Country  ||
-                    pFallback->aLocale.Variant  != m_pResImpl->aLocale.Variant )
+                if( pFallback->aLocale != m_pResImpl->aLocale )
                 {
                     pResHeader = (RSHEADER_TYPE*)pFallback->LoadGlobalRes( RSC_STRING, nId, &pResHandle );
                 }
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 14b33ea..d7f3081 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -616,7 +616,7 @@ void Application::SetSettings( const AllSettings& rSettings )
     {
         GetSettings();
         *pSVData->maAppData.mpSettings = rSettings;
-        ResMgr::SetDefaultLocale( rSettings.GetUILanguageTag().getLocale() );
+        ResMgr::SetDefaultLocale( rSettings.GetUILanguageTag() );
     }
     else
     {
@@ -627,7 +627,7 @@ void Application::SetSettings( const AllSettings& rSettings )
             delete pSVData->mpResMgr;
             pSVData->mpResMgr = NULL;
         }
-        ResMgr::SetDefaultLocale( rSettings.GetUILanguageTag().getLocale() );
+        ResMgr::SetDefaultLocale( rSettings.GetUILanguageTag() );
         *pSVData->maAppData.mpSettings = rSettings;
         sal_uLong nChangeFlags = aOldSettings.GetChangeFlags( *pSVData->maAppData.mpSettings );
         if ( nChangeFlags )
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index 9540529..f919af6 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -175,7 +175,7 @@ ResMgr* ImplGetResMgr()
     ImplSVData* pSVData = ImplGetSVData();
     if ( !pSVData->mpResMgr )
     {
-        ::com::sun::star::lang::Locale aLocale = Application::GetSettings().GetUILanguageTag().getLocale();
+        LanguageTag aLocale( Application::GetSettings().GetUILanguageTag());
         pSVData->mpResMgr = ResMgr::SearchCreateResMgr( VCL_CREATERESMGR_NAME( vcl ), aLocale );
 
         static bool bMessageOnce = false;
diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx
index 2070b76..f031b55 100644
--- a/vcl/source/filter/graphicfilter.cxx
+++ b/vcl/source/filter/graphicfilter.cxx
@@ -825,7 +825,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r
 {
     Graphic     aGraphic;
 
-    ResMgr*     pResMgr = ResMgr::CreateResMgr( "svt", Application::GetSettings().GetUILanguageTag().getLocale() );
+    ResMgr*     pResMgr = ResMgr::CreateResMgr( "svt", Application::GetSettings().GetUILanguageTag() );
 
     sal_Int32 nLogicalWidth = rConfigItem.ReadInt32( "LogicalWidth", 0 );
     sal_Int32 nLogicalHeight = rConfigItem.ReadInt32( "LogicalHeight", 0 );
diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx b/writerfilter/source/rtftok/rtftokenizer.cxx
index 3515c8b..a19beac 100644
--- a/writerfilter/source/rtftok/rtftokenizer.cxx
+++ b/writerfilter/source/rtftok/rtftokenizer.cxx
@@ -83,7 +83,7 @@ int RTFTokenizer::resolveParse()
 
     if (m_xStatusIndicator.is())
     {
-        static ResMgr* pResMgr = ResMgr::CreateResMgr("svx", Application::GetSettings().GetUILanguageTag().getLocale());
+        static ResMgr* pResMgr = ResMgr::CreateResMgr("svx", Application::GetSettings().GetUILanguageTag());
         OUString sDocLoad(ResId(RID_SVXSTR_DOC_LOAD, *pResMgr).toString());
 
         sal_uInt32 nCurrentPos = Strm().Tell();
diff --git a/xmlsecurity/Library_xmlsecurity.mk b/xmlsecurity/Library_xmlsecurity.mk
index 45f7f7d..bd00996 100644
--- a/xmlsecurity/Library_xmlsecurity.mk
+++ b/xmlsecurity/Library_xmlsecurity.mk
@@ -53,6 +53,7 @@ $(eval $(call gb_Library_use_libraries,xmlsecurity,\
 	utl \
 	vcl \
 	xo \
+	i18nisolang1 \
 	$(gb_UWINAPI) \
 ))
 
commit ba4df3dd31ee9b2ced2a9119ecfd263e95de5ee6
Author: Eike Rathke <erack at redhat.com>
Date:   Fri Mar 29 13:45:04 2013 +0100

    lol, rtl::OString("dbu").getStr()
    
    Change-Id: I17569815c069fc2acd3a7c81ce48905f321534e9

diff --git a/dbaccess/source/ui/misc/moduledbu.cxx b/dbaccess/source/ui/misc/moduledbu.cxx
index b18e7c0..768ad83 100644
--- a/dbaccess/source/ui/misc/moduledbu.cxx
+++ b/dbaccess/source/ui/misc/moduledbu.cxx
@@ -77,7 +77,7 @@ ResMgr* OModuleImpl::getResManager()
     if (!m_pResources)
     {
         // create a manager with a fixed prefix
-        m_pResources = ResMgr::CreateResMgr(rtl::OString("dbu").getStr());
+        m_pResources = ResMgr::CreateResMgr("dbu");
     }
     return m_pResources;
 }
commit 5f96fa16cb541851d8401dfa4ac22af1596406ee
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Mar 28 22:10:10 2013 +0100

    FIXME-BCP47
    
    Change-Id: Id328608bcab49513d044c5029f87c5d1c21cedd2

diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx
index 507c902..314c22f 100644
--- a/unotools/source/config/pathoptions.cxx
+++ b/unotools/source/config/pathoptions.cxx
@@ -472,6 +472,7 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() :
     }
 
     // Set language type!
+    /* FIXME-BCP47 */
     OUString aLocaleStr( ConfigManager::getLocale() );
     sal_Int32 nIndex = 0;
     m_aLocale.Language = aLocaleStr.getToken(0, '-', nIndex );
commit 6f4bceef5906c535127fc78c3cc0353b8472eefa
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Mar 28 20:48:18 2013 +0100

    ditch this overengineered nonsense
    
    The umpteenth implementation to parse a partial language tag.
    
    Change-Id: Idaab568acdeb578d174f0968feae6db711120b55

diff --git a/desktop/source/deployment/misc/dp_resource.cxx b/desktop/source/deployment/misc/dp_resource.cxx
index f20941e..0cf266e 100644
--- a/desktop/source/deployment/misc/dp_resource.cxx
+++ b/desktop/source/deployment/misc/dp_resource.cxx
@@ -26,6 +26,7 @@
 #include "rtl/ustring.h"
 #include "cppuhelper/implbase1.hxx"
 #include "unotools/configmgr.hxx"
+#include <i18npool/languagetag.hxx>
 
 
 using namespace ::com::sun::star;
@@ -75,127 +76,10 @@ String getResourceString( sal_uInt16 id )
     return ret;
 }
 
-//throws an Exception on failure
-//primary subtag 2 or three letters(A-Z, a-z), i or x
-void checkPrimarySubtag(::rtl::OUString const & tag)
-{
-    sal_Int32 len = tag.getLength();
-    sal_Unicode const * arLang = tag.getStr();
-    if (len < 1 || len > 3)
-        throw Exception("Invalid language string.", 0);
-
-    if (len == 1
-        && (arLang[0] != 'i' && arLang[0] != 'x'))
-        throw Exception("Invalid language string.", 0);
-
-    if (len == 2 || len == 3)
-    {
-        for (sal_Int32 i = 0; i < len; i++)
-        {
-            if ( !((arLang[i] >= 'A' && arLang[i] <= 'Z')
-                || (arLang[i] >= 'a' && arLang[i] <= 'z')))
-            {
-                throw Exception("Invalid language string.", 0);
-            }
-        }
-    }
-}
-
-//throws an Exception on failure
-//second subtag 2 letter country code or 3-8 letter other code(A-Z, a-z, 0-9)
-void checkSecondSubtag(::rtl::OUString const & tag, bool & bIsCountry)
-{
-    sal_Int32 len = tag.getLength();
-    sal_Unicode const * arLang = tag.getStr();
-    if (len < 2 || len > 8)
-        throw Exception("Invalid language string.", 0);
-    //country code
-    bIsCountry = false;
-    if (len == 2)
-    {
-        for (sal_Int32 i = 0; i < 2; i++)
-        {
-            if (!( (arLang[i] >= 'A' && arLang[i] <= 'Z')
-                || (arLang[i] >= 'a' && arLang[i] <= 'z')))
-            {
-                throw Exception("Invalid language string.", 0);
-            }
-        }
-        bIsCountry = true;
-    }
-
-    if (len > 2)
-    {
-        for (sal_Int32 i = 0; i < len; i++)
-        {
-            if (!( (arLang[i] >= 'A' && arLang[i] <= 'Z')
-                || (arLang[i] >= 'a' && arLang[i] <= 'z')
-                || (arLang[i] >= '0' && arLang[i] <= '9') ))
-            {
-                throw Exception("Invalid language string.", 0);
-            }
-        }
-    }
-}
-
-void checkThirdSubtag(::rtl::OUString const & tag)
-{
-    sal_Int32 len = tag.getLength();
-    sal_Unicode const * arLang = tag.getStr();
-    if (len < 1 || len > 8)
-        throw Exception("Invalid language string.", 0);
-
-    for (sal_Int32 i = 0; i < len; i++)
-    {
-        if (!( (arLang[i] >= 'A' && arLang[i] <= 'Z')
-            || (arLang[i] >= 'a' && arLang[i] <= 'z')
-            || (arLang[i] >= '0' && arLang[i] <= '9') ))
-        {
-            throw Exception("Invalid language string.", 0);
-        }
-    }
-}
-
 //=============================================================================
-
-//We parse the string acording to RFC 3066
-//We only use the primary sub-tag and two subtags. That is lang-country-variant
-//We do some simple tests if the string is correct. Actually this should do a
-//validating parser
-//We may have the case that there is no country tag, for example en-welsh
 ::com::sun::star::lang::Locale toLocale( ::rtl::OUString const & slang )
 {
-    OUString _sLang = slang.trim();
-    ::com::sun::star::lang::Locale locale;
-    sal_Int32 nIndex = 0;
-    OUString lang = _sLang.getToken( 0, '-', nIndex );
-    checkPrimarySubtag(lang);
-    locale.Language = lang;
-    OUString country = _sLang.getToken( 0, '-', nIndex );
-    if (!country.isEmpty())
-    {
-        bool bIsCountry = false;
-        checkSecondSubtag(country, bIsCountry);
-        if (bIsCountry)
-        {
-            locale.Country = country;
-        }
-        else
-        {
-             locale.Variant = country;
-        }
-    }
-    if (locale.Variant.isEmpty())
-    {
-        OUString variant = _sLang.getToken( 0, '-', nIndex );
-        if (!variant.isEmpty())
-        {
-            checkThirdSubtag(variant);
-            locale.Variant = variant;
-        }
-    }
-
-    return locale;
+    return LanguageTag( slang).getLocale();
 }
 
 //==============================================================================
commit 80bbe6d1ca9605a94fd028845bda1242cc13a9ba
Author: Eike Rathke <erack at redhat.com>
Date:   Thu Mar 28 16:12:17 2013 +0100

    slightly optimized operator==() and equals()
    
    Change-Id: I05bacddf8cf61adbbcaed03c83ae42b06e76160a

diff --git a/i18npool/source/languagetag/languagetag.cxx b/i18npool/source/languagetag/languagetag.cxx
index 99b12cf..16b81d8 100644
--- a/i18npool/source/languagetag/languagetag.cxx
+++ b/i18npool/source/languagetag/languagetag.cxx
@@ -1120,6 +1120,11 @@ LanguageTag & LanguageTag::makeFallback()
 
 bool LanguageTag::equals( const LanguageTag & rLanguageTag, bool bResolveSystem ) const
 {
+    // If SYSTEM is not to be resolved or either both are SYSTEM or none, we
+    // can use the operator==() optimization.
+    if (!bResolveSystem || isSystemLocale() == rLanguageTag.isSystemLocale())
+        return operator==( rLanguageTag);
+
     // Compare full language tag strings.
     return getBcp47( bResolveSystem) == rLanguageTag.getBcp47( bResolveSystem);
 }
@@ -1127,6 +1132,16 @@ bool LanguageTag::equals( const LanguageTag & rLanguageTag, bool bResolveSystem
 
 bool LanguageTag::operator==( const LanguageTag & rLanguageTag ) const
 {
+    if (isSystemLocale() && rLanguageTag.isSystemLocale())
+        return true;    // both SYSTEM
+
+    // No need to convert to BCP47 if both Lang-IDs are available.
+    if (mbInitializedLangID && rLanguageTag.mbInitializedLangID)
+    {
+        // Equal if same ID and no SYSTEM is involved or both are SYSTEM.
+        return mnLangID == rLanguageTag.mnLangID && isSystemLocale() == rLanguageTag.isSystemLocale();
+    }
+
     // Compare full language tag strings but SYSTEM unresolved.
     return getBcp47( false) == rLanguageTag.getBcp47( false);
 }


More information about the Libreoffice-commits mailing list