Apache OpenOffice (AOO) Bugzilla – Issue 91170
Use strftime to populate field time/date list
Last modified: 2017-05-20 11:33:46 UTC
Currently, each native-language community has to localize manually the list of time/date formats that appear when you double-click on a time or date field. However, all these possible formats already exist, in strftime. Why not use strftime to pull those time/date formats from the locale? All the data is already there on the user's machine. We just plugin to it. For example: %c - local date & time\n %x - local date\n %X - local time\n but there are plenty of others.
Hi clytie, can you please point me to the code place where you modify the time/date filed?
Do you mean in the OpenOffice.org code? I'm afraid I don't know. These field formats show up in the application when you double-click on a field or cell formatted to display time or date. (Under Format > Cell(s), the date and time formats appear to be localized, but they weren't when I double-clicked on a test spreadsheet when testing a bug the other day.) I only know that other projects use strftime to populate this kind of data, to save having to specify it for each language. srtftime is installed by default on all Linux/UNIX systems (so that includes Mac OSX). If it isn't installed on Windows (though it well may be), it could be included with the application code.
NN, can you give me a hint what this issue is about. Is it L10N related or a code bug?!?
I suppose it's about the date- and time-related FormatElement entries in LocaleData, in i18npool/source/localedata/data. The format list in Writer's field dialog uses the number formatter, which is filled from these entries.
Using strftime() would not be a good idea. - Only a very limited subset of all needed date/time formats is covered by strftime(), if any. - A locale has to be installed in the system to be able to use it. Most systems have only 2 or 3 locales installed. Using different locale dependent formats in a document would not be possible. - Locale definitions may differ between systems. - Not all locales OOo knows are available on all systems. I suggest to close this issue as WONTFIX.
Reset assigne to the default "issues@openoffice.apache.org".