tify
tify copied to clipboard
configure display of labels
Our use case with display of labels is admittedly a bit complex and unusual but I think it would be easily satisfied with a configuration option. The idea is that when we have a label like
"label": [
{
"@language": "en",
"@value": "volume 1"
},
{
"@language": "bo-x-ewts",
"@value": "pod/_1"
}
]
we want to control the rendering in the UI. Sometimes this will be as simple as selecting the label in the preferred language of the user. But it can get quite complicated, for instance for some users we will want to transform the Tibetan transliteration (pod/_1
) into Tibetan script (པོད། ༡
). Is it possible to pass a function with a signature like:
labels_to_display_string(labels: {"@language": string, "@value": string}[]) => string
to the configuration of tify? This is I think the main blocker for the adoption of tify on BDRC
The method responsible for this selects a label in the preferred language as per IIIF API specs. For anything else, you would have to modify TIFY’s code a bit. @ipf, what do you think?