View Single Post
Old 03-03-2021, 04:27 AM   #10
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 ebray187 View Post
Also i have set the <dc:language>es</dc:language> into the content.opf file


An EPUB's language goes like a pyramid:
  • book-level = content.opf
  • chapter-level = <html>
  • word-level = <span>

1. Setting the content.opf correctly is the most important! And you did that great.

This says "this book is in Spanish!"

2. (Optional) Add lang + xml:lang to your <html>:

Chapter01.xhtml (Before):

Code:
<html xmlns="http://www.w3.org/1999/xhtml">
Chapter01.xhtml (After):

Code:
<html xmlns="http://www.w3.org/1999/xhtml" lang="es" xml:lang="es">
This says "this chapter is Spanish!"

3. (Super duper optional) Mark "foreign words" with their language:

Code:
<p>¿Puedo ir al bathroom, por favor?</p>
Code:
<p>¿Puedo ir al <span lang="en" xml:lang="en">bathroom</span>, por favor?</p>
This says "the entire book/chapter/sentence is in Spanish, but the word 'bathroom' is English!"

Quote:
Originally Posted by ebray187 View Post
I had understood that adding the xml:lang="X" was enough for it to work properly.
Any time you're marking which language, it's good practice to use BOTH lang + xml:lang.

Basic idea is lang = HTML + xml:lang = XML.

I explained a little more in this post a few days ago:

"Search and Replace" (Post #11)

And one common error that occurs is someone having the book + chapters be mismatched.

(So a Spanish book "es", but you accidentally set English "en" in an HTML chapter. This is pretty easy to spot in the Language column in Tools > Spellcheck > Spellcheck.)

Last edited by Tex2002ans; 03-03-2021 at 04:32 AM.
Tex2002ans is offline   Reply With Quote