diff options
author | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-10-01 21:03:36 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2010-10-01 21:04:38 +0200 |
commit | c6b9f0c3412c58a0b0d0296847c4f8df9d337bb1 (patch) | |
tree | afd6bb32a27d94f356b2057cd9fe3238df82259b | |
parent | 01ba95284dc65a884c5140b39753e1d26a6fd808 (diff) |
fdo #50533: Localized the links from the start center
-rw-r--r-- | framework/source/services/backingwindow.cxx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/framework/source/services/backingwindow.cxx b/framework/source/services/backingwindow.cxx index a7d8709917..c5244281bf 100644 --- a/framework/source/services/backingwindow.cxx +++ b/framework/source/services/backingwindow.cxx @@ -945,12 +945,6 @@ IMPL_LINK( BackingWindow, ToolboxHdl, void*, EMPTYARG ) // extend the URLs with Office locale argument INetURLObject aURLObj( sURL ); - rtl::OUString sParam = aURLObj.GetParam(); - rtl::OUStringBuffer aURLBuf( sParam ); - if ( sParam.getLength() > 0 ) - aURLBuf.appendAscii( "&" ); - aURLBuf.appendAscii( "lang=" ); - // read locale from configuration ::rtl::OUString sLocale; ::rtl::OUString sPackage = ::rtl::OUString::createFromAscii("org.openoffice.Setup"); @@ -968,13 +962,15 @@ IMPL_LINK( BackingWindow, ToolboxHdl, void*, EMPTYARG ) catch(const com::sun::star::uno::RuntimeException& exRun) { throw exRun; } catch(const com::sun::star::uno::Exception&) - { sLocale = ::rtl::OUString::createFromAscii("en-US"); } + { sLocale = ::rtl::OUString::createFromAscii("en"); } - aURLBuf.append(sLocale); + // Convert the URL to something that can be handled by the website + if ( sLocale.equalsAscii( "pt-BR" ) ) + sLocale = ::rtl::OUString::createFromAscii( "pt-br" ); + else + sLocale = sLocale.copy( 0, sLocale.indexOf( sal_Unicode( '-' ) ) ); - sParam = aURLBuf.makeStringAndClear(); - - aURLObj.SetParam( sParam ); + aURLObj.insertName( sLocale ); sURL = aURLObj.GetMainURL( INetURLObject::NO_DECODE ); Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute( |