accessibility-exchange / platform

The Accessibility Exchange platform.
https://github.com/orgs/accessibility-exchange/projects/2/views/8
BSD 3-Clause "New" or "Revised" License
4 stars 10 forks source link

Show sign language translation #496

Closed greatislander closed 1 year ago

greatislander commented 2 years ago
greatislander commented 2 years ago

From @cherylhjli on #308:

Can turn it on in the web accessibility preferences page: https://www.figma.com/file/AXufBnFAVHvGdsxnQMVhNF/The-Accessibility-Exchange-Wireframes?node-id=2265%3A74852

In-page it will show up as a button you can click to open and close the videos: https://www.figma.com/file/AXufBnFAVHvGdsxnQMVhNF/The-Accessibility-Exchange-Wireframes?node-id=2327%3A63742 https://www.figma.com/file/AXufBnFAVHvGdsxnQMVhNF/The-Accessibility-Exchange-Wireframes?node-id=2327%3A62233

jobara commented 2 years ago

@cherylhjli if I'm understanding the above wireframes correctly:

Questions:

cherylhjli commented 2 years ago

@jobara

jobara commented 2 years ago

From today's meeting:

The video should appear below the "Sign Language Video" button.

Yes

The video should take up the available width. So depending on which part of the screen the video will be displayed, it may be a different size.

@cherylhjli will provide specs on size e.g. max-width

There could be multiple videos open and potentially playing at the same time

Should only allow 1 video to play at a time. Preferably a video should also stop after it has been scrolled past. Look at the video's play events to stop other videos and HTML interaction observer to pause when out of view.

Is the "Sign Language Video" button a toggle button? On first press the video will be shown. On the second press the video will be hidden.

Yes

Will the video autoplay when it opens, or will the user need to explicitly play it?

Autoplay for now, but should get feedback from co-designers about preferred experience

Should there be video player controls? e.g. play, pause, stop, etc.

Yes

Have we considered using animated gifs instead of videos?

Seems that an optimized video can be 95% smaller than an animated GIF. See: https://rigor.com/blog/optimizing-animated-gifs-with-html5-video/

Other notes:

cherylhjli commented 2 years ago

@jobara Thinking that the max width for the sign language player can be 770px. Hoping for this to be 16x9 in terms of dimensions.

jobara commented 2 years ago

Talked with @greatislander about this some more today. Current idea will be to store the sign language video URLs or IDs in the database along with an identifier generated by a blade/livewire component in the templates. We'll add an admin page that allows an admin to view and modify all of the URLs and link back to where the video will be displayed. Additionally admins will be able to see a button where a video is or can be inserted, which will open an inline edit of the video URL/ID. In this way they can make edits to that on the page where the video will be displayed.

jobara commented 2 years ago

I left some thoughts on the implementation in the Matrix channel.

The gist is generating the section identifiers based off of the slot content is problematic because this content is localized and will be different for the English and French pages. Additionally if localized strings haven't been provided for French when the model is generated, it will store the English text in place which can cause problems later when the French translation is provided.

jobara commented 2 years ago

Talked things over with @greatislander we're going to go with the option of adding a name attribute to the component, with the name taking a localized string that is forced to be in English.

Something like the following:

<x-interpretable-heading :name="{{ __('What is the accessibility exchange?', [], 'en') ">
    <h2 class="align:center" id="what">{{ __('What is the Accessibility Exchange?') }}</h2>
</x-interpretable-heading>

In this way we have a consistent identifier to work from, and it will be included in the localized strings. We can then use the outputted value from the name attribute to re-run through localization when we need to use it to get the translated version as necessary at run time.

jobara commented 2 years ago

An additional consideration is how to provide the link backs to the video locations in context from the admin page when there is a parameter in the URL.

We may be able to find the parameters by doing something like request()->route()->parameters() from the blade component. We'd then need to do some introspection on each parameter to see if they are a string or object.

However, it isn't clear which particular resource we should be linking to from the admin page as these are often tied to a specific user/resource even if the page may visually be the same (e.g. form) for all cases.

Some options:

jobara commented 2 years ago

@greatislander and @cherylhjli, I was going through to add the placeholders for the workflows that were identified for translations. Initially I was just adding the <x-interpretable> component around the <h2> elements. This component essentially creates/finds the model instance for a the sign language video. When a video exists, and the sign language video feature is enabled, the sign language button and video will be appended.

A couple of implementation issues I've run into with workflow 2 which goes through the creation of the public page for an Individual. These are forms with an <h2> at the top and form fields below. In following the wireframes, I was going to add the interpretable component to each input or fieldset. I can wrap a <label>/<x-hearth-label>. However, if the input is a translatable input the label is encapsulated within that component. I could modify those translatable components to always wrap their labels, but we don't have access to the raw localized text, and as such would also need to require that be passed in to the translatable components. Another issue is with <fieldset>'s. It would make sense to wrap the <legend> however, the legend needs to be the first child of the <fieldset> so it cannot be wrapped. I could just put an empty <x-interpretable> component after the <legend> as we don't really do anything with the slot. I'm also thinking now that we don't really need a wrapping component as it will also make it easier to not include on a page when sign language isn't enabled.

@cherylhjli am I adding these to the correct locations on the pages. I guess we'll have more clarity when we hear back from those creating the videos, but does what I've mentioned above seem like the places you were expecting to add the sign language interpretations?