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]
- 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 - Enable this gadget in Special:Preferences → Gadgets.
- Open a page in VisualEditor.
- Insert or edit an image to open the media dialog.
- Click ✨ Generate Alt Text next to the alt text field.
- 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 |