pub struct DndStrings {Show 13 fields
pub picked_up: Rc<dyn Fn(&str) -> String>,
pub over: Rc<dyn Fn(&str) -> String>,
pub over_inside: TwoNamePhrase,
pub no_targets: Rc<dyn Fn() -> String>,
pub no_target_selected: Rc<dyn Fn() -> String>,
pub dropped_in: Rc<dyn Fn(&str) -> String>,
pub cancelled: Rc<dyn Fn() -> String>,
pub item: Rc<dyn Fn() -> String>,
pub zone: Rc<dyn Fn(u64) -> String>,
pub move_up: Rc<dyn Fn(&str) -> String>,
pub move_down: Rc<dyn Fn(&str) -> String>,
pub row: Rc<dyn Fn(usize) -> String>,
pub selection_count: Rc<dyn Fn(usize) -> String>,
}Expand description
The crate’s voice, one field per phrase. Every field is a function so
translations can reorder, inflect or pluralize freely; build it with
struct-update syntax over Default::default to override only what
you translate.
Fields§
§picked_up: Rc<dyn Fn(&str) -> String>Voiced when a keyboard drag picks an item up. Receives the
draggable’s label. This is also the user’s manual - keep the
key instructions (arrows, Enter, Escape) in the translation.
over: Rc<dyn Fn(&str) -> String>Voiced when keyboard navigation reaches a zone. Receives the zone’s name.
over_inside: TwoNamePhraseVoiced when keyboard navigation reaches a zone nested in a labeled parent. Receives the zone’s name, then the parent’s.
no_targets: Rc<dyn Fn() -> String>Voiced when an arrow key finds nowhere to go.
no_target_selected: Rc<dyn Fn() -> String>Voiced when Enter is pressed with no zone selected.
dropped_in: Rc<dyn Fn(&str) -> String>Voiced when a keyboard drop lands. Receives the zone’s name.
cancelled: Rc<dyn Fn() -> String>Voiced when Escape cancels the drag.
item: Rc<dyn Fn() -> String>Fallback name for a draggable with no label.
zone: Rc<dyn Fn(u64) -> String>Fallback name for a zone with no label. Receives the zone id’s
number.
move_up: Rc<dyn Fn(&str) -> String>ReorderButtons: the up button’s aria-label. Receives the row’s
name.
move_down: Rc<dyn Fn(&str) -> String>ReorderButtons: the down button’s aria-label. Receives the
row’s name.
row: Rc<dyn Fn(usize) -> String>ReorderButtons: fallback name for a row with no label. Receives
the 1-based row number.
selection_count: Rc<dyn Fn(usize) -> String>SelectionCount: the badge text. Receives how many items are in
flight - your chance at real plural rules.
Trait Implementations§
Source§impl Clone for DndStrings
impl Clone for DndStrings
Source§fn clone(&self) -> DndStrings
fn clone(&self) -> DndStrings
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more