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 moreSource§impl Debug for DndStrings
impl Debug for DndStrings
Auto Trait Implementations§
impl !RefUnwindSafe for DndStrings
impl !Send for DndStrings
impl !Sync for DndStrings
impl !UnwindSafe for DndStrings
impl Freeze for DndStrings
impl Unpin for DndStrings
impl UnsafeUnpin for DndStrings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InitializeFromFunction<T> for T
impl<T> InitializeFromFunction<T> for T
Source§fn initialize_from_function(f: fn() -> T) -> T
fn initialize_from_function(f: fn() -> T) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().