Reader support

Text and language

Apply language and Easy Read text to the rendered content without losing the connection to the book.

Every meaningful element in an ADT page has a data-id. That id is the join key between the content HTML and the feature data.

Text-map referenceWebPub Β· content/i18n/en-US/texts.json
{
  "pg001_im001": "A spotted hyena stands on the ground looking up at a black raven flying above it.",
  "pg001_n0002": "Hyena and",
  "pg001_n0003": "Raven",
  "pg001_n0005": "Tony Lelliott",
  "pg001_n0006": "Wiehan de Jager",
  "pg001_n0007": "English",
  "pg002_im002": "A spotted hyena stands on the ground while a black raven flies above it against a green sky.",
  "pg002_n0002": "Hyena and Raven were once great friends.",
  "pg002_n0004": "They played together all the time.",
  "pg003_im002": "Hyena talks to Raven and gestures toward the sky under a few white clouds.",

  // … 120 more entries
}

Select the display text

Load content/i18n/<lang>/texts.json for the active language. For each element in the page, replace its text with the matching value. Easy Read values use the same id with an _easy_read suffix.

const easyReadValue = texts[`${id}_easy_read`];
const value = easyRead && typeof easyReadValue === "string"
  ? easyReadValue
  : texts[id];

For images, set alt instead of text content. Re-apply the map after every navigation: a newly loaded document contains the original shipped text.

Keep ids package-local

data-id values are ordinal and can change when the book is re-exported. Use them to join data within the package currently open, never as permanent keys for bookmarks, notes, highlights, or reader state.

Respect EPUB Media Overlay targets

EPUB content can contain word spans targeted by SMIL. Replacing a node’s whole HTML removes those targets and breaks synchronisation. Preserve them when using Media Overlays, or use the book’s export-language text without replacing it.

Discover the available languages

Read languages.available and languages.default from assets/config.json. The same file carries every feature flag; a false value means that no data was generated for that capability.

Feature and language configurationWebPub Β· assets/config.json
{
  "title": "Hyena and Raven",
  "bundleVersion": "1",
  "languages": {
    "available": [
      "en-US",
      "pt-BR"
    ],
    "default": "en-US"
  },
  "features": {
    "signLanguage": true,
    "easyRead": true,
    "glossary": true,
    "eli5": false,
    "readAloud": true,
    "autoplay": true,
    "showTutorial": false,
    "showNavigationControls": false,
    "describeImages": true,
    "notepad": false,
    "state": true,
    "characterDisplay": false,
    "highlight": false,
    "activities": true
  },
  "analytics": {
    "enabled": false,
    "siteId": 0,
    "trackerUrl": "https://unisitetracker.unicef.io/matomo.php",
    "srcUrl": "https://unisitetracker.unicef.io/matomo.js"
  },
  "lockedSettings": [
    "dockLayout",
    "theme",
    "iconSize",
    "reduceMotion"
  ]
}

On this page