Messages

io.worxbend.tui.dsl.Messages
See theMessages companion object
final case class Messages(dialogOk: String = ..., dialogCancel: String = ..., helpTitle: String = ..., paletteTitle: String = ..., palettePlaceholder: String = ..., wizardBack: String = ..., wizardNext: String = ..., wizardFinish: String = ..., inspectorTitle: String = ..., inspectorTreeTitle: String = ..., inspectorNothing: String = ..., promptYes: String = ..., promptNo: String = ..., promptYesNoDefaultYes: String = ..., promptYesNoDefaultNo: String = ..., promptCancelled: String = ..., promptRequired: String = ..., promptSelectHint: String = ..., promptMultiSelectHint: String = ..., promptPointer: String = ..., promptChecked: String = ..., promptUnchecked: String = ..., taskSucceeded: String = ..., taskFailed: String = ..., composerPasted: String = ..., composerReverseSearch: String = ..., searchPlaceholder: String = ..., whichKeyEllipsis: String = ..., frameworkKeyDescriptions: Map[BindingId, String] = ..., promptNotANumber: String = ..., promptNumberRange: String = ..., promptChooseAtLeast: String = ..., promptPathRequired: String = ..., promptPathMissing: String = ..., promptAnswerYesNo: String = ..., promptNothingToChoose: String = ..., promptNotAnOption: String = ..., iconSuccess: String = ..., iconInfo: String = ..., iconWarning: String = ..., iconError: String = ..., tagSuccess: String = ..., tagInfo: String = ..., tagWarning: String = ..., tagError: String = ..., promptCommaSeparated: String = ..., promptSecretRejected: String = ...)

Every word and marker the framework draws on its own, in one table an application can translate.

A dialog's default button, the command palette's title and filter placeholder, the help overlay's heading, the wizard's Back/Next/Finish, the inspector's panel titles, and the prompts' yes/no hints, list hints, pointer and check glyphs — none of these are written by the application, so before this table an app shipped in Spanish still said "OK" and "type to filter…". Each built-in reads its label from the table in force when it is built or painted, never from a literal.

An application sets the table with override def messages: Messages = Messages.Default.withDialogOk("Sí") on its TuiApp; the run binds it on the render thread around every frame and every event, so a factory called in view and an overlay painted after it read the same table. Code that builds elements outside a run — a Snapshot, Console.print, a Prompt — reads Default unless it is wrapped in Messages.scoped.

Labels the application passes explicitly (dialog(title, message, buttons = Seq("Vale"))) are never touched: the table only supplies the defaults. Strings are plain values with no placeholders except where a field's Scaladoc names one ({lines} in composerPasted, {input}, {min}, {max}, {yes}, {no} and {options} in the prompt validation messages). Immutable; safe to share between threads.

Value parameters

composerPasted

the placeholder promptComposer inserts for a multi-line paste; {lines} is replaced by the line count.

composerReverseSearch

the label of promptComposer's Ctrl+R history search bar.

dialogCancel

the second, cancelling button of Screen.confirm.

dialogOk

the single button dialog(...) draws when given none, and the confirming button of Screen.confirm.

frameworkKeyDescriptions

what FrameworkKeys.entries (and so Keymap.markdown) says each framework key does, by its BindingId; an id left out is described by its id. Set one with withFrameworkKeyDescription.

helpTitle

the title of helpOverlay(...) when none is passed.

iconSuccess

the marker a success notice and toast draw before their message. iconInfo, iconWarning and iconError are the other three severities'; set any with withIcon.

inspectorNothing

what the inspector's card says when nothing is focused or under the pointer.

inspectorTitle

the title of the inspector's node card (F12).

inspectorTreeTitle

the title of the inspector's element-tree panel.

palettePlaceholder

the command palette's filter-input placeholder.

paletteTitle

the title of the command palette (Ctrl+P).

promptAnswerYesNo

a typed confirm answer that is neither yes nor no; {yes}/{no} are promptYes/promptNo, {input} the answer.

promptCancelled

what a cancelled prompt step leaves instead of an answer.

promptChecked

the marker of a chosen row in a multi-choice prompt, including its trailing space.

promptChooseAtLeast

a Prompt.multiSelect answer with fewer than min choices; {min} is the minimum.

promptCommaSeparated

the plain multi-select hint describing its answer separator.

promptMultiSelectHint

the hint beside a multi-choice prompt.

promptNo

how a confirm prompt's summary line shows a no.

promptNotANumber

a Prompt.number answer that is not a whole number; {input} is the answer.

