[Koha] Linking bibliographic records to the Wikipedia

Eric Phetteplace ephetteplace at cca.edu
Thu Mar 23 04:57:07 NZDT 2023


Hi Erlanda,

You could customize your JS to 1) detect which script is being used on the
record and 2) adjust the Wikipedia domain accordingly. Language is in the
041 MARC field https://www.oclc.org/bibformats/en/0xx/041.html but you need
to have that field or else there's no straightforward way, from looking at
a record, to know what language it's in.

Then your JS would be adjusted roughly like this (not knowing what it
currently looks like):

// map of language names to Wikipedia subdomains
// I think the 041 will always display in English? But you would want to
check
const map = { 'Armenian': 'hy', 'English': 'eng', 'Russian': 'ru'}
const lang = $('.language span[class^="lang_code]').text()
const wsubdomain = map[lang]

Then where you link to Wikipedia, use the variable wsubdomain, e.g.
`${wsubdomain}.wikipedia.org/...`.

Interesting customization! Both the Wikipedia link and the fact that it's
multilingual.

Best,

ERIC PHETTEPLACE Systems Librarian, Libraries (he/him)

ephetteplace at cca.edu


*CCA is situated on the traditional unceded lands of the **Chochenyo and
Ramaytush Ohlone** peoples.*

Black-owned bookstores in Oakland: Ashay by the Bay
<https://ashaybythebay.com/>, Marcus Books
<https://www.facebook.com/marcus.books/>

:(){ :|: & };:


On Wed, Mar 22, 2023 at 5:53 AM <erlanda_simonyan at flib.sci.am> wrote:

> Dear list,
>
> We are using Koha 21.05.19 and using JS to link 1xx fields in the
> bibliographic records to the Wikipedia relevant authors entry.
> We are cataloging in different scripts, e.g. Armenian books in Armenian
> (1xx is in Armenian), books in Cyrillic in Cyrillic script (e.g. 1xx is in
> Cyrillic), Persian books also are cataloged (e.g. 1xx is in Farsi), and
> Latin.
> Depending on the 1xx script (in each bibl. record only one script is
> present for 1xx), when pressing in Koha on Wikipedia icon next to the
> authors name we will be happy to be redirected to the different Wikipedia
> repositories, e.g.
> - for Armenian authors to be redirected to the hy.wikipedia.org
> - for Russian authors to be redirected to the ru.wikipedia.org
> - for English authors to be redirected to the en.wikipedia.org
> etc
>
> How to solve this problem?
>
> many thanks,
> Erlanda
> _______________________________________________
>
> Koha mailing list  http://koha-community.org
> Koha at lists.katipo.co.nz
> Unsubscribe: https://lists.katipo.co.nz/mailman/listinfo/koha
>


More information about the Koha mailing list