Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[articles/language-tags/index] language tags in XHTML #576

Open
LineGap opened this issue Jan 24, 2024 · 2 comments
Open

[articles/language-tags/index] language tags in XHTML #576

LineGap opened this issue Jan 24, 2024 · 2 comments
Labels

Comments

@LineGap
Copy link

LineGap commented Jan 24, 2024

[source] (https://www.w3.org/International/articles/language-tags/) [en]

This statement requires clarification:
"XHTML 1.0 uses language tags in the HTML lang attribute and the XML xml:lang attribute, as well as the hreflang attribute."

This suggests all three attributes are required. Should the "and" be replaced with an "or"? And what about HTML? Should it be treated the same as XHTML? I seem to recall that you don't need both lang and xml:lang attributes in an XHTML document. However, I've seen some sources state that both attributes are required in the <html> tag for eBooks.

Recommend that HTML, XHTML, and XML be addressed separately.

@aphillips aphillips changed the title [articles/language-tags/index] BRIEF_TITLE_GOES_HERE [articles/language-tags/index] language tags in XHTML Jan 24, 2024
@aphillips
Copy link
Contributor

In XHTML 1.0 documents, both lang (which derives from HTML) and xml:lang (which derives from XML) are needed (and can be used on any tag). hreflang only applies to specific tags (it's purpose is different, as it communicates the expected language of the content of therelated href).

However, you're probably right about revising this section. This content was created in 2006, when XHTML was still relevant. Nowadays HTML5 should probably be referenced and it only uses the lang attribute.

@LineGap
Copy link
Author

LineGap commented Jan 28, 2024

I believe XHTML is still relevant for authors creating eBooks for reading apps and tablets that rely on the ePub standard. See section 6 in https://www.w3.org/TR/epub-33.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants