Closed stephenwf closed 3 months ago
I have a few use cases for this @stephenwf and I'd be happy to review.
Yeah that would be great, thanks @mathewjordan!
@mathewjordan I've stared at it for a while, but I don't know if I've missed any property that could have a language property. I know annotation bodies could have language/value, but that feels like something else (not for making translating the IIIF manifest itself easier).
I think I want to add one more feature here. From Vault
if you import a Manifest or Collection, I want it to add a meta
value for the available languages.
So calling:
vault.getResourceMeta(manifest, 'availableLanguages'); // ['en', 'fr']
Maybe even with a helper on vault to do:
vault.getAvailableLanguages(manifest); // ['en', 'fr'];
I think I want to add one more feature here. From
Vault
if you import a Manifest or Collection, I want it to add ameta
value for the available languages.So calling:
vault.getResourceMeta(manifest, 'availableLanguages'); // ['en', 'fr']
Maybe even with a helper on vault to do:
vault.getAvailableLanguages(manifest); // ['en', 'fr'];
That looks very helpful.
@mathewjordan I've stared at it for a while, but I don't know if I've missed any property that could have a language property. I know annotation bodies could have language/value, but that feels like something else (not for making translating the IIIF manifest itself easier).
I could see it useful for an Annotation body as well. Though, it'd be highly dependent on the motivation of the annotation and situation within the consuming app. In my use case, I would want to know all languages available of resources on screen, to provide a locale [Select] component.
Yeah, I think adding in a check on the Annotation body should be fairly straight-forward. I'll add that in.
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.