Issue 90820

Summary: resource manager does not have set default locale
Product: utilities Reporter: pmladek <pmladek>
Component: codeAssignee: carsten.driesner
Status: CLOSED FIXED QA Contact: Unknown <non-migrated>
Severity: Trivial    
Priority: P3 CC: carsten.driesner, issues, philipp.lohmann
Version: OOo 2.4.1 RC2   
Target Milestone: OOo 3.1   
Hardware: All   
OS: All   
Issue Type: PATCH Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
Proposed fix. none

Description pmladek 2008-06-17 19:35:10 UTC
It comes from https://bugzilla.novell.com/show_bug.cgi?id=399101. The unopkg
tool displayed messages in random locales.

unopkg initializes the resource manages the following way:

--- cut desktop/source/pkgchk/unopkg/unopkg_shared.h ---
struct DeploymentResMgr :  public rtl::StaticWithInit< ResMgr *, DeploymentResMgr > 
{
        ResMgr * operator () () {
                return ResMgr::CreateResMgr( "deployment" LIBRARY_SOLARUPD() );
        }
};
--- cut desktop/source/pkgchk/unopkg/unopkg_shared.h ---

=> it does not define any locale. ResMgr::CreateResMgr does the following when
the locale is not defined:

--- cut tools/source/rc/resmgr.cxx ---
    if( ! aLocale.Language.getLength() )
        aLocale = ResMgrContainer::get().getDefLocale();    
--- cut tools/source/rc/resmgr.cxx ---

Unfortunately, the default locale is defined only by 
ResMgrContainer::setDefLocale. It is called on various locations, for example:

--- cut desktop/source/app/app.cxx ---
            // LanguageSelection langselect;
            OUString aUILocaleString = LanguageSelection::getLanguageString();
            sal_Int32 nIndex = 0;
            OUString aLanguage = aUILocaleString.getToken( 0, '-', nIndex);
            OUString aCountry = aUILocaleString.getToken( 0, '-', nIndex);
            OUString aVariant = aUILocaleString.getToken( 0, '-', nIndex);

            ::com::sun::star::lang::Locale aLocale( aLanguage, aCountry, aVariant );

            Desktop::pResMgr = ResMgr::SearchCreateResMgr( U2S( aMgrName ),
aLocale);
            AllSettings as = GetSettings();
            as.SetUILocale(aLocale);
            SetSettings(as);
--- cut desktop/source/app/app.cxx ---

but not in unopkg.

I attach a simple patch that sets the default locale in ResMgrContainer::init();
It might help to remove hacks from the other locations where the resource
manager is initialized.
Comment 1 pmladek 2008-06-17 19:36:38 UTC
Created attachment 54547 [details]
Proposed fix.
Comment 2 carsten.driesner 2008-06-27 08:31:04 UTC
cd->sb: Please check the patch from pmladek.
Comment 3 Stephan Bergmann 2008-06-27 09:14:15 UTC
and back to cd  ;)
Comment 4 carsten.driesner 2008-06-27 10:27:46 UTC
cd->sb: Sorry, didn't read the description of the patch carefully enough.

cd->pl: What do you think about the changes provided by pmladek in
ResMgrContainer::init()? I think using the system ui language at first is a good
starting point. The best guess would be using the system locale. There are
languages which are not supported by the UI of an operating system, but the
specific locale can be set.
Comment 5 philipp.lohmann 2008-06-27 16:15:11 UTC
seems to be ok
Comment 6 carsten.driesner 2008-06-30 13:14:56 UTC
cd: Patch accepted.
Comment 7 carsten.driesner 2008-07-02 13:01:21 UTC
cd: Too late for OOo 3.0. I will apply the patch to CWS fwk92, targeted to OOo 3.1.
Comment 8 carsten.driesner 2008-07-02 15:55:22 UTC
cd: Fixed. Patch applied to CWS fwk92.
Comment 9 carsten.driesner 2008-12-01 09:05:08 UTC
cd: Patch is part of the CWS. Verified.
Comment 10 thorsten.ziehm 2009-07-20 14:55:30 UTC
This issue is closed automatically and wasn't rechecked in a current version of
OOo. The fixed issue should be integrated in OOo since more than half a year. If
you think this issue isn't fixed in a current version (OOo 3.1), please reopen
it and change the field 'Target Milestone' accordingly.

If you want to download a current version of OOo =>
http://download.openoffice.org/index.html
If you want to know more about the handling of fixed/verified issues =>
http://wiki.services.openoffice.org/wiki/Handle_fixed_verified_issues
Comment 11 thorsten.ziehm 2009-07-20 15:35:44 UTC
Sorry this issue was wrongly closed. This issue will be reopened automatically.
And will be set after that back to fixed/verified.
Comment 12 thorsten.ziehm 2009-07-20 15:40:08 UTC
Set to state 'fixed'.
Comment 13 thorsten.ziehm 2009-07-20 15:44:20 UTC
Set back to state 'verified/fixed'.

Again. Sorry for the mass of mails.
Comment 14 thorsten.ziehm 2010-02-22 15:33:17 UTC
This issue is closed automatically. It should be fixed in a version with is
available for longer than half a year (OOo 3.1). If you think this issue isn't
fixed in the current version (OOo 3.2) please reopen it. But then please pay
attention about the field 'target milestone'.
The closure was approved by the Release Status Meeting at 22nd of February 2010
and it is based on the issue handling guideline for fixed/verified issues :
http://wiki.services.openoffice.org/wiki/Handle_fixed_verified_issues