Bug 127961 - Auto-correction append/prepend NNBS (U+202F) to « » for correct typography of French language double quotation use
Summary: Auto-correction append/prepend NNBS (U+202F) to « » for correct typography of...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Localization (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Eike Rathke
URL:
Whiteboard: target:6.4.0 target:6.3.4
Keywords:
Depends on:
Blocks: AutoCorrect-Complete
  Show dependency treegraph
 
Reported: 2019-10-04 09:31 UTC by sommerluk
Modified: 2020-04-22 09:35 UTC (History)
5 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 sommerluk 2019-10-04 09:31:30 UTC
Description:
auto-correction of typographic quotation marks broken for fr_CI and other french locales in Africa

- fr_BF (Burkina Faso)
- fr_BJ (Bénin)
- fr_CI (Côte d'Ivoire)
- fr_ML (Mali)
- fr_NE (Niger)
- fr_SN (Sénégal)
- fr_TG (Togo)

Steps to Reproduce:
In the character properties, set the text language to “French (Ivory Coast)”. Then, type this in your document:

"C'est un test."



Actual Results:
Actual Results:

«C’est un test.»


Expected Results:

Expected Results:
An auto-correction identical to the auto-correction of “French (France)”: Typographic (French) quotation marks are used together with a non-break space. It’s changed to:

« C’est un test. »

with a non-breaking space after « and before ».




Reproducible: Always


User Profile Reset: No



Additional Info:
I’ve tested this in 6.3.2.2. It is a remaining issue of the partially solved issue https://bugs.documentfoundation.org/show_bug.cgi?id=124108
Comment 1 V Stuart Foote 2019-10-04 13:05:04 UTC
So confused, do folks working in fr_FR locale receive the NNBS with Auto-correction change of " double quote entry to  « or », or not?

But, if the typographic convention is to include the NNBS, or a NBS--can it be implemented?
Comment 2 Julien Nabet 2019-10-04 13:40:04 UTC
Not sure about tdf#41652 but at least the same domain.
Comment 3 sommerluk 2019-10-04 14:01:20 UTC
Indeed with fr_FR you get automatically the non-breaking spaces. This issue is about making fr_CI and the other French African locales to work like fr_FR already does.
Comment 4 V Stuart Foote 2019-10-04 15:35:54 UTC
From cmnt 20 on see also bug 124108
<clip>
Hmm, the Autocorrect localized options pick up the LC_CTYPE from the fr_FR.xml and includes just the single codepoints:

U+2018 -- ‘
U+2019 -- ’
U+00AB -- «
U+00BB -- »

the NBS, NNBS is not present there. Nor is it present in the autocorrect table for fr_FR emoji.po

Meaning if an NBS (U+00A0) or NNBS (U+202F) is being inserted it is being done for fr_FR locale in the sw edit engine. But I can't find it.
</clip>
Comment 5 Eike Rathke 2019-10-04 16:23:09 UTC
Is it really so that *all* French locales, i.e. anything French language, should have this treatment? Fwiw, only the double quotes get a NBSP inserted.
See editeng/source/misc/svxacorr.cxx SvxAutoCorrect::InsertQuote()
If really everything French should have that behaviour it would greatly simplify things instead of having to keep the list up-to-date. If there are exceptions then maybe adding some optional flag to locale data would be more appropriate on the long term.
Comment 6 Julien Nabet 2019-10-04 17:19:55 UTC
On pc Debian x86-64 with LO Debian package 6.3.2 with French locale fr_FR, if I type this:
"Ceci est un test"
I got:
« Ceci est un test »
(and spaces are non break spaces).
Comment 7 V Stuart Foote 2019-10-04 18:46:38 UTC
> See editeng/source/misc/svxacorr.cxx SvxAutoCorrect::InsertQuote()

Oh, there it is... thanks Eike!

https://opengrok.libreoffice.org/xref/core/editeng/source/misc/svxacorr.cxx?r=1820fcbb#1206

the space is just being done for:

LANGUAGE_FRENCH,
LANGUAGE_FRENCH_BELGIAN,
LANGUAGE_FRENCH_CANADIAN,
LANGUAGE_FRENCH_SWISS,
LANGUAGE_FRENCH_LUXEMBOURG

Which confirms the insertion is not performed for the comment 0 listing:

LANGUAGE_USER_FRENCH_BURKINA_FASO,
LANGUAGE_USER_FRENCH_BENIN,
LANGUAGE_FRENCH_COTE_D_IVOIRE,
LANGUAGE_FRENCH_MALI,
LANGUAGE_USER_FRENCH_NIGER,
LANGUAGE_FRENCH_SENEGAL,
LANGUAGE_USER_FRENCH_TOGO

nor is it done for our other defined French locales
i18nlangtag/source/isolang/isolang.cxx
 
LANGUAGE_FRENCH_MONACO,
LANGUAGE_FRENCH_CAMEROON,
LANGUAGE_FRENCH_ZAIRE,
LANGUAGE_USER_FRENCH_MAURITIUS,
LANGUAGE_FRENCH_MOROCCO,
LANGUAGE_FRENCH_REUNION,
LANGUAGE_FRENCH_HAITI,

as well as the regional
LANGUAGE_FRENCH_NORTH_AFRICA
LANGUAGE_FRENCH_WEST_INDIES
Comment 8 Eike Rathke 2019-10-04 19:01:36 UTC
Yes I know, question is if a NBSP is to be inserted for *all* French locales, which would simplify things, or if there are some to be exempted.
Comment 9 Julien Nabet 2019-10-04 19:17:21 UTC
If someone declares for his/her country, rules should be different from fr_FR, how to check this?
For example, are there official rules somewhere for Luxembourg, Benin, Ivory Coast, etc. on a website?
Comment 10 Eike Rathke 2019-10-04 20:35:55 UTC
I only know of https://en.wikipedia.org/wiki/Quotation_mark#Summary_table that says NBSP for French, except for French Swiss (whereas we do it also for French Swiss). The French https://fr.wikipedia.org/wiki/Guillemet#En_Suisse,_au_Liechtenstein_et_en_Norv%C3%A8ge looks similar but the entire page doesn't even mention a NBSP (or call it by its French name that I don't know). The German https://de.wikipedia.org/wiki/Anf%C3%BChrungszeichen#Andere_Sprachen mentions NBSP as "geschütztes Leerzeichen" and the exception for Schweiz (Switzerland).

So it seems quite clear that fr-CH should not have a NBSP, and probably (?) all other fr-* should have it.
Comment 11 Commit Notification 2019-10-16 19:09:05 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8d7ec203956695475c5ce2c3e47a4aa012a48d39

Resolves: tdf#127961 Add NBSP to quotation marks for all French except fr-CH

It will be available in 6.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Commit Notification 2019-10-17 09:30:40 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-6-3":

https://git.libreoffice.org/core/commit/b9056d049049c3f1e7b9f6d787d4a25b431c8ceb

Resolves: tdf#127961 Add NBSP to quotation marks for all French except fr-CH

It will be available in 6.3.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 13 Shriramana Sharma 2019-12-22 05:22:49 UTC
Um, OP asked for *Narrow* Non-Break Space U+202F but the commit uses regular Non-Break Space U+00A0?
Comment 14 V Stuart Foote 2019-12-22 07:19:49 UTC
(In reply to Shriramana Sharma from comment #13)
> Um, OP asked for *Narrow* Non-Break Space U+202F but the commit uses regular
> Non-Break Space U+00A0?

No, the OP did not ask for Narrow Non-Break Space, that was _my_ triage edit--the commit is suited to l10n requirement. 

Users are free to change the typography after the autocorrection applies if they really want Narrow Non-Break Space (U+202F)
Comment 15 sommerluk 2019-12-29 12:37:55 UTC
Tested and works fine.

Tested in 6.3.4.2 as AppImage at Linux Ubuntu Disco. Build-ID: 60da17e045e08f1793c57c00ba83cdfce946d0aa
CPU-Threads: 4; BS: Linux 5.0; UI-Render: Standard; VCL: kde5; 

Thanks a lot for fixing this!