daisy / ace

Ace by DAISY, an Accessibility Checker for EPUB
MIT License
75 stars 22 forks source link

Add a warning for inconsistent language tags? #327

Closed gregoriopellegrino closed 2 years ago

gregoriopellegrino commented 4 years ago

I'm analyzing a file whose language is:

<dc:language>it</dc:language>

All HTML files have the following header:

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="en" xml:lang="en">

I'd expect Ace to give me at least one warning about the incoherent use of metadata language.

jenstroeger commented 4 years ago

Thanks @gregoriopellegrino! I suspect that xml:lang="en" for the package element (inside of content.opf) is acceptable? Hmm… 🤔 Or maybe not considering that some content, e.g. the <spine> elements, contain text in the publication’s language.

gregoriopellegrino commented 4 years ago

From a practical point of view, I think the lang attribute in the opf file is ignored. From a theoretical point of view, in my opinion the language of the metadata (title, author, description, etc.) should be indicated.

acabal commented 3 years ago

I don't think having two languages in an ebook is a problem. We have many ebooks for example whose contents are en-GB, but that have some boilerplate pages like the imprint and colophon in en-US (because they're boilerplate). We even have a few ebooks that are 99% en-GB but have entire chapters in other languages like la.

danielweck commented 2 years ago

Closing this issue as multiple languages do not seem to be problematic. Related issue (mandatory package OPF xml:lang): https://github.com/daisy/ace/issues/371