Bug 100735 - Date format in the "Document in use" warning window is not localized (see comment #3)
Summary: Date format in the "Document in use" warning window is not localized (see com...
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 enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: difficultyMedium, easyHack
Depends on:
Blocks: User-Locale Dialog-Msgbox File-Lock
  Show dependency treegraph
 
Reported: 2016-07-02 08:07 UTC by Gabor Kelemen (allotropia)
Modified: 2025-06-20 03:11 UTC (History)
4 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 (noise)
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 (noise)
Comment 5 QA Administrators 2021-02-20 04:05:31 UTC Comment hidden (noise)
Comment 6 QA Administrators 2023-08-11 03:05:22 UTC Comment hidden (noise, obsolete)
Comment 7 Gabor Kelemen (allotropia) 2025-06-19 11:12:58 UTC
Still a problem in

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

setting easyhack per comment #3