A book with online dictionary - best way to do it?

6 posts / 0 new
Last post

Hi folks. So I've got books to publish in a rare language. And I want every word to be clickable so that some kind of a dictionary is invoked translating the word being clicked. I already have the web service/site in place that can output unformatted translation data when a word is being passed to it - no problems with it. The only major question that I have is how to present it all in the epub file to maximize the feature's utility and minimize user confusion and possibly as a bonus to be compatible with more readers than just one.
I can wrap each word into any tag automatically in the source text (split the sentences).

Things I have considered doing:
- Wrapping each word in a link that would open a browser and display a page with translation. [works, but some readers would ignore CSS styling for links displaying all of the words in color and with underlines]
- Opening an 'alert' popup [doesn't work]
- Appending the translation text to some hidden element [may not work]
- Adding words to a dictionary inside the book [not good for many reasons]

Any other things that I missed or better ideas?

Actually the dictionary might be good, if only I could find a way to populate the wordlist automatically on-demand instead of pre-populating it.

Thinking further along that glossary/dictionary route it might be possible if I could generate those internal files like glossary.xhtml on-the fly and sort of circumvent the external browser that way by providing internal links leading to automatically generated pages.

One simple option can be the title-attribute.
This is typically used for abbreviation, but using span instead of abbr one can apply it to any word, that requires an explanation.

Another option are additional documents in the book containing the glossary (they can be indicated to be non linear content). Then one can link from a word to a glossary entry.

For acessibility reasons the information has to be available in a static way.
Skripting can provide an alternative access to the information, but not the only one.

Thanks for the ideas, O.H., but I couldn't get the title attribute to display in the mobile readers whether using a span or an abbr. I'm not even sure about how it's supposed to be displayed. It works on desktop as expected of course.

Accessibility is a noble goal, of course, but there are serious cons to storing the data locally. The data in the dictionary and the lookup algorithm are constantly being updated and refined, always in a flux, it will also require additional pass over the text since a single root word can contain many variations (e.g. "doing" "does" "done") and I don't want the glossary to contain duplicate entries. By the time it's done it'll have to be reworked again.

Accessibility is a requirement.

And everything of the book has to be inside the book, there is no requirement for a viewer to have internet connection at the time of reading.

If you need much more, a data base, a server for HTTP(S), PHP, MySQL etc, it is not a book of the EPUB type anymore.

Secondary menu