Funky Smart Quotes Behaviour

Hello!

I usually don’t use the smart quotes feature, but when I do, its behaviour is somewhat inconsistent.

It depends on the UI language and locale settings, really. I set both of these to British English, so when I use smart quotes with English, there is no problem. However, when I want to use smart quotes in Hebrew, things start to get confusing. What usually happens is that the first quotation mark is usually automatically set to the opening curly quotation mark, but the closing mark does not change until after you add a character after it and click Format>Autocorrect>Apply.

This behaviour changes, though. Sometimes the closing quote won’t change even after clicking Format>Autocorrect>Apply; Sometimes both the quotes are applied correctly without doing anything; And sometimes both remain the default quotes.

This is a rather confusing problem, which seems to me to stem from some problematic concepts, but I would like some help in understanding it so that if there is any bug to report, it will be done specifically and correctly.

Thanks in advance!

After a bit more tries, I think I understand the problem. From what I could gather, this behaviour is somewhat intentional, but perhaps not thought out all the way through.

Hebrew acronyms are usually accompanied with one quotation mark in the middle (e.g. חז"ל). This is called “Gershayim”, and it is different from the regular quotation marks, which use for quotes, names, etc.

When there is no punctuation mark before or after the quotation mark, LibreOffice does not autocorrect the sign into a smart quote, most likely because it interprets the sign as a “Gershayim”, and not as quotation marks.

After writing a whole text, one can use Format > Autocorrect > Apply to turn all the “Gershayim” into quotation marks. However, this behaviour is not documented anywhere and could be confusing for users. Furthermore, even if it is documented, I don’t think this is convenient.

If LibreOffice’s smart quotes feature works differently for different languages, I think smart quotes should have a separate configuration for each language, where the behaviour is more clearly defined and explained.

Interesting. I tend to agree that “smart” features are script/language-specific. Thanks for investigating further. It may be worthwhile reporting a bug about this. Bug fdo#46950 seems closely related and may in fact be the same underlying cause.

Overall handling of bi-directional text and the various punctuation marks (e.g., brackets) are not without issues. Unicode treatment and governing algorithms are fairly complex. Combine this with AutoCorrection (which is what the Smart Quotes feature is a part of) and the resulting code required for elegant treatment in all contexts is equally complex.

I can’t find an open bug related to closing quotation marks for RTL text so your particular usage case may have been overlooked. Alternatively, it may help to use Unicode directionality marks (for RTL strings embedded in LTR paragraphs) as I indicate in the linked question.

Thanks for the reply.
I don’t believe the issue to be related to right-to-left layout. When I change the whole document to use right-to-left text, the problem still occurs. I believe it might be some feature that is supposed to recognize Hebrew acronyms (which have a non-curved " in them), and correct the quotes accordingly. However, this results in a rather clumsy behaviour.