Bug 45830 - Language/User Interface: current choice indicated as default
Summary: Language/User Interface: current choice indicated as default
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Linguistic (show other bugs)
(earliest affected)
3.5.0 release
Hardware: All All
: medium minor
Assignee: Rob Snelders
QA Contact:
Whiteboard: target:3.6.0 target:3.7.0
Depends on:
Reported: 2012-02-09 05:03 UTC by Lionel Elie Mamane
Modified: 2012-07-09 11:58 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:

This fixes the default locale-option in the list (1.08 KB, patch)
2012-05-27 03:35 UTC, Rob Snelders
new patch that solves the problem in langbox.cxx (1.14 KB, patch)
2012-05-29 14:28 UTC, Rob Snelders

Note You need to log in before you can comment on or make changes to this bug.
Description Lionel Elie Mamane 2012-02-09 05:03:15 UTC
$ locale|grep -v '"'

Launch LibreOffice. By default LibO UI starts in English. That's good and correct. Now, go to Tools / Options / Language Settings / Languages. Choose "French (France)" for "User Interface".

Restart LibreOffice. Go back to same option (outils / options / paramètres linguistiques / Interface Utilisateur): the choice "par défaut" says "Français (France)".

At this point, the user is told that with his/her setup, the default language is french. Choose the "Par défaut - Français (France)" entry. Restart LibO. LibO is now in English.

Same with Dutch (Netherlands). The "Standaard" option says "Standaard - Nederlands (NL)".

So in short: the language show as the one by default is the *current* language. It should be the actual default language. In my case, it should be "par défaut - Anglais (USA)" with French UI and "Standaard - Engels (VS)" with Dutch UI.
Comment 1 sasha.libreoffice 2012-05-16 03:06:57 UTC
Thanks for bugreport
reproduced in 3.5.2 on Windows 7 32 bit
Comment 2 Rob Snelders 2012-05-26 08:29:15 UTC
It is not that hard. But the function on /core/i18npool/source/isolang/mslangid.cxx:92 (getRealLanguage) will need to be duplicated and changed so you can hard select the system-language from /core/svx/source/dialog/langbox.cxx:352 (ImplInsertLanguage). I'll ask the usability-list first if this is the wanted behavior.
Comment 3 Rob Snelders 2012-05-27 03:35:20 UTC
Created attachment 62137 [details]
This fixes the default locale-option in the list

I have created a patch that corrects the name of the default locale to the system default. When you selected the option then it would use the default locale but the name wasn't the default locale but the currently selected locale. So now the name corresponds with the option.

The Default Currency isn't updated correctly, but that will need to be looked at what the behavior should be, because I can see multiple ways it could be working.
Comment 4 Not Assigned 2012-05-28 08:00:00 UTC
Rob Snelders committed a patch related to this issue.
It has been pushed to "master":


fdo#45830: Indicate correct default locale setting
Comment 5 Caolán McNamara 2012-05-28 08:36:10 UTC
caolanm->erack: I'm not entirely sure this is the best fix without fallout elsewhere ?
Comment 6 Lubos Lunak 2012-05-29 07:23:54 UTC
This change causes a check failure in sc_subsequent_filters_test , I've reverted the commit.
Comment 7 Not Assigned 2012-05-29 07:33:36 UTC
LuboÅ¡ LuÅak committed a patch related to this issue.
It has been pushed to "master":


Revert "fdo#45830: Indicate correct default locale setting"
Comment 8 Rob Snelders 2012-05-29 14:28:10 UTC
Created attachment 62242 [details]
new patch that solves the problem in langbox.cxx

I changed the patch so that it is solved in SvxLanguageBox::ImplInsertLanguage. The only function that calls it with the LANGUAGE_SYSTEM-option is the optgdlg (OptionsDialog->Language). Is it correct this way or is a new function needed as not to disturb the current function?
Comment 9 Eike Rathke 2012-05-31 08:05:06 UTC
Unfortunately this patch breaks locale inheritance.
The default locale of the number formatter follows the locale setting configured under Tools->Languages.
With the patch, the number formatter's default locale is offered as the system's locale, not the configured locale.
Code pointer: cui/source/tabpages/numfmt.cxx line 323 of SvxNumberFormatTabPage::Init_Impl()

    aLbLanguage.InsertLanguage( LANGUAGE_SYSTEM );

Other places that probably are affected:
sc/source/ui/dbgui/scuiasciiopt.cxx:403:    aLbCustomLang.InsertLanguage(LANGUAGE_SYSTEM);
sc/source/ui/dbgui/tpsort.cxx:660:    aLbLanguage.InsertLanguage( LANGUAGE_SYSTEM );
Comment 10 Rob Snelders 2012-06-01 08:07:09 UTC
would it then be better to create a define like LANGUAGE_OS or LOCALE_OS with the 0x04FE value? The 0x0001-value is already taken so that isn't possible.
Then add an case for this option to the getRealLanguage in /core/i18npool/source/isolang/mslangid.cxx line 92?
Comment 11 Eike Rathke 2012-06-06 13:44:41 UTC
You mean use a new LANGUAGE_OS ID just for the case of the configuration dialog? Might work. Why 0x04FE? Because it's one less than 0x04FF? ;-)
It's worth to check with available MS resources if there's already an ID that would suit our needs, or if 0x04FE clashes with something, pointers are available at http://erack.de/bookmarks/D.html#GIL_MS
Comment 12 Rob Snelders 2012-06-07 12:35:05 UTC
The links you provide are mostly the same as there is in the code.
When you look at the links it would logically be LOCALE_SYSTEM_DEFAULT (0x0800) or better LANGUAGE_PROCESS_OR_USER_DEFAULT (0x0400). But they are in i18npool/source/isolang/mslangid.cxx:76 both changed in LANGUAGE_SYSTEM. When reading the text where they are defined (i18npool/inc/i18npool/lang.h:399) then that is specifically set for the import/export of MS Documents. So I don't know if they can be changed but I don't think so.

The only "free" options I see for this are the CUSTOM-locales as shown on: http://msdn.microsoft.com/en-us/library/dd373763%28v=vs.85%29.aspx
Comment 13 Eike Rathke 2012-06-28 17:05:08 UTC
adds a new define LANGUAGE_USER_SYSTEM_CONFIG for which it should be possible to implement a second condition similar to the approach of the last patch in comment #8 and pass that value from the configuration dialog instead of LANGUAGE_SYSTEM
Comment 14 Rob Snelders 2012-07-08 11:57:06 UTC
Uploaded a new patch to gerrit: https://gerrit.libreoffice.org/267
Comment 15 Eike Rathke 2012-07-09 10:33:10 UTC
As a side note: please don't mark bugs as resolved fixed before the fix is actually committed to the repository. Your patch was just pending in gerrit for review, but it works fine and I just approved and committed it, so it doesn't matter here.
Comment 16 Not Assigned 2012-07-09 10:35:45 UTC
Rob Snelders committed a patch related to this issue.
It has been pushed to "master":


- fdo#45830 - Language/User Interface: current choice indicated as default
Comment 17 Not Assigned 2012-07-09 10:43:31 UTC
Rob Snelders committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":


- fdo#45830 - Language/User Interface: current choice indicated as default

It will be available in LibreOffice 3.6.
Comment 18 Not Assigned 2012-07-09 11:58:42 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-3-6":


added LANGUAGE_USER_SYSTEM_CONFIG 0xFFFE for configuration context fdo#45830

It will be available in LibreOffice 3.6.