Quote:
Originally Posted by BeckyEbook
Change language in metadata from "eng" to "en" [...]
|
Yep, "eng" is an invalid language.
Instead, you'd use:
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
[...] 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
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)
- Language of each tag (Optional)
The lower levels are going to take priority.
So you can have an:
- English book
- with a British article
- and an American article
- en = EPUB Metadata
- <html lang="en-GB">
- <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.