Bug 73063 - FILESAVE: LibreOffice Calc does not remember locale settings when saving as .xls or .xlsx
Summary: FILESAVE: LibreOffice Calc does not remember locale settings when saving as ....
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: BSA target:6.2.0
Keywords: filter:xls, filter:xlsx
Depends on:
Blocks: XLSX XLS
  Show dependency treegraph
 
Reported: 2013-12-27 12:01 UTC by Borivoje Petrovic
Modified: 2018-08-22 17:51 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Example of .xlsx file with Serbian date (cyrilic), created with MS Excel365. It is working correctly with Excel but not with LO (7.56 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-07-29 22:43 UTC, Bartosz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Borivoje Petrovic 2013-12-27 12:01:17 UTC
Problem description: 

Steps to reproduce:
1. Set the cell value as DATE and choose non-default (non-English) language (Serbian)
2. Save file as .xls
3. Reopen the file.

Current behavior:

Locale is restored to default (English-US)

Expected behavior:

Preserve the intended formatting.
              
Operating System: Ubuntu
Version: 4.1.4.2 release
Comment 1 A (Andy) 2013-12-27 13:24:05 UTC
reproducible with LO 4.1.4.2 (Win7 Home, 64bit), 
also reproducible with the xlsx file type, 
with the ods file type it works fine and the formatting is preserved
Comment 2 Michal Thoma 2014-06-06 13:05:20 UTC
Bug still present in 4.2.3.3

Also it seems that same or similar problem affect spellchecking:

1 - Change cell languge (under Font tab) to non-default.
2 - Save document as either xls or xlsx
3 - Open again and check language setting - it's not preserverd, language is back to default.

Expected:

Languge setting should always be preserved.
Comment 3 QA Administrators 2015-06-08 14:42:35 UTC Comment hidden (obsolete)
Comment 4 Bartosz 2016-07-29 22:43:57 UTC
Created attachment 126478 [details]
Example of .xlsx file with Serbian date (cyrilic), created with MS Excel365. It is working correctly with Excel but not with LO
Comment 5 Massimo Balestra 2017-02-26 19:16:31 UTC
I happens also on LibreOffice 5.2.5.1.
I have Libreoffice in English but I need to show some date cells in Italian: I select the cell format as Italian, the format NNNNGG MMMM AAAA HH:mm, save as xlsx, close Calc, reopen with Libreoffice Calc. The language is back to English, if I re-open the cell format and change again the language I have to re-enter from scratch the format too.
If I save as ods the language format is preserved.
Comment 6 QA Administrators 2018-02-27 03:34:04 UTC Comment hidden (obsolete)
Comment 7 Aron Budea 2018-05-14 01:16:00 UTC
Bug still in LO 6.1 alpha1.
Comment 8 Eike Rathke 2018-08-20 18:04:24 UTC
Taking a stab at this.
Comment 9 Eike Rathke 2018-08-20 19:58:52 UTC
(In reply to Bartosz from comment #4)
> Created attachment 126478 [details]
> Example of .xlsx file with Serbian date (cyrilic), created with MS Excel365.
> It is working correctly with Excel but not with LO
Note that the LCID 0x1C1A used there is for sr-BA Serbian Cyrillic (Bosnia and Herzegovina) for which no locale data exists yet in LibreOffice. Locales without locale data fall back to en-US in number formatter context.
If it was a locale with locale data, for example 0x281A for sr-RS Serbian Cyrillic (Serbia), then the proper formatting using Cyrillic day and month names would be displayed and the format added to that locale's section.
However, saving with locale information to Excel file formats currently is not possible, working on that.

If someone could provide locale data for sr-BA that would be most welcome, see https://wiki.documentfoundation.org/LibreOffice_Localization_Guide/How_To_Submit_New_Locale_Data
Comment 10 Commit Notification 2018-08-20 20:18:03 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=b262e4e691d71defa5aa45e6bd647f112e1513c4

Avoid searching "[DBNum" if not inserted, tdf#73063 prep

It will be available in 6.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2018-08-21 08:23:35 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=195c1cfb16a9513e496c2bc2179c282344df9926

No LCID if no format code, tdf#73063 prep

It will be available in 6.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2018-08-22 10:47:17 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5f7d8f68886065a316cb0b88b8364a789bc5c0bf

Related: tdf#73063 strip a plain locale identifier if locale data is available

It will be available in 6.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 13 Commit Notification 2018-08-22 17:03:51 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=d0f8daa0980ba8e403b32006831657c5a0a4ea17

Resolves: tdf#73063 preserve and roundtrip LCID from/to Excel number formats

It will be available in 6.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 14 Eike Rathke 2018-08-22 17:51:42 UTC
It's unclear yet whether Excel really accepts the [$-...] LCID notation in every number format type, but that's what is written now if a dedicated locale (non-default-system) is set in the number formatter UI

Testing by people having access to various MS-Excel and -Word products would be highly appreciated; in LibreOffice apply for example Italian (Italy) number formats of all categories (Number (General, 0, 0.00), Percent, Currency, ...) to cells and save to .xlsx, that then should have [$-410] LCID values in number format codes such as
<numFmt numFmtId="..." formatCode="[$-410]..."
elements in the xl/styles.xml stream.

Hopefully Excel will load and not complain about any and even handle them as intended..