Bug 128316 - FIELDS: Allow date field with lower case letters
Summary: FIELDS: Allow date field with lower case letters
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevEval
Depends on:
Blocks: Fields-Dialog
  Show dependency treegraph
 
Reported: 2019-10-22 06:55 UTC by itt788
Modified: 2023-07-12 08:51 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description itt788 2019-10-22 06:55:34 UTC
though the literal date is given a capital first letter for months and days in english, The possibility to have uncapitalised words should not be forbidden. So at least for the date field for example in the header or footer there should be the option to turn off the auto capitalisation disregarding what locale was set. As a general rule for anything that is automatic there should an easy way for users to turn it off.
Comment 1 Dieter 2019-10-27 13:13:53 UTC
I also couldn't correct it manually.

cc: Design Team for further input
Comment 2 Heiko Tietze 2019-10-28 11:02:17 UTC
Can you make a working example please. When I type "Blood monday" or "It's october" the two dates are kept lowercase (tools > options > language > locale set to EN_US and applied to the document).
Comment 3 Dieter 2019-10-28 11:04:58 UTC
(In reply to Heiko Tietze from comment #2)
> Can you make a working example please. When I type "Blood monday" or "It's
> october" the two dates are kept lowercase (tools > options > language >
> locale set to EN_US and applied to the document).

