MediaWiki:Gadget-AutoImageAltText: Unterschied zwischen den Versionen

hw>Rvogel
K 1 Version importiert
 
Margit Link-Rodrigue (Diskussion | Beiträge)
K 1 Version importiert
 
(kein Unterschied)

Aktuelle Version vom 2. Oktober 2026, 14:00 Uhr

Auto Image Alt Text[Quelltext bearbeiten]

Adds a ✨ Generate Alt Text button to the media dialog in VisualEditor. When clicked, it fetches the selected image and uses AI vision to generate a descriptive, meaningful alt text — improving accessibility without manual effort.

Usage[Quelltext bearbeiten]

  1. Add the following line to MediaWiki:Gadgets-definition: * AutoImageAltText[ResourceLoader|default|messages=bs-ai-alt-text-button,bs-ai-alt-text-loading,bs-ai-alt-text-filename-error,bs-ai-alt-text-fetching,bs-ai-alt-text-success,bs-ai-alt-text-error]|AutoImageAltText.js
  2. Enable this gadget in Special:Preferences → Gadgets.
  3. Open a page in VisualEditor.
  4. Insert or edit an image to open the media dialog.
  5. Click ✨ Generate Alt Text next to the alt text field.
  6. The AI-generated description is filled in automatically and can be edited before saving.

Requirements[Quelltext bearbeiten]

  • VisualEditor must be active.
  • The image must be accessible via a public URL resolvable by the AI service.
  • The AI service endpoint must support vision/image input and must be configured in the wiki's environment settings.

Message keys[Quelltext bearbeiten]

The following system messages can be translated by creating MediaWiki:<key>/<language-code> pages:

Key Default (English)
bs-ai-alt-text-button ✨ Generate Alt Text
bs-ai-alt-text-loading ⏳ Generating...
bs-ai-alt-text-filename-error Could not extract filename from URL
bs-ai-alt-text-fetching Fetching image and generating alt text...
bs-ai-alt-text-success Alt text generated successfully!
bs-ai-alt-text-error Failed to generate alt text: $1