View Single Post
Old 06-28-2022, 06:46 PM   #4
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by BeckyEbook View Post
Change language in metadata from "eng" to "en" [...]
Yep, "eng" is an invalid language.

Instead, you'd use:
  • en = English

so:
  • <html lang="eng" xml:lang="eng">
  • <html lang="en" xml:lang="en">

A basic list of valid language tags are here:

Quote:
Originally Posted by BeckyEbook View Post
[...] or "en_US", "en_GB" or something OTHER than "eng".
Be careful though, because the underline isn't valid.

You need to use a HYPHEN between the language + country (and any other extra subtags):
  • en = English
  • en-US = English (United States)
  • en-GB = English (British)
  • en-GB-oxendict = English (British) + Oxford English Dictionary spelling

- - - - - -

Technical Side Note: If you want all valid lang codes, see:

If you want more info on how to use all the variants/tags, see:

Technically, you can go 5 or 6+ layers deep... but in reality, most only handle levels 1+2.

- - - - - -

Quote:
Originally Posted by carmenchu View Post
Thanks! Language in metada was all right (English United States)--the issue was apparently with lang="eng" xml:lang="eng" in in the <html> tag--from original.
Yes, you can imagine it like an upside-down pyramid:
  • Language of entire book
    • In Sigil, Tools > Metadata Editor.
  • Language of each file (Optional)
    • <html>
  • Language of each tag (Optional)
    • <p>, <span>, <i>, [...]

The lower levels are going to take priority.

So you can have an:
  • English book
    • with a British article
      • with a Spanish paragraph
        • with a French sentence.
    • and an American article
  • en = EPUB Metadata
    • <html lang="en-GB">
      • <p lang="es">
        • <span lang="fr">
    • <html lang="en-US">

- - - - - -

Side Note: You can see some of that latest discussion in:

and many of my Greek topics over the years:

Marking your HTML lang + xml:lang is very helpful, especially when dealing with languages where you may need to use a different font.

Of course, most people will just say:
  • "This is an English book"
  • or "This an an English book + each chapter is English"

and be done with it.

But when you begin getting your book read by Text-to-Speech, or running it through Auto-Translate, tagging languages properly becomes very important.

Last edited by Tex2002ans; 06-28-2022 at 07:36 PM.
Tex2002ans is offline   Reply With Quote