samvera-labs/nectar-iiif

When getLabelEntries returns value not matching requested lang, the components still uses lang on element

Opened this issue · 0 comments

I noticed that nectar returns wrong lang on elements when getLabelEntries returns values not matching requested language.

On this english page, https://chc-web.vercel.app/en/id/ubb-ms-0008, i am fetching a Manifest with metadata missing "en" values. Nectar shows the norwegian values in this case, but the html markup assumes that there will be values in the requested language. Example below.

<div role="group" data-label="subjects">
  <dt lang="en" class="nectar-c-PJLV">Subjects</dt>
  <dd lang="en" class="nectar-c-PJLV">
    Reiseskildringer,Reisebeskrivelser, Søvæsen vedk., Kapervirksomhet, Tyrkia, Journal of a priveteer, Avskriftssamling fra 16- og 
    17-tallet, Russland, 1700-tallet, Sørøvertogt, Pirater, England vedk., Krigshistorie, Dagboksoptegnelser, Sjørøveri
  </dd>
</div>

I believe the components should use the correct lang tag, when the Manifest have missing language values.