buda-base / public-digital-library

http://library.bdrc.io
5 stars 6 forks source link

update transliteration button in etext #818

Open eroux opened 1 year ago

eroux commented 1 year ago

The current transliteration button (allowing to switch between Wylie and Unicode) is really good for Tibetan but should be adjusted for non-Tibetan etexts such as https://library.bdrc.io/show/bdr:UTIE0OPI4663C136_I1ER767?backToEtext=bdr:MW1ER114#open-viewer . It's not quite clear to me how to do that... but perhaps we could have instead:

Wdyt?

berger-n commented 1 year ago

the download button needs to be adjusted as well, is the transliterated text available?

eroux commented 1 year ago

hmmm good point... It's not available for non-Tibetan yet... I'll open a separate issue for that. For now you can call the download API with the bo-x-ewts argument for all romanizations, we'll adjust it later

eroux commented 1 year ago

another point is that perhaps we could check the language of the chunk before allowing the Monlam search popup to appear, since Monlam is Tibetan-only

berger-n commented 1 year ago

regarding Monlam we can even remove the icon here because there is no Tibetan displayed at all in the etext:

image

that being said, I've been able to test what happens when there's both Tibetan and non-Tibetan ([100] on page 1 is tagged Tibetan in the data, but I've set the test to ignore it later on so now there's no Tibetan detected at all in this etext):

bdr:UTIE0OPI4663C136_I1ER767_00000
   a             bdo:EtextChunk ;
   bdo:chunkContents  "100\n"@bo ;
   bdo:sliceEndChar  4 ;
   bdo:sliceStartChar  0 .

simplescreenrecorder-2023-03-23_17 28 34 mkv

berger-n commented 1 year ago

you can test it here: https://library-dev.bdrc.io/show/bdr:UTIE0OPI4663C136_I1ER767?backToEtext=bdr:MW1ER114#open-viewer

eroux commented 1 year ago

looks perfect, thanks a lot!

berger-n commented 1 year ago

not sure we actually need to change labels, couldn't this work as is?

(BTW downloading transliterated etext in sa-x-iast fetches https://purl.bdrc.io/resource/UTIE0OPI4663C136_I1ER767.txt?prefLangs=sa-x-iast which for now still returns the devanagari version / https://github.com/buda-base/lds-pdi/issues/241)

eroux commented 1 year ago

Oh ok, I didn't see it was like that already sorry! Looks good although we might run into some issues with works that mix Tibetan and Sanskrit... I'll try to have download implemented this afternoon

berger-n commented 1 year ago

Looks good although we might run into some issues with works that mix Tibetan and Sanskrit

oh indeed, do we already have some of these?

eroux commented 1 year ago

Good question.. we actually might

berger-n commented 1 year ago

found some mixed Chinese/Tibetan etexts to experiment with so it works now, with pinyin transliteration as well:

simplescreenrecorder-2023-03-27_16 31 23 mkv

eroux commented 1 year ago

looks perfect, thanks a lot!