promptNotAnOption

a typed choice answer naming no option; {input} is the word, {options} the option labels joined by ,.

promptNothingToChoose

a choice prompt answered with no options to choose from.

promptNumberRange

a Prompt.number answer outside its bounds; {min} and {max} are the bounds.

promptPathMissing

a Prompt.path(mustExist = true) answer naming nothing; {input} is the answer.

promptPathRequired

an empty Prompt.path answer.

promptPointer

the marker before a choice prompt's highlighted row, including its trailing space.

promptRequired

the validation message of a required text prompt left empty.

promptSecretRejected

a rejected password's diagnostic, replacing validator text that may contain the secret.

promptSelectHint

the hint beside a single-choice prompt.

promptUnchecked

the marker of an unchosen row in a multi-choice prompt, including its trailing space.

promptYes

how a confirm prompt's summary line shows a yes.

promptYesNoDefaultNo

the hint beside a confirm prompt whose Enter means no.

promptYesNoDefaultYes

the hint beside a confirm prompt whose Enter means yes.

searchPlaceholder

the placeholder searchBar(state) shows when given none.

tagSuccess

the short tag badge(NoticeLevel.Success) reads. tagInfo, tagWarning and tagError are the other three severities'; set any with withTag.

taskFailed

the marker before a failed Prompt.task line.

taskSucceeded

the marker before a finished Prompt.task line.

whichKeyEllipsis

the marker after a half-typed key sequence — the which-key popup's title and the pending statusBar(bindings) hint, ctrl+k ….

wizardBack

the wizard's previous-step button.

wizardFinish

the wizard's next-step button on the last step.

wizardNext

the wizard's next-step button.

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

What framework key id does, or the id itself when the table has no description for it.

What framework key id does, or the id itself when the table has no description for it.

Attributes

def icon(level: NoticeLevel): String

The marker level's notices and toasts draw.

The marker level's notices and toasts draw.

Attributes

def pastedLines(lines: Int): String

composerPasted with {lines} filled in.

composerPasted with {lines} filled in.

Attributes

def tag(level: NoticeLevel): String

The tag badge(level) reads.

The tag badge(level) reads.

Attributes

def withComposerPasted(template: String): Messages
def withComposerReverseSearch(label: String): Messages
def withDialogCancel(label: String): Messages
def withDialogOk(label: String): Messages
def withFrameworkKeyDescription(id: BindingId, description: String): Messages

This table with framework key id described as description.

This table with framework key id described as description.

Attributes

def withHelpTitle(label: String): Messages
def withIcon(level: NoticeLevel, glyph: String): Messages

This table with glyph as the marker of level's notices and toasts.

This table with glyph as the marker of level's notices and toasts.

Attributes

def withInspectorNothing(label: String): Messages
def withInspectorTitle(label: String): Messages
def withInspectorTreeTitle(label: String): Messages
def withPalettePlaceholder(label: String): Messages
def withPaletteTitle(label: String): Messages
def withPromptAnswerYesNo(template: String): Messages
def withPromptCancelled(label: String): Messages
def withPromptChecked(marker: String): Messages
def withPromptChooseAtLeast(template: String): Messages
def withPromptCommaSeparated(label: String): Messages
def withPromptMultiSelectHint(label: String): Messages
def withPromptNo(label: String): Messages
def withPromptNotANumber(template: String): Messages
def withPromptNotAnOption(template: String): Messages
def withPromptNothingToChoose(label: String): Messages
def withPromptNumberRange(template: String): Messages
def withPromptPathMissing(template: String): Messages
def withPromptPathRequired(label: String): Messages
def withPromptPointer(marker: String): Messages
def withPromptRequired(label: String): Messages
def withPromptSecretRejected(label: String): Messages
def withPromptSelectHint(label: String): Messages
def withPromptUnchecked(marker: String): Messages
def withPromptYes(label: String): Messages
def withPromptYesNoDefaultNo(label: String): Messages
def withPromptYesNoDefaultYes(label: String): Messages
def withSearchPlaceholder(label: String): Messages
def withTag(level: NoticeLevel, label: String): Messages

This table with label as badge(level)'s tag.

This table with label as badge(level)'s tag.

Attributes

def withTaskFailed(marker: String): Messages
def withTaskSucceeded(marker: String): Messages
def withWhichKeyEllipsis(marker: String): Messages
def withWizardBack(label: String): Messages
def withWizardFinish(label: String): Messages
def withWizardNext(label: String): Messages

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product