Quote:
Originally Posted by bookman156
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
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
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
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).