Bug 153989 - Autocorrect uses language-specific quotation marks for other languages
Summary: Autocorrect uses language-specific quotation marks for other languages
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks: AutoCorrect-Complete Languages Language-Grouping
  Show dependency treegraph
 
Reported: 2023-03-05 20:25 UTC by Eyal Rozenberg
Modified: 2024-08-03 19:02 UTC (History)
6 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 Eyal Rozenberg 2023-03-05 20:25:24 UTC
If I:

1. Create a new document.
2. Set my fonts to have languages English (USA) for western and Hebrew for RTL-CTL
3. Set the paragraph direction to LTR
4. Set the Hebrew-language autocorrect quotation marks to some pair (e.g. „ for starting, “ for ending)
5. Enable auto-correct as I type
6. Switch the keyboard layout to English
7. Type in "Hello world" (i.e. using the double-quote key on the keyboard)

I get:
„Hello world“

and this should not happen. I should get whatever quotation marks are defined for English (or English (USA) more specifically).


(PS - I can't tell what's defined for English, since the drop-down box of the dialog is stuck on Hebrew, see bug 153987.)
Comment 1 Eyal Rozenberg 2023-03-07 18:24:03 UTC
This might have something to do with using autocorrect specific to the app locale rather than the relevant text's language.
Comment 2 Dieter 2023-03-23 19:42:50 UTC
Eyal, I think, you're right, that settings are not language sensitive. But I don't think, that this is intended. So I change description to enhancement and add design-team

As far as I can see, language setting at top of dialog, is only related to replace and exceptions tab. But that should be more clear within the dialog (see bug 153987).

cc: Design-Team for further input and decision
Comment 3 Eyal Rozenberg 2023-03-23 20:11:33 UTC Comment hidden (obsolete)
Comment 4 Eyal Rozenberg 2023-03-23 20:48:50 UTC
Sorry, I got confused with my previous comment, please ignore it.

Let me clarify:

* This bug is not about the dialog at all. It's about what Autocorrect does when applied - regardless of what's happened in the dialog (or with the default settings without the dialog every having been accessed). I don't know if LO, internally, has a mapping from languages to quotation-mark pair definitions; if it doesn't, the bug goes deeper than I had assumed. Anyway, bug 153987 is about exposing per-language quotation mark choice in the dialog.

* This bug is not an enhancement request. There is no universal pair of quotation marks, and LO should not try to apply one when AutoCorrect is triggered. When you autocorrect as you type, naturally the corrections need to be language-aware, particularly w.r.t. quotation mark replacement.
Comment 5 V Stuart Foote 2023-03-23 21:18:15 UTC
IIRC as Eike explained for bug 116062 bug 105837 and similar, it does not come from CLDR or ICU LDML, but we do provide values by os/DE locale in the i18npool/source/localedata/data XML which is used to load the parenthesis defaults per UI locale.

Meaning, it should be possible to adjust things in the AutoCorrect UI and associated editshell(s) to pick the same up by language at the paragraph level, and behave just like spell checking.

And kind of seems work for this would include effort needed for bug 153987
Comment 6 V Stuart Foote 2023-03-23 21:47:04 UTC
Its still an Enhancement and NAB -- asking for new feature/function beyond what is currently implemented.  Functions as implemented intended currently.
Comment 7 Eyal Rozenberg 2023-03-23 22:07:02 UTC
(In reply to V Stuart Foote from comment #6)
> Its still an Enhancement and NAB -- asking for new feature/function beyond
> what is currently implemented. 

The feature this bug regards is the replacement of quotes with "smart quotes", or matching start & end quote pairs. The current implementation is faulty: It will result in invalid/incorrect quote pairs if there is text in at least two languages whose matching quote pairs are different.

Even if the current implementation was intentional - which I doubt - the bug is in the intention/design of the feature.
Comment 8 Heiko Tietze 2023-03-24 10:55:01 UTC
It's quite annoying to discuss a topic on two tickets.

To follow-up on bug 153987 comment 2 this is how it is defined (and working correctly)

For i18npool/source/localedata/data/de_DE.xml it is

    <Markers>
       <QuotationStart>‚</QuotationStart>
       <QuotationEnd>‘</QuotationEnd>
       <DoubleQuotationStart>„</DoubleQuotationStart>
       <DoubleQuotationEnd>“</DoubleQuotationEnd>
    </Markers>
Comment 9 Heiko Tietze 2023-03-24 10:58:28 UTC
(In reply to Heiko Tietze from comment #8)
> It's quite annoying to discuss a topic on two tickets.

Three tickets! bug 153987, bug 153988 and 153989 - all the same topic.
Comment 10 Eyal Rozenberg 2023-03-24 13:06:09 UTC
(In reply to Heiko Tietze from comment #9)
> (In reply to Heiko Tietze from comment #8)
> > It's quite annoying to discuss a topic on two tickets.
> 
> Three tickets! bug 153987, bug 153988 and 153989 - all the same topic.

People are creating a mess of these three distinct and separate tickets, discussing matters on the wrong ticket. Let's clarify:

153987 is about one aspect of the dialog: It should allow language-specific choices in the dialog
153988 is about another aspect of the dialog: The convenience of choosing quote pairs, regardless of whether it's for one language or many
153989 is _not_ about the dialog, it's about what autocorrect does, regardless of any UI
Comment 11 Heiko Tietze 2023-04-21 09:20:44 UTC
The topic was on the agenda of the design meeting but did not receive further input. 

Having the auto correction of quotes assigned to the paragraph language is desirable and makes sense. The UI at the options dialog needs a combobox to change the association per language.
Comment 12 William Friedman 2023-07-11 15:36:50 UTC
Heiko, I am a bit confused what you mean by "auto correction of quotes assigned to the *paragraph* language." It seems that this would not fix the problem that Eyal identified, which involves autocorrection of quotes in *mixed-language* *paragraphs.* E.g., say I type the following paragraph.

Smart quotes in English look this: "hello"; smart quotes in Hebrew look like this: "שלום."

In this paragraph, the quotes around "hello" should autocorrect to English-defined smart quotes, and those around "שלום" should autocorrect to Hebrew-defined smart quotes, even if the paragraph language is English. If autocorrect defaulted to the paragraph language, the smart quotes around שלום would be incorrect.
Comment 13 Heiko Tietze 2023-07-17 09:20:41 UTC
(In reply to William Friedman from comment #12)
> Heiko, I am a bit confused what you mean by "auto correction of quotes
> assigned to the *paragraph* language."

It means to change the current one-off option into a setting that depends on the paragraph language. I imagine a dropbox where you pick the language and change the autocorrection only for this.