View Single Post
Old 07-20-2022, 07:59 PM   #239
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 bookman156 View Post
Cheers Tex2002ans, that's really interesting. I particularly like the idea of getting a French dictionary for French words, that's pretty cool.


Quote:
Originally Posted by bookman156 View Post
What's the difference, if any? Is it best to just have both all the time?
Use both all the time.

I described the reasons why in 2021: "Search and Replace" (Post #11).
  • HTML = lang
  • XHTML (or XML) = xml:lang

Most programs recognize both types, but there may be tools out there that only support 1 of the 2.

Quote:
Originally Posted by bookman156 View Post
I've never actually thought about tagging foreign phrases in English text before. I do a lot of stuff with traditional Chinese, I may well build that in, it's interesting.
Fantastic. Your life is a hell of a lot easier then!

Finding "foreign words" in alternate alphabets (like Greek/Chinese/Japanese) is much easier because you can use Spellcheck Lists + Reports—after you sort all words alphabetically, the Chinese words pop right out!

See my amazing mini-tutorial in:

and my topic where I described all the ins/outs:

Finding all the French in an English book is pretty painstaking, because they both use the Latin alphabet... but tagging all Chinese? Easy peasy. (Or should I say "easier peasier"?)

Quote:
Originally Posted by bookman156 View Post
And just to confirm, you'd need to add a span class to get say French into italic? Or can you directly style the language declaration?
Use:

Code:
<i class="french" lang="fr" xml:lang="fr">
The class is optional, but allows you to easily use basic CSS (which will work on everything):

Code:
i.french {
	font-color: red;
}
With advanced CSS selectors, you're able to choose based on languages:

Code:
i:lang(fr) {
	font-color: red;
}
but support for that across devices/ebooks might not be the best.

(For more info, see MDN article on ":lang()".)

* * *

Anyway, this thread should really stick to discussion on Italics/Emphasis.

If you want more info on HTML lang, read all those previous linked topics (and then create a separate, new thread, so it'll be infinitely easier to find in the future).

Last edited by Tex2002ans; 07-20-2022 at 08:44 PM.
Tex2002ans is offline   Reply With Quote