Kaydet (Commit) e30f6a8c authored tarafından Eike Rathke's avatar Eike Rathke

tdf#119739 split ConfigManager::getLocale(), getUILocale(), getWorkLocale()

To prevent further confusion which is which, dbaccess
UserInformation already got that wrong since ever.

/org.openoffice.Setup/L10N/ooLocale is the UI locale.
/org.openoffice.Setup/L10N/ooSetupSystemLocale is the work locale.

Confusingly due to legacy when the setup program was a separate
binary that picked the UI ooLocale and later set up the default
(system) work locale as well.

Change-Id: I9a05ad39f5fb65c54076ff5789ba7a2cc06ad23a
Reviewed-on: https://gerrit.libreoffice.org/61725Reviewed-by: 's avatarEike Rathke <erack@redhat.com>
Tested-by: Jenkins
üst 5d5e0da5
......@@ -27,7 +27,7 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
UserInformation::UserInformation():
m_aUserLocale( LanguageTag( ConfigManager::getLocale()).getLocale())
m_aUserLocale( LanguageTag( ConfigManager::getWorkLocale()).getLocale())
{}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -1998,7 +1998,7 @@ void Desktop::OpenClients()
OUString aHelpURL = "vnd.sun.star.help://"
+ aHelpModule
+ "/start?Language="
+ utl::ConfigManager::getLocale();
+ utl::ConfigManager::getUILocale();
#if defined UNX
aHelpURL += "&System=UNX";
#elif defined WNT
......
......@@ -1086,7 +1086,7 @@ bool IpcThread::process(OString const & arguments, bool * waitProcessed) {
}
if (bShowHelp) {
aHelpURLBuffer.append("?Language=");
aHelpURLBuffer.append(utl::ConfigManager::getLocale());
aHelpURLBuffer.append(utl::ConfigManager::getUILocale());
#if defined UNX
aHelpURLBuffer.append("&System=UNX");
#elif defined WNT
......
......@@ -37,7 +37,7 @@ namespace {
struct OfficeLocale :
public rtl::StaticWithInit<LanguageTag, OfficeLocale> {
const LanguageTag operator () () {
OUString slang(utl::ConfigManager::getLocale());
OUString slang(utl::ConfigManager::getUILocale());
//fallback, the locale is currently only set when the user starts the
//office for the first time.
if (slang.isEmpty())
......
......@@ -155,7 +155,7 @@ void CommandEnvironmentImpl::printLicense(
Reference< css::i18n::XCollator > xCollator =
css::i18n::Collator::create( m_xComponentContext );
xCollator->loadDefaultCollator(
LanguageTag(utl::ConfigManager::getLocale()).getLocale(),
LanguageTag(utl::ConfigManager::getUILocale()).getLocale(),
css::i18n::CollatorOptions::CollatorOptions_IGNORE_CASE);
do
......
......@@ -655,7 +655,7 @@ void SubstitutePathVariables::SetPredefinedPathVariables()
// Detect the language type of the current office
m_aPreDefVars.m_eLanguageType = LANGUAGE_ENGLISH_US;
OUString aLocaleStr( utl::ConfigManager::getLocale() );
OUString aLocaleStr( utl::ConfigManager::getUILocale() );
m_aPreDefVars.m_eLanguageType = LanguageTag::convertToLanguageTypeWithFallback( aLocaleStr );
// We used to have an else branch here with a SAL_WARN, but that
// always fired in some unit tests when this code was built with
......
......@@ -43,7 +43,9 @@ public:
static OUString getDefaultCurrency();
static OUString getLocale();
static OUString getUILocale();
static OUString getWorkLocale();
static OUString getProductExtension();
......
......@@ -528,7 +528,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
{
OUString module = SfxHelp::GetCurrentModuleIdentifier();
OUString sURL("https://hub.libreoffice.org/send-feedback/?LOversion=" + utl::ConfigManager::getAboutBoxProductVersion() +
"&LOlocale=" + utl::ConfigManager::getLocale() + "&LOmodule=" + module.copy(module.lastIndexOf('.') + 1 ) );
"&LOlocale=" + utl::ConfigManager::getUILocale() + "&LOmodule=" + module.copy(module.lastIndexOf('.') + 1 ) );
sfx2::openUriExternally(sURL, false);
break;
}
......@@ -538,29 +538,29 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
// Askbot has URL's normalized to languages, not locales
// Get language from locale: ll or lll or ll-CC or lll-CC
OUString sURL("https://hub.libreoffice.org/forum/?LOlocale=" + utl::ConfigManager::getLocale());
OUString sURL("https://hub.libreoffice.org/forum/?LOlocale=" + utl::ConfigManager::getUILocale());
sfx2::openUriExternally(sURL, false);
break;
}
case SID_DOCUMENTATION:
{
// Open documentation page based on locales
OUString sURL("https://hub.libreoffice.org/documentation/?LOlocale=" + utl::ConfigManager::getLocale());
OUString sURL("https://hub.libreoffice.org/documentation/?LOlocale=" + utl::ConfigManager::getUILocale());
sfx2::openUriExternally(sURL, false);
break;
}
case SID_GETINVOLVED:
{
// Open get involved/join us page based on locales
OUString sURL("https://hub.libreoffice.org/joinus/?LOlocale=" + utl::ConfigManager::getLocale());
OUString sURL("https://hub.libreoffice.org/joinus/?LOlocale=" + utl::ConfigManager::getUILocale());
sfx2::openUriExternally(sURL, false);
break;
}
case SID_DONATION:
{
// Open donation page based on language + script (BCP47) with language as fall back.
OUString aLang = LanguageTag(utl::ConfigManager::getLocale()).getLanguage();
OUString aBcp47 = LanguageTag(utl::ConfigManager::getLocale()).getBcp47();
OUString aLang = LanguageTag(utl::ConfigManager::getUILocale()).getLanguage();
OUString aBcp47 = LanguageTag(utl::ConfigManager::getUILocale()).getBcp47();
OUString sURL("https://hub.libreoffice.org/donation/?BCP47=" + aBcp47 + "&LOlang=" + aLang );
sfx2::openUriExternally(sURL, false);
break;
......
......@@ -215,7 +215,7 @@ static OUString HelpLocaleString()
{
const OUString aEnglish("en-US");
// detect installed locale
aLocaleStr = utl::ConfigManager::getLocale();
aLocaleStr = utl::ConfigManager::getUILocale();
if ( aLocaleStr.isEmpty() )
aLocaleStr = aEnglish;
......@@ -263,7 +263,7 @@ static OUString HelpLocaleString()
aLocaleStr = sLang;
return aEnglish;
}
aLocaleStr = utl::ConfigManager::getLocale();
aLocaleStr = utl::ConfigManager::getUILocale();
return aLocaleStr;
}
}
......
......@@ -477,7 +477,7 @@ void SfxDocTplService_Impl::getDefaultLocale()
::osl::MutexGuard aGuard( maMutex );
if ( !mbLocaleSet )
{
maLocale = LanguageTag::convertToLocale( utl::ConfigManager::getLocale(), false);
maLocale = LanguageTag::convertToLocale( utl::ConfigManager::getUILocale(), false);
mbLocaleSet = true;
}
}
......
......@@ -1372,7 +1372,7 @@ IMPL_LINK_NOARG(SfxViewFrame, GetInvolvedHandler, Button*, void)
{
try
{
OUString sURL("https://hub.libreoffice.org/joinus/?LOlocale=" + utl::ConfigManager::getLocale());
OUString sURL("https://hub.libreoffice.org/joinus/?LOlocale=" + utl::ConfigManager::getUILocale());
sfx2::openUriExternally(sURL, false);
}
catch (const Exception&)
......
......@@ -118,7 +118,7 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent)
// Set URL for help button (module=safemode)
OUString sURL("http://hub.libreoffice.org/send-feedback/?LOversion=" + utl::ConfigManager::getAboutBoxProductVersion() +
"&LOlocale=" + utl::ConfigManager::getLocale() + "&LOmodule=safemode");
"&LOlocale=" + utl::ConfigManager::getUILocale() + "&LOmodule=safemode");
mpBugLink->SetURL(sURL);
mpUserProfileLink->SetURL(comphelper::BackupFileHelper::getUserProfileURL());
......
......@@ -108,12 +108,18 @@ OUString utl::ConfigManager::getDefaultCurrency() {
"L10N/ooSetupCurrency");
}
OUString utl::ConfigManager::getLocale() {
OUString utl::ConfigManager::getUILocale() {
return getConfigurationString(
"/org.openoffice.Setup",
"L10N/ooLocale");
}
OUString utl::ConfigManager::getWorkLocale() {
return getConfigurationString(
"/org.openoffice.Setup",
"L10N/ooSetupSystemLocale");
}
OUString utl::ConfigManager::getProductExtension() {
return getConfigurationString(
"/org.openoffice.Setup",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment