Bug 39794 - ACCESSIBILITY: Default language for hyperlinks in Writer = zxx or [none] [accessibility]
Summary: ACCESSIBILITY: Default language for hyperlinks in Writer = zxx or [none] [acc...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: accessibility
Depends on:
Blocks: a11y-Windows Hyperlink
  Show dependency treegraph
 
Reported: 2011-08-03 02:29 UTC by Christophe Strobbe
Modified: 2022-12-13 14:39 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
English ODT file with several types of hyperlinks: English (without language identification), English (with language identification), French and Chinese. (13.71 KB, application/vnd.oasis.opendocument.text)
2011-08-03 02:29 UTC, Christophe Strobbe
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Strobbe 2011-08-03 02:29:16 UTC
Created attachment 49868 [details]
English ODT file with several types of hyperlinks: English (without language identification), English (with language identification), French and Chinese.

When you create a hyperlink in a Writer document (LibreOffice or OpenOffce.org), the language is explicitly set to "zxx" by default (this is shown in the statusbar as "[None]"). In order to identify the language of a hyperlink, you need to explicitly set it by selecting the link and picking a language.

The cause seems to be a default in Writer. When you unpack an ODT file and inspect the file "styles.xml", you will find the following lines:

<style:style style:name="Internet_20_link" style:display-name="Internet link" style:family="text">
<style:text-properties fo:color="#000080" fo:language="zxx" fo:country="none" style:text-underline-style="solid" style:text-underline-width="auto" style:text-underline-color="font-color" style:language-asian="zxx" style:country-asian="none" style:language-complex="zxx" style:country-complex="none"/>
</style:style>

The relevant attributes here are
* fo:language="zxx" fo:country="none" 
* style:language-asian="zxx" style:country-asian="none" 
* style:language-complex="zxx" style:country-complex="none"

It is unclear to me why these defaults exist. I could not find anything in the ODF 1.2 specification that justifies their existence.
Some background from that specification (notably section 16.2<style:style>):

"Styles defined by the <style:style> element use a hierarchical style model. The <style:style> element supports inheritance of formatting properties by a style from its parent style. A parent style is specified by the style:parent-style-name attribute on a <style:style> element."

(Note that the style:style element for hyperlinks does not have a style:parent-style-name attribute.)

"For styles with family text which are applied to elements which are contained in another element that specifies a style with family text, the search continues within the text style that is applied to the nearest ancestor element that specifies a style with family text, and continues in its parent styles."

Based on this I would expect hyperlinks to inherit language properties from the paragraph within which it is contained. In my test document, they would inherit
* fo:language="en" fo:country="GB"
* style:language-asian="zh" style:country-asian="CN"
* style:language-complex="ar" style:country-complex="SA"
(I always enable East-Asian and CTL in Writer, and set the default language for Asian languages to "Chinese (simplified)".)
However, the default hyperlink styles appear to prevent this.

Authors usually forget to set the language of hyperlinks, so Writer should remove the defaults that set the language of hyperlink text to "zxx" / "[None]" (see first XML fragment).

Since language information is essential for conversion to audio (in a screen reader or when converting to an audio book) and to Braille (punctuation and contracted forms are language-dependent), this is an accessibility issue. Hence the "[accessibility]" in the summary field of this bug.
Comment 1 Christophe Strobbe 2011-08-03 06:20:35 UTC
There is a workaround for users who are familiar with styles:
1. In the Styles and Formatting panel (which can be opened with F11), select Character Styles (second button on the little toolbar);
2. Right-click on the style "Internet Link" and select Modify;
3. On the Font tab of Character Style dialog, select the default language for links.
But it would be better if the languages were simply inherited from an ancestor.
Comment 2 Björn Michaelsen 2011-12-23 12:21:27 UTC Comment hidden (obsolete)
Comment 3 sasha.libreoffice 2012-01-08 21:27:16 UTC
reproduced on LibO 3.5.0 beta 1
Comment 4 QA Administrators 2015-02-19 15:43:11 UTC Comment hidden (obsolete)
Comment 5 Christophe Strobbe 2015-03-15 18:33:18 UTC
I rechecked this bug using a freshly installed version of LibreOffice 4.3.6.2 on Windows 7 (32 bits) and I found that the issue is still present. 

The workaround that I described in my second comment still applies.
Comment 6 Robinson Tryon (qubit) 2015-12-10 03:37:50 UTC Comment hidden (obsolete)
Comment 7 QA Administrators 2017-01-03 19:41:35 UTC Comment hidden (obsolete)
Comment 8 QA Administrators 2019-12-03 13:57:45 UTC Comment hidden (obsolete)
Comment 9 Christophe Strobbe 2021-08-10 14:01:48 UTC
I can confirm this bug in LibreOffice Writer 7.1.3.2 on OpenSUSE Leap 15.2.
Select a span of text (e.g. with language set to "English (UK)"), press Ctrl + K to turn the text into a hyperlink, enter a URL into the URL field, press OK, and check the status bar: when the cursor is on the link, the status bar says the language is "[none]".
Comment 10 László Németh 2022-12-13 14:39:52 UTC
Fixed in Bug 126657, Bug 152492 and Bug 45949.