Bug 100735 - Date format in the "Document in use" warning window is not localized
Summary: Date format in the "Document in use" warning window is not localized
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: UI (show other bugs)
Version:
(earliest affected)
5.2.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: User-Locale Dialog-Msgbox File-Lock
  Show dependency treegraph
 
Reported: 2016-07-02 08:07 UTC by Gabor Kelemen (allotropia)
Modified: 2023-08-11 03:05 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Screenshot of the problem - date format is not localized (23.41 KB, image/png)
2016-07-02 08:07 UTC, Gabor Kelemen (allotropia)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gabor Kelemen (allotropia) 2016-07-02 08:07:36 UTC
Created attachment 126031 [details]
Screenshot of the problem - date format is not localized

If I try to open a document that is already opened in a different Office suite, I get a warning dialog that says:

Document file '$(ARG1)' is locked for editing by yourself on a different system since $(ARG2)\n\nOpen document read-only, or ignore own file locking and open the document for editing.\n\n"

$(ARG2) is a date in the DD.MM.YYYY HH:MM format, which is not localizable, 
I'd like to translate it to the YYYY. MM. DD HH:MM format.

The string comes from this file:
https://cgit.freedesktop.org/libreoffice/core/tree/uui/source/alreadyopen.src
and is used here:
https://cgit.freedesktop.org/libreoffice/core/tree/uui/source/iahndl-locking.cxx

and there is a counterpart of the string for the save case, with the same problem:

Document file '$(ARG1)' is locked for editing by yourself on a different system since $(ARG2)\n\nClose document on other system and retry saving or ignore own file locking and save current document.\n\n
Comment 1 Aron Budea 2016-07-07 01:23:39 UTC
Confirmed. Actually, date is already formatted as text when the lock file is written.
This is the piece of responsible code:

sprintf( pDateTime, "%02d.%02d.%4d %02d:%02d", aDateTime.Day, aDateTime.Month, aDateTime.Year, aDateTime.Hours, aDateTime.Minutes );
http://opengrok.libreoffice.org/xref/core/svl/source/misc/lockfilecommon.cxx#205


I wonder if there's a date formatter function that takes system locale into account. Searching for the type 'oslDateTime' returned a lot of similar hardcoded date/time formatting.
Comment 2 QA Administrators 2017-09-01 11:19:48 UTC Comment hidden (obsolete)
Comment 3 Mike Kaganski 2018-02-19 07:36:03 UTC
A clear candidate to easyhack.

What should be done:

1. Create a LockFileCommon method that would parse the time string back to TimeValue, and then format back to string using provided locale (it should presumably use locale's default datetime format).
2. This method should be used wherever currently the LockFileComponent::EDITTIME string is used (i.e., only when the need to display the string arises).

We should definitely not try to write localized string to lockfile.
Comment 4 QA Administrators 2019-02-20 03:47:55 UTC Comment hidden (obsolete)
Comment 5 QA Administrators 2021-02-20 04:05:31 UTC Comment hidden (obsolete)
Comment 6 QA Administrators 2023-08-11 03:05:22 UTC
Dear Gabor Kelemen,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug