w3c / wai-translations

Future home of translations guidance and information on translated resources
5 stars 5 forks source link

Simplify VTT management (improved version) #125

Closed remibetin closed 7 months ago

remibetin commented 7 months ago

TL:DR

Detailed description:

  1. All VTT files are stored in wai-website-data repository, in wai-videos folder. Inside this folder, VTT files can be organized in subfolders.

Directory structure illustration:

.
├── wai-videos
│   ├── perspective-videos
│   │   ├── en
│   │   │   ├── keyboard.en.vtt
│   │   │   └── captions.en.vtt
│   │   └── fr
│   │       ├── keyboard.fr.vtt
│   │       └── captions.fr.vtt
│   └── video-introduction
│       ├── video-introduction.en.vtt
│       ├── video-introduction.fr.vtt
│       ├── video-introduction.de.vtt
│       └── video-introduction.zh-hans.vtt
└── ...
  1. A new video-metadata.yml file is created in wai-website-data repository.

Example: extract related to Keyboard Compatibility perspective video :

- id: keyboard # Unique identifier of the video. Used to identify VTT files for this video, based on the beginning of their basename. Example: keyboard.en.vtt, keyboard_ad_desc.en.vtt, etc.
  name: # Used in "All WAI Translations".
    en: "Web Accessibility Perspectives: Keyboard Compatibility"
    fr: "L'accessibilité Web illustrée : Compatibilité avec le clavier"
  main-page: /perspective-videos/keyboard/ # Ref of the main page hosting this video. Used in "All WAI Translations". 
  path: perspective-videos # From wai-videos folder, path to the VTT files for this video
  lang-folder: true #[Optional] When set to `true`, means VTT files for a language are located in a subfolder named after the language shortcode. Example: `perspective-videos/en` rather than directly in `perspective-videos/`
  captions: # Type of functionality available for this video
    - en #captions' language
  captions-ad:
    - en
  subtitles:
    - fr #languages of the available translations/VTT files.
    - zh-hans
  subtitles-ad:
    - fr
    - zh-hans
  descriptions-ad:
    - en
    - fr
    - zh-hans

When a VTT file is translated in a new language, the translator adds the language shortcode to the list of languages available for the relevant functionality (subtitles, subtitles for the audio-description version, descriptions for the audio-description version, etc.)

  1. In the page hosting the video, a different video player include is used (video-player-data.html instead of video-player.html), with the following new attribute:

Example:

{% include video-player-data.html
    video-id="keyboard"
    yt-id="7RHG_XiQ0ck"
    yt-id-ad="21yWr7evHTs"
%}

Opened PRs:

shawna-slh commented 7 months ago

@iadawn OK with you? I've added to our discuss list...