Heiko, the request is about fields => back to UNCONFIRMED
Comment 4 Heiko Tietze 2019-10-28 11:09:20 UTC
Guess this field content is not autocorrected but inserted according system locale whatever. Eike, what do you think?
Comment 5 Eike Rathke 2019-10-28 11:26:34 UTC
Formatted date fields' day and month names are taken from locale data as is, there is no auto-capitalization.
Comment 6 Heiko Tietze 2019-10-28 11:32:14 UTC
(In reply to Eike Rathke from comment #5)
> Formatted date fields' day and month names are taken from locale data as is,
> there is no auto-capitalization.

So I suggest to resolve as NAB.
Comment 7 Dieter 2019-10-28 12:12:53 UTC
(In reply to Heiko Tietze from comment #6)
> So I suggest to resolve as NAB.

But could at least be an enhancement. I think it should be possible to add date fields with lowercase. I couldn't find a way to do this.
Comment 8 Heiko Tietze 2019-10-28 13:30:17 UTC
You could insert a spreadsheet cell per OLE with =LOWER(TEXT(MONTH(NOW()),"mmmm"))
Comment 9 Dieter 2019-10-28 13:45:08 UTC
(In reply to Heiko Tietze from comment #8)
> You could insert a spreadsheet cell per OLE with
> =LOWER(TEXT(MONTH(NOW()),"mmmm"))

itt788, does this solve your problem?
Comment 10 Xavier Van Wijmeersch 2019-10-28 20:05:07 UTC
EN_US and EN_UK will have first letter in uppercase but this can be changed.
I know its a workaround but still.
steps to do
file => properties => custom properties => add property
give some name => text = text => value enter the date
close with ok

then in footer or header
insert => field => more fields => tab DocInformation => select custom
click given name and insert close

And yes its a bit off work but it can be done.
Comment 11 Heiko Tietze 2019-10-29 06:18:38 UTC
(In reply to Xavier Van Wijmeersch from comment #10)
> text => value enter the date

You can also set a variable in the fields dialog. However, this fix value will not change when time passes by.
Comment 12 itt788 2019-11-19 05:48:04 UTC
it seems i have not explicitly precised that i was talking of the "date" field that LO will replace with "today's" or another date if set by the user with the option to set the style (DD/MM/YYYY or DD/MM/YY ... or literal date).

I think the "date" field in a spreadsheet cell is technically different. In my case it's for the one that is available in the fields list for the footer or header for example. I tried the suggested solution "file => properties => custom properties => add a property ..." This is not a solution.

My request is just about removing the forced capitalisation in the "date" field when set to be displayed with a "literal" style. There is no place where people should be forced to use capital letters. This kind of things should not exist in text processing software or office tools. Therefore i personally consider it as a bug.
Comment 13 Dieter 2019-11-19 07:02:06 UTC
itt 788, yes I understand your request. Perhaps "autocapitalisation" leeds to a wrong direction. I changed bug title and I think it's an enhancement request.

Steps to reproduce:
1. Open a document
2. Open fields dialog (strg+2)
3. Document => date: You can't choose a date with lower case letters
4. Additional formats: You can't choose a date with lower case letters

Suggestion: Add an option to Format Number dialog.
Comment 14 Heiko Tietze 2019-11-19 07:11:17 UTC
(In reply to Dieter Praas from comment #13)
> Suggestion: Add an option to Format Number dialog.

(In reply to Eike Rathke from comment #5)
> Formatted date fields' day and month names are taken from locale data as is,
> there is no auto-capitalization.

The request is to introduce some kind of auto_un_capitalization. In particular with fields I doubt it's possible cross-plattform and -application. => WF
Comment 15 Mike Kaganski 2019-11-19 07:17:45 UTC
(In reply to Heiko Tietze from comment #14)
> The request is to introduce some kind of auto_un_capitalization. In
> particular with fields I doubt it's possible cross-plattform

Aren't "LOWER" function in Calc and Format->Text->Lowercase in Writer cross-platform?

> and -application.

Do you actively limit LibreOffice to only be a common subset of other office suites? How about limiting ourselves to what notepad offers?

> => WF

Disagree.
Comment 16 Heiko Tietze 2019-11-19 07:26:15 UTC
(In reply to Mike Kaganski from comment #15)
> Aren't "LOWER" function in Calc and Format->Text->Lowercase in Writer
> cross-platform?

To my knowledge there is no lower() (or any similar) function in Writer - except using a macro. 

> > => WF
> 
> Disagree.

That's why I added you to CC :-)
Comment 17 Eike Rathke 2019-11-19 13:15:53 UTC
(In reply to Heiko Tietze from comment #16)
> (In reply to Mike Kaganski from comment #15)
> > Aren't "LOWER" function in Calc and Format->Text->Lowercase in Writer
> > cross-platform?
> 
> To my knowledge there is no lower() (or any similar) function in Writer -
> except using a macro. 
As Mike said, it's Format -> Text -> lowercase (which actually does not format but convert the text).
CharClass::lowercase() is cross-platform (and locale dependent).
Comment 18 Heiko Tietze 2019-11-20 07:30:26 UTC
How about a solution per macro?

Option VBASupport 1 

Sub Main

   Dim oDoc As Object
   Dim oText As Object
   oDoc = ThisComponent
   oText = oDoc.Text
   oVCurs = oDoc.CurrentController.getViewCursor()
   oTCurs = oText.createTextCursorByRange(oVCurs.getStart())

   sToday = LCase( WeekdayName( WeekDay( Now() )))

   oText.insertString( oTCurs,  sToday, FALSE )

End Sub
Comment 19 Mike Kaganski 2019-11-20 07:35:20 UTC
As I understand the request, it's about some control in (different?) fields editor that controls its casing (e.g., "No case change"/"Lowercase"/"Uppercase"/"Sentence case"), which would apply the chosen operation (analogous to what we have in Format->Text) to the result of the field evaluation, *dynamically*. No macro solution could handle e.g. requirements to templates, or to fields displaying print time.
Comment 20 Heiko Tietze 2019-11-20 07:46:13 UTC
And I don't see a solution that automatically modifies inserted fields. But I'll rest my case and once developer come up with an idea I'm happy to support with a UI solution.
Comment 21 Dieter 2019-11-20 08:42:24 UTC
Perhaps the easiest way would be to offer some formats with lower case letters in the format-list
Comment 22 itt788 2020-12-09 07:33:34 UTC
whether date fields must be capitalised or not is a question of grammar and region. Auto-capitalisation must be removed from the code making the date field. Spell checker with its grammar and language options should take care of capitalisation for the whole document on the basis of user settings.
Comment 23 Mike Kaganski 2020-12-09 07:35:37 UTC Comment hidden (obsolete)
Comment 24 itt788 2020-12-11 07:24:06 UTC Comment hidden (no-value)
Comment 25 Mike Kaganski 2020-12-11 07:30:24 UTC Comment hidden (obsolete)
Comment 26 itt788 2020-12-12 15:44:50 UTC Comment hidden (obsolete)
Comment 27 Mike Kaganski 2020-12-12 16:50:37 UTC Comment hidden (obsolete)
Comment 28 itt788 2020-12-13 09:07:31 UTC Comment hidden (obsolete)
Comment 29 Mike Kaganski 2020-12-13 10:35:13 UTC
(In reply to itt788 from comment #28)
> (In reply to Mike Kaganski from comment #27)
> > Field is, 
> [ ... ]
> > not a random text.
> This is such a harsh statement you do as response to my comment! If i hurt
> anyone here, be sure this is not intentional.

No, you haven't hurt anyone; and it looks like my use of word "random" might be wrong/harsh, which is not intentional. What *I* tried to express was, that unlike usual text that user types and edits at their will, being in full control of any character of it (which I expressed as "random", but maybe the word is improper; I'm not a native English speaker, sorry), field's text is controlled by the field algorithm.

> Fields are used where the information users want in their document can be
> calculated by the computer. That is things like page numbers, arithmetic
> operations, dates...

Exactly.

> In my understanding Fields consist in two layers, first, the "code", to make
> the computer understanding what we want. Second, the way is is represented
> as per user's wish.

No. There is no "two layers" here, only one layer of "apply some algorithm to some input data to create some sequence of characters". Field *usually* (except for very special fields like ToC) does *not* care about representation of the characters, it just inserts these characters into the character stream rendered by its "owner", which is some text run. Representation of characters (font, its effects, spacing, etc.) is performed on a layer unrelated to the field; but note that the characters themselves are *never altered* on those outer layers. By the way, the characters of other "random" (sorry for the word) text are *also* not modified by those "representation" layers - which only apply formatting.

The process of *modification* (say, replacing one character "a" with another "A") is not part of representation, anyway. In normal text, it's performed when user types something, or otherwise edits (e.g., using automatic edit tools like spell checking); in that process, user *modifies text*, not modifies representation. And again: *field's* sequence of characters is *calculated, not typed*, hence you may not edit it.

That said, we have *some* fields that allow free editing of their calculated content: namely, ToC. You may unprotect the field, and type/delete/replace things there at will. But to make that possible, the field must be "calculated once": what I mean is Writer does not re-calculate the field on every change of the document, but calculates it *only* on first insert, and then on explicit commands to update it. Even save-and-reload does not cause its re-calculation; that's why you may have totally out-of-sync ToC in your document, if you forget to refresh it manually. In this case, when Writer keeps the cached text of the field which will not be modified until the next explicit command, it's reasonable to allow user to change that cache at will ... and user should realize that any manual changes there will of course be lost when the field is updated.

But for *any* auto-updated field, that does not make sense. Every change in a document, like typing a character somewhere, may trigger automatic refresh of the field text, which would ruin any manual changes to the cached text. That is *wanted* and *expected*, *correct* behavior; it would be *wrong* and a *bug* for a page number field, or a cross-reference field, or any of the multitude of other fields, to not change in those cases. Even for a "fixed date" field, which you may think as "calculated once", it's not so: it's calculated from a fixed date, but variable current locale of the enclosing text - thus when you change the language of the outer text, it will automatically re-calculate its string. So it's also auto-calculated data, and should not allow free-form modification of its cached string.

How Word does it is a different thing. The two suites are built around very different concepts; and it's not necessary that a workflow in one of them translates directly to the same workflow in the other. It's done where applicable, but not universally.

Also please don't repeat the "for French, it's broken" (which I don't deny) as proof of "the solution that *I* suggest is the only suitable". Yes, the problem needs improving, but that doesn't mean that it only has *that* solution.
Comment 30 itt788 2020-12-26 15:19:21 UTC Comment hidden (off-topic)
Comment 31 Mike Kaganski 2023-06-01 09:26:29 UTC
Note that [NatNum12 MMMM=lower]MMMM (lower/upper/title/capitalize, see [1]) can provide the wanted functionality.

[1] https://help.libreoffice.org/latest/en-US/text/shared/01/05020301.html?&DbPAR=CALC#NatNum12
Comment 32 itt788 2023-07-12 08:51:41 UTC
(In reply to Mike Kaganski from comment #31)
> Note that [NatNum12 MMMM=lower]MMMM (lower/upper/title/capitalize, see [1])
> can provide the wanted functionality.
> 
> [1]
> https://help.libreoffice.org/latest/en-US/text/shared/01/05020301.
> html?&DbPAR=CALC#NatNum12

i have tested in version 7.5, by default in french date is in lower case. I don't know when they solved it but either a report was done before this one, in which case it should be mentioned at duplicate. Or the fix should have been mentioned here.

I tested the NatNum12 option, it's good. Now in any language the date fields can be set as lower case.