diff options
author | Eike Rathke <erack@redhat.com> | 2013-03-29 14:07:33 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-03-29 14:09:01 +0100 |
commit | 5be14df2444d9fcc3518c5f54872c87b924e3e98 (patch) | |
tree | 5a0b3b4b588469e9ff012c3a3328bdb224843160 /desktop | |
parent | ba4df3dd31ee9b2ced2a9119ecfd263e95de5ee6 (diff) |
ResMgr with LanguageTag
Change-Id: Ie5ce9157a7ea59db7b0509fbaec61d07f8f9edf0
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/Library_deploymentmisc.mk | 1 | ||||
-rw-r--r-- | desktop/Library_unopkgapp.mk | 1 | ||||
-rw-r--r-- | desktop/source/app/app.cxx | 6 | ||||
-rw-r--r-- | desktop/source/deployment/misc/dp_resource.cxx | 2 | ||||
-rw-r--r-- | desktop/source/lib/init.cxx | 4 | ||||
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_cmdenv.cxx | 2 | ||||
-rw-r--r-- | desktop/source/pkgchk/unopkg/unopkg_shared.h | 13 |
7 files changed, 10 insertions, 19 deletions
diff --git a/desktop/Library_deploymentmisc.mk b/desktop/Library_deploymentmisc.mk index 544ebc348589..f0c01dc69dd6 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 a0f678ab162b..8f79d0ffe64d 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 e9301bf6f9ec..3eb4ab10305b 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 0cf266e9102b..2073578e1988 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 06f5eac909d0..5108ecc18cd7 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 3a782ca75ffe..3368f75300bf 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 93afa9091e0e..4340e9f8c30a 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() ) ); } }; |