[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libreoffice-l10n] hyphen breaking behaviour


How we've managed to fix the smart quote issue for our locale (many thanks to Mikhel and Eike!) I've got another headache I would like to tackle. I've asked Eike but he's not entirely sure and suggested I ask the list.

The problem is this: Gaelic restricts the breaking of hyphens across lines if there are less than two letters before the hyphen. In effect, this affects a finite number of prefixes, mostly:
n-WORD (e.g. ar n-aran)
t-WORD (e.g. an t-aran)
h-WORD (e.g. na h-aran)
an-WORD (e.g. seall an-seo)
eu-WORD
mì-WORD
dì-WORD
(and a few more, I can, if necessary supply a full list).

At the moment, at the end of a line a word like an-seo just gets broken into an-
seo. The only known fix is that once you're done writing, you do a global replace of <an-> to <tU+2011> (i.e. a NON-BREAKING HYPHEN) etc.

Is there something one could exploit to force specific instance of HYPHEN to the NON-BREAKING HYPHEN? The main problem I can see would be that if one cannot distinguish between single t and t word finally, something like cat-ghrìosaich might also end up with a non-breaking hyphen.

Eike suggested the following:

Maybe some rule for AutoCorrection could match this, but I'm not very
familiar with. However, the en-GB lists are under
extras/source/autocorr/lang/en-GB/ in the source tree, likely such rules
similar to the ones in
extras/source/autocorr/lang/en-GB/DocumentList.xml would go into
extras/source/autocorr/lang/gd-GB/DocumentList.xml and using something
like

<block-list:block block-list:abbreviated-name="n-.*" block-list:name="‑"/>

where the second "‑" is a U+2011 NON-BREAKING HYPHEN.

The ".*" seems to indicate "any sequence of non-word-boundary characters
including none", so also "n-" without a following WORD would be matched.
Apparently there is no support for ".+" or other regular expressions.

Michael

--
To unsubscribe e-mail to: l10n+unsubscribe@global.libreoffice.org
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/l10n/
All messages sent to this list will be publicly archived and cannot be deleted

Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.