Kaydet (Commit) 37e36eca authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Related fdo#68240: Rework langselect to provide better error messages

...and in general removed lots of cruft from that code.

Change-Id: Ie673413d8abf5a8ec78c02f4abee2647bdf10a04
üst 38b58556
...@@ -36,7 +36,9 @@ ...@@ -36,7 +36,9 @@
#include "exithelper.h" #include "exithelper.h"
#include "migration.hxx" #include "migration.hxx"
#include <svl/languageoptions.hxx>
#include <svtools/javacontext.hxx> #include <svtools/javacontext.hxx>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/frame/AutoRecovery.hpp> #include <com/sun/star/frame/AutoRecovery.hpp>
#include <com/sun/star/frame/GlobalEventBroadcaster.hpp> #include <com/sun/star/frame/GlobalEventBroadcaster.hpp>
#include <com/sun/star/frame/SessionListener.hpp> #include <com/sun/star/frame/SessionListener.hpp>
...@@ -334,7 +336,7 @@ ResMgr* Desktop::GetDesktopResManager() ...@@ -334,7 +336,7 @@ ResMgr* Desktop::GetDesktopResManager()
// Use VCL to get the correct language specific message as we // Use VCL to get the correct language specific message as we
// are in the bootstrap process and not able to get the installed // are in the bootstrap process and not able to get the installed
// language!! // language!!
OUString aUILocaleString = LanguageSelection::getLanguageString(); OUString aUILocaleString = langselect::getEmergencyLocale();
LanguageTag aLanguageTag( aUILocaleString); LanguageTag aLanguageTag( aUILocaleString);
//! ResMgr may modify the Locale for fallback! //! ResMgr may modify the Locale for fallback!
Desktop::pResMgr = ResMgr::SearchCreateResMgr( "dkt", aLanguageTag); Desktop::pResMgr = ResMgr::SearchCreateResMgr( "dkt", aLanguageTag);
...@@ -580,13 +582,16 @@ void Desktop::Init() ...@@ -580,13 +582,16 @@ void Desktop::Init()
if ( m_aBootstrapError == BE_OK ) if ( m_aBootstrapError == BE_OK )
{ {
// prepare language try
if ( !LanguageSelection::prepareLanguage() )
{ {
if ( LanguageSelection::getStatus() == LanguageSelection::LS_STATUS_CANNOT_DETERMINE_LANGUAGE ) if (!langselect::prepareLocale())
{
SetBootstrapError( BE_LANGUAGE_MISSING, OUString() ); SetBootstrapError( BE_LANGUAGE_MISSING, OUString() );
else }
SetBootstrapError( BE_OFFICECONFIG_BROKEN, OUString() ); }
catch (css::uno::Exception & e)
{
SetBootstrapError( BE_OFFICECONFIG_BROKEN, e.Message );
} }
} }
...@@ -979,14 +984,15 @@ void Desktop::HandleBootstrapErrors( ...@@ -979,14 +984,15 @@ void Desktop::HandleBootstrapErrors(
} }
else if ( aBootstrapError == BE_OFFICECONFIG_BROKEN ) else if ( aBootstrapError == BE_OFFICECONFIG_BROKEN )
{ {
OUString aMessage; OUString msg(
OUStringBuffer aDiagnosticMessage( 100 ); GetMsgString(
OUString aErrorMsg; STR_CONFIG_ERR_ACCESS_GENERAL,
aErrorMsg = GetMsgString( STR_CONFIG_ERR_ACCESS_GENERAL, ("A general error occurred while accessing your central"
OUString( "A general error occurred while accessing your central configuration." ) ); " configuration.")));
aDiagnosticMessage.append( aErrorMsg ); if (!aErrorMessage.isEmpty()) {
aMessage = MakeStartupErrorMessage( aDiagnosticMessage.makeStringAndClear() ); msg += "\n(\"" + aErrorMessage + "\")";
FatalError(aMessage); }
FatalError(MakeStartupErrorMessage(msg));
} }
else if ( aBootstrapError == BE_USERINSTALL_FAILED ) else if ( aBootstrapError == BE_USERINSTALL_FAILED )
{ {
......
...@@ -17,424 +17,197 @@ ...@@ -17,424 +17,197 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include "sal/config.h"
#include "boost/shared_ptr.hpp"
#include "com/sun/star/configuration/theDefaultProvider.hpp"
#include "com/sun/star/container/XNameAccess.hpp"
#include "com/sun/star/lang/XLocalizable.hpp"
#include "com/sun/star/uno/Exception.hpp"
#include "com/sun/star/uno/Reference.hxx"
#include "com/sun/star/uno/Sequence.hxx"
#include "comphelper/configuration.hxx"
#include "comphelper/processfactory.hxx"
#include "i18nlangtag/lang.h"
#include "i18nlangtag/languagetag.hxx"
#include "i18nlangtag/mslangid.hxx"
#include "officecfg/Office/Linguistic.hxx"
#include "officecfg/Setup.hxx"
#include "officecfg/System.hxx"
#include "rtl/ustring.hxx"
#include "sal/log.hxx"
#include "sal/types.h"
#include "svl/languageoptions.hxx"
#include "app.hxx" #include "app.hxx"
#include "langselect.hxx"
#include "cmdlineargs.hxx"
#include <stdio.h>
#include <rtl/string.hxx>
#include <i18nlangtag/mslangid.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <comphelper/processfactory.hxx>
#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/util/XChangesBatch.hpp>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/lang/XLocalizable.hpp>
#include <com/sun/star/lang/Locale.hpp>
#include "com/sun/star/util/XFlushable.hpp"
#include <rtl/instance.hxx>
using namespace com::sun::star::uno; #include "cmdlineargs.hxx"
using namespace com::sun::star::lang; #include "langselect.hxx"
using namespace com::sun::star::container;
using namespace com::sun::star::beans;
using namespace com::sun::star::util;
namespace desktop { namespace langselect {
namespace desktop { namespace {
sal_Bool LanguageSelection::bFoundLanguage = sal_False; OUString foundLocale;
OUString LanguageSelection::aFoundLanguage;
LanguageSelection::LanguageSelectionStatus LanguageSelection::m_eStatus = LS_STATUS_OK;
bool LanguageSelection::prepareLanguage() OUString getInstalledLocale(
css::uno::Sequence<OUString> const & installed, OUString const & locale)
{ {
m_eStatus = LS_STATUS_OK; for (sal_Int32 i = 0; i != installed.getLength(); ++i) {
Reference< XLocalizable > theConfigProvider( if (installed[i] == locale) {
com::sun::star::configuration::theDefaultProvider::get( return installed[i];
comphelper::getProcessComponentContext() ),
UNO_QUERY_THROW );
sal_Bool bSuccess = sal_False;
// #i42730#get the windows 16Bit locale - it should be preferred over the UI language
try
{
Reference< XPropertySet > xProp(getConfigAccess("org.openoffice.System/L10N/", sal_False), UNO_QUERY_THROW);
Any aWin16SysLocale = xProp->getPropertyValue("SystemLocale");
OUString sWin16SysLocale;
aWin16SysLocale >>= sWin16SysLocale;
if( !sWin16SysLocale.isEmpty())
setDefaultLanguage(sWin16SysLocale);
}
catch(const Exception&)
{
m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
}
// #i32939# use system locale to set document default locale
try
{
OUString usLocale;
Reference< XPropertySet > xLocaleProp(getConfigAccess(
"org.openoffice.System/L10N", sal_True), UNO_QUERY_THROW);
xLocaleProp->getPropertyValue("Locale") >>= usLocale;
setDefaultLanguage(usLocale);
}
catch (const Exception&)
{
m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
}
// get the selected UI language as string
bool bCmdLanguage( false );
OUString aLocaleString = getUserUILanguage();
if ( aLocaleString.isEmpty() )
{
OUString aEmpty;
const CommandLineArgs& rCmdLineArgs = Desktop::GetCommandLineArgs();
aLocaleString = rCmdLineArgs.GetLanguage();
if (isInstalledLanguage(aLocaleString, sal_False))
{
bCmdLanguage = true;
bFoundLanguage = true;
aFoundLanguage = aLocaleString;
} }
else
aLocaleString = aEmpty;
} }
// FIXME: It is not very clever to handle the zh-HK -> zh-TW fallback here,
// user further fallbacks for the UI language // but right now, there is no place that handles those fallbacks globally:
if ( aLocaleString.isEmpty() ) if (locale == "zh-HK") {
aLocaleString = getLanguageString(); for (sal_Int32 i = 0; i != installed.getLength(); ++i) {
if (installed[i] == "zh-TW") {
if ( !aLocaleString.isEmpty() ) return installed[i];
{
try
{
// prepare default config provider by localizing it to the selected
// locale this will ensure localized configuration settings to be
// selected according to the UI language.
LanguageTag aUILanguageTag(aLocaleString);
theConfigProvider->setLocale(aUILanguageTag.getLocale( false));
Reference< XPropertySet > xProp(getConfigAccess("org.openoffice.Setup/L10N/", sal_True), UNO_QUERY_THROW);
if ( !bCmdLanguage )
{
// Store language only
xProp->setPropertyValue("ooLocale", makeAny(aLocaleString));
Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
} }
MsLangId::setConfiguredSystemUILanguage( aUILanguageTag.getLanguageType( false) );
OUString sLocale;
xProp->getPropertyValue("ooSetupSystemLocale") >>= sLocale;
if ( !sLocale.isEmpty() )
{
LanguageTag aLocaleLanguageTag(sLocale);
MsLangId::setConfiguredSystemLanguage( aLocaleLanguageTag.getLanguageType( false) );
}
else
MsLangId::setConfiguredSystemLanguage( MsLangId::getSystemLanguage() );
bSuccess = sal_True;
} }
catch ( const PropertyVetoException& ) }
{ for (sal_Int32 i = 0; i != installed.getLength(); ++i) {
// we are not allowed to change this if (locale.startsWith(installed[i])) {
} return installed[i];
catch (const Exception& e)
{
OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
OSL_FAIL(aMsg.getStr());
} }
} }
return OUString();
// #i32939# setting of default document locale
// #i32939# this should not be based on the UI language
setDefaultLanguage(aLocaleString);
return bSuccess;
} }
void LanguageSelection::setDefaultLanguage(const OUString& sLocale) void setMsLangIdFallback(OUString const & locale) {
{
// #i32939# setting of default document language // #i32939# setting of default document language
// See #i42730# for rules for determining source of settings // See #i42730# for rules for determining source of settings
if (!locale.isEmpty()) {
// determine script type of locale LanguageType type = LanguageTag::convertToLanguageType(locale);
LanguageType nLang = LanguageTag::convertToLanguageType(sLocale); switch (SvtLanguageOptions::GetScriptTypeOfLanguage(type)) {
sal_uInt16 nScriptType = SvtLanguageOptions::GetScriptTypeOfLanguage(nLang);
switch (nScriptType)
{
case SCRIPTTYPE_ASIAN: case SCRIPTTYPE_ASIAN:
MsLangId::setConfiguredAsianFallback( nLang ); MsLangId::setConfiguredAsianFallback(type);
break; break;
case SCRIPTTYPE_COMPLEX: case SCRIPTTYPE_COMPLEX:
MsLangId::setConfiguredComplexFallback( nLang ); MsLangId::setConfiguredComplexFallback(type);
break; break;
default: default:
MsLangId::setConfiguredWesternFallback( nLang ); MsLangId::setConfiguredWesternFallback(type);
break; break;
}
}
OUString LanguageSelection::getUserUILanguage()
{
// check whether the user has selected a specific language
OUString aUserLanguage = getUserLanguage();
if (!aUserLanguage.isEmpty() )
{
if (isInstalledLanguage(aUserLanguage))
{
// all is well
bFoundLanguage = sal_True;
aFoundLanguage = aUserLanguage;
return aFoundLanguage;
}
else
{
// selected language is not/no longer installed
resetUserLanguage();
}
}
return aUserLanguage;
}
OUString LanguageSelection::getLanguageString()
{
// did we already find a language?
if (bFoundLanguage)
return aFoundLanguage;
// check whether the user has selected a specific language
OUString aUserLanguage = getUserUILanguage();
if (!aUserLanguage.isEmpty() )
return aUserLanguage ;
// try to use system default
aUserLanguage = getSystemLanguage();
if (!aUserLanguage.isEmpty() )
{
if (isInstalledLanguage(aUserLanguage, sal_False))
{
// great, system default language is available
bFoundLanguage = sal_True;
aFoundLanguage = aUserLanguage;
return aFoundLanguage;
} }
} }
// fallback 1: en-US
OUString usFB("en-US");
if (isInstalledLanguage(usFB))
{
bFoundLanguage = sal_True;
aFoundLanguage = "en-US";
return aFoundLanguage;
}
// fallback didn't work use first installed language
aUserLanguage = getFirstInstalledLanguage();
bFoundLanguage = sal_True;
aFoundLanguage = aUserLanguage;
return aFoundLanguage;
} }
Reference< XNameAccess > LanguageSelection::getConfigAccess(const sal_Char* pPath, sal_Bool bUpdate)
{
Reference< XNameAccess > xNameAccess;
try{
OUString sAccessSrvc;
if (bUpdate)
sAccessSrvc = "com.sun.star.configuration.ConfigurationUpdateAccess";
else
sAccessSrvc = "com.sun.star.configuration.ConfigurationAccess";
OUString sConfigURL = OUString::createFromAscii(pPath);
Reference< XMultiServiceFactory > theConfigProvider(
com::sun::star::configuration::theDefaultProvider::get(
comphelper::getProcessComponentContext() ) );
// access the provider
Sequence< Any > theArgs(1);
theArgs[ 0 ] <<= sConfigURL;
xNameAccess = Reference< XNameAccess > (
theConfigProvider->createInstanceWithArguments(
sAccessSrvc, theArgs ), UNO_QUERY_THROW );
} catch (const com::sun::star::uno::Exception& e)
{
OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
OSL_FAIL(aMsg.getStr());
}
return xNameAccess;
} }
Sequence< OUString > LanguageSelection::getInstalledLanguages() OUString getEmergencyLocale() {
{ if (!foundLocale.isEmpty()) {
Sequence< OUString > seqLanguages; return foundLocale;
Reference< XNameAccess > xAccess = getConfigAccess("org.openoffice.Setup/Office/InstalledLocales", sal_False); }
if (!xAccess.is()) return seqLanguages; try {
seqLanguages = xAccess->getElementNames(); css::uno::Sequence<OUString> inst(
return seqLanguages; officecfg::Setup::Office::InstalledLocales::get()->
getElementNames());
OUString locale(
getInstalledLocale(
inst,
officecfg::Office::Linguistic::General::UILocale::get()));
if (!locale.isEmpty()) {
return locale;
}
locale = getInstalledLocale(
inst, officecfg::System::L10N::UILocale::UILocale::get());
if (!locale.isEmpty()) {
return locale;
}
locale = getInstalledLocale(inst, "en-US");
if (!locale.isEmpty()) {
return locale;
}
if (inst.hasElements()) {
return inst[0];
}
} catch (css::uno::Exception & e) {
SAL_WARN("desktop.app", "ignoring Exception \"" << e.Message << "\"");
}
return OUString();
} }
// FIXME bool prepareLocale() {
// it's not very clever to handle language fallbacks here, but // #i42730# Get the windows 16Bit locale, it should be preferred over the UI
// right now, there is no place that handles those fallbacks globally // locale:
static Sequence< OUString > _getFallbackLocales(const OUString& aIsoLang) setMsLangIdFallback(officecfg::System::L10N::SystemLocale::get());
{ // #i32939# Use system locale to set document default locale:
Sequence< OUString > seqFallbacks; setMsLangIdFallback(officecfg::System::L10N::Locale::get());
if ( aIsoLang == "zh-HK" ) { css::uno::Sequence<OUString> inst(
seqFallbacks = Sequence< OUString >(1); officecfg::Setup::Office::InstalledLocales::get()->getElementNames());
seqFallbacks[0] = "zh-TW"; OUString locale(officecfg::Office::Linguistic::General::UILocale::get());
} if (!locale.isEmpty()) {
return seqFallbacks; locale = getInstalledLocale(inst, locale);
} if (locale.isEmpty()) {
// Selected language is not/no longer installed:
sal_Bool LanguageSelection::isInstalledLanguage(OUString& usLocale, sal_Bool bExact) try {
{ boost::shared_ptr<comphelper::ConfigurationChanges> batch(
sal_Bool bInstalled = sal_False; comphelper::ConfigurationChanges::create());
Sequence< OUString > seqLanguages = getInstalledLanguages(); officecfg::Office::Linguistic::General::UILocale::set(
for (sal_Int32 i=0; i<seqLanguages.getLength(); i++) "", batch);
{ batch->commit();
if (usLocale.equals(seqLanguages[i])) } catch (css::uno::Exception & e) {
{ SAL_WARN(
bInstalled = sal_True; "desktop.app",
break; "ignoring Exception \"" << e.Message << "\"");
}
}
if (!bInstalled && !bExact)
{
// try fallback locales
Sequence< OUString > seqFallbacks = _getFallbackLocales(usLocale);
for (sal_Int32 j=0; j<seqFallbacks.getLength(); j++)
{
for (sal_Int32 i=0; i<seqLanguages.getLength(); i++)
{
if (seqFallbacks[j].equals(seqLanguages[i]))
{
bInstalled = sal_True;
usLocale = seqFallbacks[j];
break;
}
} }
} }
} }
bool cmdLanguage = false;
if (!bInstalled && !bExact) if (locale.isEmpty()) {
{ locale = getInstalledLocale(
// no exact match was found, well try to find a substitute inst, Desktop::GetCommandLineArgs().GetLanguage());
for (sal_Int32 i=0; i<seqLanguages.getLength(); i++) if (!locale.isEmpty()) {
{ cmdLanguage = true;
if (usLocale.indexOf(seqLanguages[i]) == 0)
{
// requested locale starts with the installed locale
// (i.e. installed locale has index 0 in requested locale)
bInstalled = sal_True;
usLocale = seqLanguages[i];
break;
}
}
}
return bInstalled;
}
OUString LanguageSelection::getFirstInstalledLanguage()
{
OUString aLanguage;
Sequence< OUString > seqLanguages = getInstalledLanguages();
if (seqLanguages.getLength() > 0)
aLanguage = seqLanguages[0];
return aLanguage;
}
OUString LanguageSelection::getUserLanguage()
{
OUString aUserLanguage;
Reference< XNameAccess > xAccess(getConfigAccess("org.openoffice.Office.Linguistic/General", sal_False));
if (xAccess.is())
{
try
{
xAccess->getByName("UILocale") >>= aUserLanguage;
}
catch ( NoSuchElementException const & )
{
m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
return OUString();
}
catch ( WrappedTargetException const & )
{
m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
return OUString();
} }
} }
return aUserLanguage; if (locale.isEmpty()) {
} locale = getInstalledLocale(
inst, officecfg::System::L10N::UILocale::UILocale::get());
OUString LanguageSelection::getSystemLanguage()
{
OUString aUserLanguage;
Reference< XNameAccess > xAccess(getConfigAccess("org.openoffice.System/L10N", sal_False));
if (xAccess.is())
{
try
{
xAccess->getByName("UILocale") >>= aUserLanguage;
}
catch ( NoSuchElementException const & )
{
m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
return OUString();
}
catch ( WrappedTargetException const & )
{
m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
return OUString();
}
} }
return aUserLanguage; if (locale.isEmpty()) {
} locale = getInstalledLocale(inst, "en-US");
void LanguageSelection::resetUserLanguage()
{
try
{
Reference< XPropertySet > xProp(getConfigAccess("org.openoffice.Office.Linguistic/General", sal_True), UNO_QUERY_THROW);
xProp->setPropertyValue("UILocale", makeAny(OUString()));
Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
} }
catch ( const PropertyVetoException& ) if (locale.isEmpty() && inst.hasElements()) {
{ locale = inst[0];
// we are not allowed to change this
} }
catch (const Exception& e) if (locale.isEmpty()) {
{ return false;
OString aMsg = OUStringToOString(e.Message, RTL_TEXTENCODING_ASCII_US);
OSL_FAIL(aMsg.getStr());
m_eStatus = LS_STATUS_CONFIGURATIONACCESS_BROKEN;
} }
LanguageTag tag(locale);
// Prepare default config provider by localizing it to the selected
// locale this will ensure localized configuration settings to be
// selected according to the UI language:
css::uno::Reference<css::lang::XLocalizable>(
com::sun::star::configuration::theDefaultProvider::get(
comphelper::getProcessComponentContext()),
css::uno::UNO_QUERY_THROW)->setLocale(tag.getLocale(false));
if (!cmdLanguage) {
try {
boost::shared_ptr<comphelper::ConfigurationChanges> batch(
comphelper::ConfigurationChanges::create());
officecfg::Setup::L10N::ooLocale::set(locale, batch);
batch->commit();
} catch (css::uno::Exception & e) {
SAL_WARN(
"desktop.app", "ignoring Exception \"" << e.Message << "\"");
}
}
MsLangId::setConfiguredSystemUILanguage(tag.getLanguageType(false));
OUString setupSysLoc(officecfg::Setup::L10N::ooSetupSystemLocale::get());
MsLangId::setConfiguredSystemLanguage(
setupSysLoc.isEmpty()
? MsLangId::getSystemLanguage()
: LanguageTag(setupSysLoc).getLanguageType(false));
// #i32939# setting of default document locale
// #i32939# this should not be based on the UI language
setMsLangIdFallback(locale);
foundLocale = locale;
return true;
} }
LanguageSelection::LanguageSelectionStatus LanguageSelection::getStatus() } }
{
return m_eStatus;
}
} // namespace desktop
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -17,49 +17,21 @@ ...@@ -17,49 +17,21 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <list> #ifndef INCLUDED_DESKTOP_SOURCE_APP_LANGSELECT_HXX
#include <sal/types.h> #define INCLUDED_DESKTOP_SOURCE_APP_LANGSELECT_HXX
#include <rtl/ustring.hxx>
#include <tools/resid.hxx>
#include <com/sun/star/lang/Locale.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <svl/languageoptions.hxx>
namespace desktop #include "sal/config.h"
{
class LanguageSelection #include "rtl/ustring.hxx"
{
public:
enum LanguageSelectionStatus
{
LS_STATUS_OK,
LS_STATUS_CANNOT_DETERMINE_LANGUAGE,
LS_STATUS_CONFIGURATIONACCESS_BROKEN
};
static OUString getLanguageString(); namespace desktop { namespace langselect {
static bool prepareLanguage();
static LanguageSelectionStatus getStatus();
private: OUString getEmergencyLocale();
static OUString aFoundLanguage;
static sal_Bool bFoundLanguage;
static LanguageSelectionStatus m_eStatus;
static com::sun::star::uno::Reference< com::sun::star::container::XNameAccess > bool prepareLocale();
getConfigAccess(const sal_Char* pPath, sal_Bool bUpdate=sal_False);
static com::sun::star::uno::Sequence< OUString > getInstalledLanguages();
static sal_Bool isInstalledLanguage(OUString& usLocale, sal_Bool bExact=sal_False);
static OUString getFirstInstalledLanguage();
static OUString getUserUILanguage();
static OUString getUserLanguage();
static OUString getSystemLanguage();
static void resetUserLanguage();
static void setDefaultLanguage(const OUString&);
};
} //namespace desktop } }
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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