Improved accessibility (#118):

* Adding a role="region" and an aria-label="Chat" on the chat container.
This commit is contained in:
John Livingston 2024-08-20 17:24:18 +02:00
parent 3177c31b08
commit e65bd5c426
No known key found for this signature in database
GPG Key ID: B17B5640CE66CDBC
3 changed files with 4 additions and 0 deletions

View File

@ -12,6 +12,7 @@ declare const MUSTACHE_CONFIGURATION_CHANNEL: string
// Constants that begins with "LOC_" are loaded by build-client.js, reading the english locale file.
// See the online documentation: https://livingston.frama.io/peertube-plugin-livechat/contributing/translate/
declare const LOC_ONLINE_HELP: string
declare const LOC_CHAT: string
declare const LOC_OPEN_CHAT: string
declare const LOC_OPEN_CHAT_NEW_WINDOW: string
declare const LOC_CLOSE_CHAT: string

View File

@ -46,6 +46,8 @@ async function initChat (video: Video): Promise<void> {
container.setAttribute('id', 'peertube-plugin-livechat-container')
container.setAttribute('peertube-plugin-livechat-state', 'initializing')
container.setAttribute('peertube-plugin-livechat-current-url', window.location.href)
container.role = 'region'
container.ariaLabel = await ptContext.ptOptions.peertubeHelpers.translate(LOC_CHAT)
placeholder.append(container)
try {

View File

@ -1,3 +1,4 @@
chat: Chat
online_help: "Online help"
open_chat: "Open chat"
open_chat_new_window: "Open chat in a new window"