Skip to content

Adding a hreflang test - #173

Closed
iherman wants to merge 2 commits into
mainfrom
link-element-hreflang
Closed

Adding a hreflang test#173
iherman wants to merge 2 commits into
mainfrom
link-element-hreflang

Conversation

@iherman

@iherman iherman commented Jun 23, 2022

Copy link
Copy Markdown
Member

The PR adds a tests to the link element in §5.3 of the reading system spec, for the following statement:

The language identified in an hreflang attribute is purely advisory. Upon fetching the resource, a reading system MUST use the language information associated with the resource to determine its language, not the metadata included in the link to the resource.

This requires careful review. I rely on the possibility of using a <link> to define a description:

<link rel="dcterms:description" href="description.xhtml" 
   media-type="application/xhtml+xml" hreflang="fr"/>

and checking whether the display of the result is done in the 'language unknown' or the French way. I hope that is correct, although two things bother me:

  • (obviously) I do not know whether we have any RS that would use the linked description instead of the one given in the package file
  • even if the intention is there for the RS, the package description is specified via dc:description, but dc is not allowed for the value of rel in the link element, only dcterms:description. Technically, these two are different.

I am all open to use a different example for hreflang testing, but I ran out of ideas...

(The anchors in the spec are not yet set.)

@iherman
iherman requested review from dauwhe, dlazin and mattgarrish June 23, 2022 13:51
@mattgarrish

Copy link
Copy Markdown
Member

I do not know whether we have any RS that would use the linked description

I haven't heard of a reading system that uses linked records, let alone individual properties, let alone individual properties that would take parsing their value out of a grammar to obtain, so I suspect there will never be implementations to test.

I wonder if this is a case for a lowercase "must", since it feels oddly familiar to what we just discussed with respect to SVG. We're saying that the language specification in the package document is advisory and that's all that matters from an EPUB perspective. Do we need to require that reading systems obey the language specification rules of the host format, or is that implicit in the processing of any linked data?

@mattgarrish

mattgarrish commented Jun 23, 2022

Copy link
Copy Markdown
Member

This is more what I'm thinking it should be:

The language identified in an hreflang attribute is purely advisory. The language information expressed in the resource determines its language for processing and rendering purposes, not the metadata included in the link to the resource.

@iherman

iherman commented Jun 23, 2022

Copy link
Copy Markdown
Member Author

This is more what I'm thinking it should be:

The language identified in an hreflang attribute is purely advisory. The language information expressed in the resource determines its language for processing and rendering purposes, not the metadata included in the link to the resource.

That sounds perfectly fine to me.

Let us do a PR on the spec and see what the chairs say...

@mattgarrish

Copy link
Copy Markdown
Member

I was just looking over the recent changes we've done, and this requirement is actually redundant with the following paragraph in the internationalization section:

In the absence of this information in a publication resource, reading systems MUST NOT assume either the language or the base direction of that resource from information expressed in the package document (i.e., in xml:lang and dir attributes, in hreflang attributes on link elements, or from dc:language elements [epub-33]). Refer to a resource's formal specification for more information about to handle the absence of explicit language or direction information.

I'll open a pull request with an additional reference to this paragraph, but I wonder if we can delete this bit of duplication completely?

@mattgarrish

Copy link
Copy Markdown
Member

Closing this without merging as we've removed the requirement in w3c/epub-specs#2343

@mattgarrish mattgarrish closed this Jul 1, 2022
@mattgarrish
mattgarrish deleted the link-element-hreflang branch July 1, 2022 17:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants