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 | 63aca1792eeeaed2828af5be5b26b939dae3b7ad (patch) | |
tree | bd28e861370593da8ac7c2653a0f322e647d8a14 /framework/source | |
parent | d70d9fc878cbb9fc8c6eea72a0618ca432c931fb (diff) |
fdo #50533: Localized the links from the start center
Diffstat (limited to 'framework/source')
-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 8bb5ca5cbeaf..6d8f4992b830 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"); } - - aURLBuf.append(sLocale); + { sLocale = ::rtl::OUString::createFromAscii("en"); } - sParam = aURLBuf.makeStringAndClear(); + // 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( '-' ) ) ); - aURLObj.SetParam( sParam ); + aURLObj.insertName( sLocale ); sURL = aURLObj.GetMainURL( INetURLObject::NO_DECODE ); Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute( |