While many EPUBs include text in one main language, they may also include a few phrases or sentences in other languages throughout the book. For example, an English language novel may include a phrase or two in French, or perhaps Spanish in some of the chapters. This article discusses how to tag such language shifts in your EPUB, and how to test them using an eBook reading application called Thorium.
What is an example of a language shift?
In the example below, the French phrase is wrapped between <span> tags, and the language shift is noted using the language code “fr-FR”—the code for French (France). Similarly, the language code for French (Canada) is “fr-CA”, and the general code for French is simply “fr”.
Language shifts are noted using the lang= and xml:lang= attributes. The value for each of these attributes denotes the language code, which signals the shift for screen reading software.
Thorium Reader is a free eBook reading application with a text-to-speech function. To test your language shift, activate the text-to-speech button, as highlighted in the screenshot below.
You may find that even though your language shift is coded correctly, the text-to-speech narration does not pronounce the phrase properly. First, double-check if the language shift was coded with the right language code. Next, check if your computer has the voice package of the language you are testing. If not, you will need to install the voice package manually.
Installing language voice packages on Windows
Below are the steps you can use to install language voice packages on Windows 11:
Go to Settings, then click the Accessibility tab.
From the options under “Vision”, click on “Narrator.”
Under the options for “Narrator’s voice”, click on “Add legacy voices.”
Under “Manage voices” click “Add voices”, then choose the language you wish to test in Thorium from the list of languages. (Note that the number of languages available to download is limited.)
Click “Add.”
You may need to close and reopen the settings and any other applications that use voice packages to find the recently downloaded language in your settings. Once the voice package is installed, test the language shift in Thorium again using the text-to-speech function.
Another way to install voice packages in settings is by navigating to “Time & language”, then “Speech”, then clicking “Add voices” under “Manage voices.”
The difference with the Accessibility option outlined above is that you can find related accessibility settings in the Accessibility tab, including device and volume settings.
Installing language voice packages on Mac
Below are the steps you can use to install language voice packages on macOS Ventura:
Go to System Settings.
Navigate to Accessibility.
In the dropdown list next to the “System voice” option, scroll down to “Manage Voices…”
You will find a list of languages on the left side of the window. Click on the language you want to download. There will be a list of voice packages for specific dialects of the language, if available. Next to the voice package you wish to download, click the download icon on the right.
Click “OK.”
You can now test the language shift in Thorium using the text-to-speech function. Please note that similar to Windows, the number of languages available for download is limited in Mac as well.
Next Steps
1
Learn About Born-Accessible Ebooks
Introduction to Born-Accessible Ebook Production
Creating born-accessible books in-house requires a commitment to accessibility, and an eagerness to learn. This brief Introduction discusses how a publisher can begin strategizing and planning for this goal.
Subject(s): Ebook Production, Strategic Planning
Resource Type(s): Foundations and Rationale
Audience:
Introduction
2
Preparing a Book for Conversion
Ebook Workflow Guide: In-house Production of Born-Accessible Ebooks
To prepare a book for conversion, with accessibility in mind, the steps covered in Ebook Workflow Guide: In-house Production of Born Accessible Ebooks should be followed (if you use Word and InDesign for your manuscript…
Subject(s): Ebook Production
Resource Type(s): Standards and Best Practices, Step-by-Step