[Libreoffice-bugs] [Bug 39794] New: Default language for hyperlinks in Writer = zxx or [none] [accessibility]

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Aug 3 02:29:17 PDT 2011


https://bugs.freedesktop.org/show_bug.cgi?id=39794

           Summary: Default language for hyperlinks in Writer = zxx or
                    [none] [accessibility]
           Product: LibreOffice
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Writer
        AssignedTo: libreoffice-bugs at lists.freedesktop.org
        ReportedBy: christophe.strobbe at esat.kuleuven.be


Created an attachment (id=49868)
 --> (https://bugs.freedesktop.org/attachment.cgi?id=49868)
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.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Libreoffice-bugs mailing list