Narration
Every Galdur UI widget is read by Minecraft's narrator, in the player's language. Your screens are accessible without extra code.
⏱ 3 minGaldur UI 0.1.0Client
Turn it on
Minecraft's narrator is toggled with Ctrl+B. Galdur UI widgets then read themselves as the player moves the mouse or the keyboard focus.
What is read
- Vanilla texts when they exist: "Button", "Checkbox", "Tab 1 of 3 selected"…
- Otherwise the
narration.galdurui.*keys ofassets/galdurui/lang, in English and French: "List: 4 rows", "Progress bar: 50 percent", "Empty search field: Search...", "3 tabs"… - A disabled widget adds "disabled".
- A slot or a grid reads the item and its full amount.
- A menu screen reads the item of the hovered slot ("Iron Ingot, 32"), which Minecraft does not do.
- A window reads its first title when it opens.
Icon buttons
An icon button draws no text. Its label is used as the tooltip and as the narrated text, so always give it a meaningful one:
window.addIconButton(new ItemStack(Items.HOPPER), Component.literal("Sort"), this::sort);Text labels
A GaldurLabel is inactive, like vanilla's StringWidget, so the screen's automatic narration does not read it. This is the same behaviour as vanilla, on purpose.
Translations
Narration keys follow the player's language. To add a language, a resource pack can provide assets/galdurui/lang/<language>.json with the narration.galdurui.* keys.