New language selector: Validation failed - attribute "hreflang" in "option"

Laura Arjona Reina <[email protected]>
Newsgroups gmane.linux.debian.devel.www
Message-ID <[email protected]>
Hello

Thanks Divine Attah and all the prior and post work, we have a new 
language selector in the footer in www.debian.org, that closed the bug 
#924889 with MR 1004.

However, I have noticed HTML validation errors, related to the attribute 
hreflang used in the different "options" of the language selector.

For example for Spanish I'm getting these warnings:

*** Errors validating /srv/www.debian.org/www/mirror/index.es.html: ***
Line 100, character 55: there is no attribute "HREFLANG"

First I thought that maybe "hreflang" is an HTML5 attribute and we could 
ignore it for now (see bug #1009971), but I tried to build 
webwml/english/mirror/index.wml changing the reference to "template" to 
"template5" (see bug #980921), and the page built fine, uploaded it to 
https://cosas.larjona.net/debian/index.en.html and the HTML5 online 
validator available here https://html5.validator.nu/ still outputs 
warnings like:

Attribute hreflang not allowed on element option at this point.
 From line 96, column 2; to line 96, column 70
/option>↩ <option value="index.da.html" title="Danish" hreflang="da" 
lang="da">dansk<

So I believe that there is an issue and probably hreflang cannot be used 
in "option" items.

My HTML/HTML5 skills are not enough, can somebody help?

(OTOH I don't know why I'm not getting validation errors for all the 
pages, and only the mirror/index page. In 
https://www-master.debian.org/build-logs/validate/en I have seen similar 
warnings in other pages, but not all the pages that use the footer 
either. Maybe our validation script does not try check all the files).

Links of bugs and MR mentioned:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=924889 -  Use a drop 
down selector (without JS) to switch the language of the website

https://salsa.debian.org/webmaster-team/webwml/-/merge_requests/1004 - 
Fix bug 924889 readjustment

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1009971 -
Our current validation script does not work with html5 files

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=980921 -
Pages in HTML5

Kind regards

Laura Arjona Reina
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.