In the PWA version of SAB's output the "Introduction" and "i" labels don't get localized

The file “app-builder-menus.js” is found in two places in the HTML output for PWAs.
These files do not localize the labelIntroduction” for the display of a book’s Introduction selection option in this IF statement:

if (hasIntro) {
	ref = baseRef + padWithLeadingZeros(0, 3) + ".html";
	baseText = baseText + "<div class='intro-menu-item'>" + "<a href='" + ref + "'>" + "Introduction" + "</a></div>";

As shown here:

Should it not at least offer to change this label to the National Language label as the PWA is being exported? It would be even better if the Menus stored labels for English to National to Local languages as defined in the UI settings of SAB, and then make the PWA able to conditionally change what is displayed depending on a UI language selection (like the final SAB APKs do).

Finally, the chapter abbreviation for “Introduction” is hardcoded somewhere to “i”! Seen here:

If anything, it would be most logical to hardcode it to “0” (zero), as this is more universal than “i”, and the Introduction to each book is the “chapter before chapter 1”, right?
Or possibly take the first letter off the National or Local language label (“Pendahuluan” → “p”). Or just read from the SAB settings what labels the app developer has chosen for these in the app.

The Interface has options to translate the word Introduction. Also you can change the Chapter Introduction Symbol to 0 for English and any other interface languages.

But that does not fix the HTML export.

All you can do for now is to change Introduction in the JavaScript file. I can’t find a place to change the i

I’ll change this to a feature request.

1 Like

You may not know the history of the HTML out. It was originally added to provide a way to test the text/audio synchronization. Then some partner asked if they could post it to their websites. Then they asked if it could be used to make Electron apps (for desktop). Then they asked if it could be used to make PWAs. They they asked us to support the workflow they created to make Electron apps and PWAs.

We decided to help them with generating the PWAs and see how much demand there would be for better PWA support.

We are in the process of researching better PWA support. I might be able to support better localization of the items you mentioned.


1 Like