edrlab / thorium-reader-epub-tests

W3C tests for EPUB 3.3 applied to Thorium Reader
BSD 3-Clause "New" or "Revised" License
2 stars 0 forks source link

(epub-test-fail: pkg-dir_rtl-root-ltr) #18

Closed gautierchomel closed 2 years ago

gautierchomel commented 2 years ago

The pkg-dir_rtl-root-ltr test fails at Screenshot of how it has to render with the ! first caracter on the left

It renders correctly in the window heading but not on catalog interface

OPF meta Title <dc:title dir="rtl" xml:lang="he">CSS: הרפתקה חדשה!</dc:title>

Test table line 76

danielweck commented 2 years ago

This will be solved in two stages:

See how the RWPM title incorrectly assume en instead of xml:lang on the OPF package or local to dc:title:

https://streamer.edrlab.org/pub/aHR0cHM6Ly9naXRodWIuY29tL3czYy9lcHViLXRlc3RzL3Jhdy9tYWluL3Rlc3RzL3BrZy1kaXJfcnRsLXJvb3QtbHRyLmVwdWI%3D/manifest.json/show/all

danielweck commented 2 years ago

Update: the streamer deployment is now updated with the fixed r2-shared-js code, consequently the title and author JSON properties now carry the language info (from which we derive rtl direction): https://streamer.edrlab.org/pub/aHR0cHM6Ly9naXRodWIuY29tL3czYy9lcHViLXRlc3RzL3Jhdy9tYWluL3Rlc3RzL3BrZy1kaXJfcnRsLXJvb3QtbHRyLmVwdWI%3D/manifest.json/show/all (PS: I must investigate why the publisher property remains language-free)

danielweck commented 2 years ago

(PS: I must investigate why the publisher property remains language-free)

Ok: https://github.com/readium/r2-shared-js/blob/65506bc848b84eed235dee05f5f02c9077f64807/src/parser/epub/opf-author.ts#L15-L34

danielweck commented 2 years ago

Fixed.

Tested with pkg-dir_rtl-root-ltr.epub from https://github.com/w3c/epub-tests/blob/main/tests/pkg-dir_rtl-root-ltr.epub

Screenshot 2022-09-29 at 15 21 35 Screenshot 2022-09-29 at 15 22 15 Screenshot 2022-09-29 at 15 22 52 Screenshot 2022-09-29 at 15 23 19
danielweck commented 2 years ago

Fixed via https://github.com/edrlab/thorium-reader/commit/d67cab6ae21ddc2f9eecf27c8e0bdf1b26fa9a62

danielweck commented 2 years ago

Here is a more interesting test case:

https://github.com/IDPF/epub3-samples/tree/main/30/regime-anticancer-arabic/EPUB

=>

https://streamer.edrlab.org/pub/aHR0cHM6Ly9naXRodWIuY29tL0lEUEYvZXB1YjMtc2FtcGxlcy9yZWxlYXNlcy9kb3dubG9hZC8yMDE3MDYwNi9yZWdpbWUtYW50aWNhbmNlci1hcmFiaWMuZXB1Yg%3D%3D/manifest.json/show/all

   "metadata": {

        "title": {
            "ar": "السرطان من  للوقاية الصحيح الغذائي  النظام",
            "fr": "Le Vrai Régime anti-cancer"
        },

        "author": [
            {
                "name": {
                    "ar": "دافيد  خيّاط لبروفيسورا",
                    "fr": "Pr David Khayat"
                }
            },
            {
                "name": {
                    "ar": "اردو هاتر ناتالي",
                    "fr": "Nathalie Hutter-Lardeau"
                }
            }
        ],
        "translator": {
            "name": {
                "ar": "فيّاض خليل مارينا",
                "fr": "Marina Khalil Fayad"
            }
        },
        "contributor": {
            "name": "Vincent Gros",
            "sortAs": "Gros, Vincent",
            "role": "mrk"
        },

        "language": "ar",

        "readingProgression": "rtl",

    },
danielweck commented 2 years ago

Here we can see that when the Thorium UI is set to fr (French) the available title metadata is selected for display, whereas the default en (English) UI locale selects the first available title language which is ar (Arabic)

Screenshot 2022-09-29 at 15 50 44 Screenshot 2022-09-29 at 15 49 39
danielweck commented 2 years ago

Note that publication "authors" are not subject to the same title logic ... yet. We will need to fix this, and several other instances too (e.g. dc:description, a11y:summary)

panaC commented 2 years ago

fixed by https://github.com/edrlab/thorium-reader/commit/d67cab6ae21ddc2f9eecf27c8e0bdf1b26fa9a62