Bug 160582 - FILEOPEN: CSV, locale setting is not preserved in the import window (regression tdf#152336)
Summary: FILEOPEN: CSV, locale setting is not preserved in the import window (regressi...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.8.0.0 alpha0+
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:25.2.0
Keywords: bibisectNotNeeded, regression
Depends on: 152336
Blocks: CSV-Dialog
  Show dependency treegraph
 
Reported: 2024-04-08 08:57 UTC by m_a_riosv
Modified: 2024-10-31 07:59 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample file csv to test (192 bytes, application/vnd.ms-excel)
2024-04-08 08:57 UTC, m_a_riosv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description m_a_riosv 2024-04-08 08:57:00 UTC
With
Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 5ebdcc60701ca5f2d267f92fa69ac06202309c52
CPU threads: 16; OS: Windows 10.0 Build 22631; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
Calc: CL threaded

After tdf#152336 improvement.

The issue is that now, locale setting is not preserved in the import window. As was the case until 24.2.
Seems it is reset to the default locale in my case es-ES.
Comment 1 m_a_riosv 2024-04-08 08:57:38 UTC
Created attachment 193564 [details]
Sample file csv to test
Comment 2 ady 2024-04-08 19:56:12 UTC
Using 24.8 alpha built 2024-04-08, I can confirm that the regional setting in the import dialog is taken from menu Tools > Options > Languages and Locales > (Formats) Locale setting.

I modified both the UI language and the Locale setting Options to different values. After restarting LO, the "Locale" setting in the import dialog changed according to the "Locale setting:" field used in Options.

I have not tested the other field in the import dialog, "Character set".

Version: 24.8.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 748561425774fa40ab685fed80d113f7e8301158
Comment 3 m_a_riosv 2024-04-09 21:00:10 UTC
I don't know if bibisectRequest is right here.

We know that the issue was introduced with the tdf#152336 improvement. And Gabriel is working on it.
Comment 4 Markus Keller 2024-06-12 12:20:11 UTC
Locale is the option where the guess is most likely to be wrong.
But the same problem (bad guess) can just as well apply to the other options.

The user should have a way to choose whether they want to use their specific settings or have LibreOffice take a guess.

Full-fledged templates (bug 62828) would be one possible solution. But I think it would be enough to have one of these options:

a) automatically guess, but offer a button to restore last manually chosen options
b) always use the last manually chosen option, but offer a "Guess" button

My personal preference would be (b).
Comment 5 Gabriel Masei 2024-06-12 12:39:20 UTC
(In reply to Markus Keller from comment #4)
> Locale is the option where the guess is most likely to be wrong.
> But the same problem (bad guess) can just as well apply to the other options.
> 
> The user should have a way to choose whether they want to use their specific
> settings or have LibreOffice take a guess.
> 
> Full-fledged templates (bug 62828) would be one possible solution. But I
> think it would be enough to have one of these options:
> 
> a) automatically guess, but offer a button to restore last manually chosen
> options
> b) always use the last manually chosen option, but offer a "Guess" button
> 
> My personal preference would be (b).

And we chose the second option.

Take a look at this proposed patch: https://gerrit.libreoffice.org/c/core/+/165905

Best,
Gabriel
Comment 6 Commit Notification 2024-10-09 12:49:53 UTC
Gabriel Masei committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/565b619d57a3b98b0826c4b49dee6606f9ae70e0

tdf#160582 Preserve settings saving in csv import dialog

It will be available in 25.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 BogdanB 2024-10-12 16:29:14 UTC
In this bug I am not sure what is happening, it is a bibisect request still opened, the bug has a patch, but is still in New status.
Comment 8 ady 2024-10-12 17:49:58 UTC
(In reply to BogdanB from comment #7)
> In this bug I am not sure what is happening, it is a bibisect request still
> opened, the bug has a patch, but is still in New status.

The bibisect is not needed. Changing that.

The report should rather be assigned to Gabriel Masei, if he agrees. The problem was initially introduced in the 24.8 branch (and for 25.2 master) for tdf#152336. ATM, the patches for tdf#152336 are reverted by Xisco.

If the patch in tdf#160582 comment 6 (for 25.2 master) is still relevant, then a back-port of it for LO 24.8 might still be needed. That is for developers (Gabriel Masei and Xisco) to evaluate.

I guess that the problem reported in comment 0 should rather be re-tested with a newer dev version of the 24.2 branch.

Additionally, if/when a new patch for tdf#152336 gets pushed, then this tdf#160582 should rather be re-tested again (perhaps with the introduction of some automatic unit test?).
Comment 9 Xisco Faulí 2024-10-15 15:33:22 UTC
(In reply to ady from comment #8)
> If the patch in tdf#160582 comment 6 (for 25.2 master) is still relevant,
> then a back-port of it for LO 24.8 might still be needed. That is for
> developers (Gabriel Masei and Xisco) to evaluate.

Hi Ady,
The original patch was reverted in libreoffice-24-8 branch. See 68da28d3c68a6c5800bb2163b4514e7fce83c71b, thus it doesn't need any backporting
Comment 10 Xisco Faulí 2024-10-15 15:37:23 UTC
@Gabriel, should this issue be closed as RESOLVED FIXED after 565b619d57a3b98b0826c4b49dee6606f9ae70e0 ?
OTOH, I think it should be mentioned in https://wiki.documentfoundation.org/ReleaseNotes/25.2
Comment 11 Gabriel Masei 2024-10-15 15:54:12 UTC
(In reply to Xisco Faulí from comment #10)
> @Gabriel, should this issue be closed as RESOLVED FIXED after
> 565b619d57a3b98b0826c4b49dee6606f9ae70e0 ?

Yes, I think so. Just check that it doesn't reproduce anymore. It's been some time since I provided the fix... For me, locally, it seems to be fixed.

> OTOH, I think it should be mentioned in
> https://wiki.documentfoundation.org/ReleaseNotes/25.2

I don't know the procedure but to me it looks just normal to be mentioned since it adds a new option in CSV Import Dialog.
Comment 12 Gabor Kelemen (allotropia) 2024-10-31 07:59:54 UTC
Verified in

Version: 25.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: b0195d40f3abc343b88f767f4fe109a9c1d44347
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: hu-HU (hu_HU.UTF-8); UI: en-US
Calc: threaded

the Character Set field keeps its last value between restarts.