Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logic for getting values from LabelValuePair #74

Closed
wants to merge 1 commit into from

Commits on Sep 28, 2020

  1. Fix logic for getting values from LabelValuePair

    This fixes a faulty heuristic introduced in IIIF-Commons#60, which would override
    the default locale with the locale of the first label and then attempt
    to fetch the value with that logic.
    This heuristic breaks even in the simple case were labels are available
    in multiple languages, but the values only available in one. If the
    first language of the labels did not correspond to the language of the
    value, the client would get no value back.
    This is clearly in violation of the algorithm prescribed for IIIF
    property values in the Presentation API spec[1], which states:
    
    > If none of the values have a language associated with them, the client
    > must display all of the values.
    
    and
    
    > If all of the values have a language associated with them, and none
    > match the language preference, the client must select a language and
    > display all of the values associated with that language.
    
    as well as
    
    > If some of the values have a language associated with them, but none
    > match the language preference, the client must display all of the values
    > that do not have a language associated with them.
    
    [1] https://iiif.io/api/presentation/2.1/#language-of-property-values
    jbaiter committed Sep 28, 2020
    Configuration menu
    Copy the full SHA
    d5bfdd9 View commit details
    Browse the repository at this point in the history