On Wed, Aug 05, 2026 at 07:34:08PM +0100, Gavin Smith wrote: > I'm confused where BCP47 language identifiers have come into this. > > I found documentation online for \DocumentMetadata: > > https://ctan.math.washington.edu/tex-archive/macros/latex-dev/required/latex-lab/documentmetadata-support-code.pdf > > So I don't know how new or set in stone what is documented here is, but in > this > document it does say BCP-47 format: > > > The language key should be used to set the main language of the document. > > The value is given in BCP 47 format, so, e.g, languade=de-DE or language=fr. > > The value is stored in the document properties and can be retrieved > > (expandably) > > with \GetDocumentProperty{document/language}.
If I understood well, the babel package uses BCP 47 language tags either explicitely (we use that feature in the LaTeX generated by texi2any) or implictely, as alias (as David also says in his response), see for example: https://latex3.github.io/babel/guides/locale-naming.html So it is consistent for \DocumentMetadata to use the same convention, although it is possible to give an optional argument Actually, I set lang=, in the LaTeX converter in \DocumentMetadata, after reading the documentation, I think that it is better to set language= and let lang be set automatically, I will change the code. > ("languade" is presumably a typo for "language".) > > However, I don't know what problem is being solved by outputting the document > language with this command. Is it required for "accessibility" conformance? > Is it required for 'pdfinfo' to state the PDF as tagged (as explained by > David Carlisle below)? A language is mandated in this document in "8.4.4 Declaring natural language", but there is no clear specification of the format. https://pdfa.org/wp-content/uploads/2024/02/Well-Tagged-PDF-WTPDF-1.0.pdf (I could not find the standard directly without being asked for personal information.) -- Pat
