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

Add support for "language" property on "homepage" property #3629

Closed
ggeisler opened this issue Jan 30, 2023 · 1 comment
Closed

Add support for "language" property on "homepage" property #3629

ggeisler opened this issue Jan 30, 2023 · 1 comment

Comments

@ggeisler
Copy link
Collaborator

ggeisler commented Jan 30, 2023

This could be related to #3470, but that appears to be fixed -- at least the multilingual demo example that was linked as not working, does appear to me to work now -- although that ticket is still open.

Current behavior

If a "homepage" property is present in a manifest, we currently display it in the Related > Links section of the viewer sidebar:

Screen Shot 2023-01-30 at 2 18 14 PM

However, if the manifest includes multiple language versions of the homepage label, I believe we display the first one, without checking to see if that one matches the currently selected locale. For example, for this manifest edited to include multiple language labels for the homepage property:

  "homepage": [
    {
      "id": "https://www.getty.edu/art/collection/object/103RQQ",
      "type": "Text",
      "label": {
        "en": [
          "Home page at the Getty Museum Collection"
        ],
        "fr": [
          "French label for home page"
        ]
      },
      "format": "text/html",
      "language": [
        "en"
      ]
    }
  ],

The label for the homepage link is always the value for the first language in the manifest, whether I've chosen the English or French locale, and if I swap the order of the en and fr language attributes.

So it appears that we're simply not looking for the presence other language attributes in the homepage property, or there's a bug in the code that does try to do this.

Desired behavior

The desired behavior is we check the currently selected locale of the viewer and if there is a homepage language attribute that matches that locale, we use that label for the homepage link. We currently do this as desired for the label property of the metadata property, for example -- see how this cookbook manifest correctly displays "Auteur," "Sujet," and the Subject value as labels if you load it in the viewer and change your locale to French:

Screen Shot 2023-01-30 at 2 36 04 PM


As an example, going back to my simplistic manifest edit above that adds a fr attribute to the homepage label, if that is in the loaded manifest and we are in the fr locale, we'd expect the Related > Links section to show the fr version of the label:

Screen Shot 2023-01-30 at 2 49 49 PM

@ggeisler
Copy link
Collaborator Author

Closing this, for now at least, because I think I might've misunderstood which properties the lang label options are required to be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant