Skip to content

Conversation

JayPanoz
Copy link
Contributor

@JayPanoz JayPanoz commented Jul 5, 2025

This adds support for accessibility in metadata of Shared Models (RWPM doc).

Display Guide to follow

@JayPanoz JayPanoz marked this pull request as ready for review August 18, 2025 15:15
@JayPanoz JayPanoz requested a review from chocolatkey August 18, 2025 15:15
@JayPanoz
Copy link
Contributor Author

@chocolatkey I am not anticipating changes myself so I’m marking this as ready to review so that another pair of eyes can see whether this is acceptable or whether we want to do some things in a smarter way.

As a recap, this adds accessibility in metadata, which is the most trivial part.

It also handles the Accessibility Metadata Display Guide, in a way that should be consistent with Swift – so statements with an id, a compact string, and a descriptive string.

For localization, I had to design something around thorium-locales. Basically:

  • there is a script extracting what we need from the json in order to build its own in publication/accessibility/locales/.
  • there is a Localization instance that is a singleton, which allows you to register your own locale, setting the one that should be used by classes, and get the compact and descriprive strings.
  • At this point it means the json is packaged since we only have en and fr – as-is Readium CSS in Navigator for instance –, but in theory, Vite should allow us to handle this dynamically as locales/languages are added.

It is kind of straightforward as classes are just mapping statements to conditions but of course there may be room for improvements and/or details that could be polished.

Copy link
Member

@chocolatkey chocolatkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The circular dependency on thorium for the locales data is a bit unusual and couples it strongly to the EDRLab repo, but it works

return this.uri;
}

public static readonly EPUB_A11Y_10_WCAG_20_A = new AccessibilityProfile('http://www.idpf.org/epub/a11y/accessibility-20170105.html#wcag-a');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nice to add comments to these for intellisense

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point will do

return this.value;
}

public static readonly AUDITORY = new AccessMode('auditory');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same goes for here (and below), it might be nice to add comments to these for intellisense

}

public static readonly NONE = new Feature('none');
public static readonly ANNOTATIONS = new Feature('annotations');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HadrienGardeur should I be adding the missing features to the go-toolkit?

public static readonly EAA_DISPROPORTIONATE_BURDEN = new Exemption('eaa-disproportionate-burden');
public static readonly EAA_FUNDAMENTAL_ALTERATION = new Exemption('eaa-fundamental-alteration');
public static readonly EAA_MICROENTERPRISE = new Exemption('eaa-microenterprise');
public static readonly EAA_TECHNICAL_IMPOSSIBILITY = new Exemption('eaa-technical-impossibility');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is also not in the go-toolkit @HadrienGardeur

@JayPanoz JayPanoz added this pull request to the merge queue Aug 29, 2025
Merged via the queue into develop with commit 766c6b6 Aug 29, 2025
6 checks passed
@JayPanoz JayPanoz deleted the shared-accessibility branch August 29, 2025 10:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants