Files

137 lines
7.0 KiB
Go

// Copyright (c) 2026 Storm Dragon
// SPDX-License-Identifier: GPL-3.0-or-later
package command
import (
"git.stormux.org/storm/fenrir/internal/i18n"
"slices"
)
// descriptions uses Python Fenrir command get_description message IDs.
// Go-only menu actions reuse their existing localized UI names.
var descriptions = map[ID]string{
Time: "presents the time",
Date: "presents the date",
PreviousLine: "moves review to the previous line ",
CurrentLine: "current line",
NextLine: "moves review to the next line ",
PreviousWord: "moves review focus to the previous word ",
CurrentWord: "current word.",
NextWord: "moves review to the next word ",
PreviousChar: "moves review to the previous character",
CurrentChar: "presents the current character.",
SpellWord: "Spells the current word",
PhoneticWord: "Phonetically spells the current word",
SpellLine: "no description available",
PhoneticLine: "no description available",
PhoneticChar: "set review and phonetically presents the current character",
NextChar: "Moves review to the next character",
ReviewUp: "Move review to the character in the line above the current position",
ReviewDown: "Move review to the character below the current position",
Top: "move review to top of screen",
Bottom: "Move review to the bottom of the screen",
LineStart: "set review cursor to begin of current line and display the content",
LineEnd: "Move Review to the end of current line and display the content",
FirstText: "Move Review to the first character on the line",
LastText: "Move Review to the last character on the line",
ReadScreen: "reads the contents of the current screen",
ScreenBeforeCursor: "Reads from the top of the screen to the cursor position",
ScreenAfterCursor: "reads from the cursor to the bottom of the screen",
ToggleAttributes: "enables or disables the announcement of attributes",
AttributeCursor: "Reads attributes of current cursor position",
Position: "displays the position of the review cursor",
CursorLine: "Line number for cursor",
CursorColumn: "Column number for cursor",
LineToCursor: "read line to cursor pos, use review cursor if you are in review mode, otherwhise use text cursor",
LineFromCursor: "read to end of line, use review cursor if you are in review mode, otherwhise use text cursor",
ScreenFirstChar: "Move Review to the first character on the screen (left top)",
ScreenLastChar: "Move Review to the last character on the screen (right bottom)",
FollowCursor: "exits review mode",
Help: "toggles the tutorial mode",
Version: "Present the version of Fenrir currently in use.",
EmojiMenu: "Emoji Menu",
SpellcheckMenu: "Spellcheck Menu",
FenrirMenu: "Fenrir Menu",
ApplicationsMenu: "Select a temporary application override",
NextQuickCategory: "get next quick menu category",
PreviousQuickCategory: "get previous quick menu category",
CurrentQuickEntry: "get current quick menu entry",
CurrentQuickValue: "get current quick menu value",
NextQuickEntry: "get next quick menu entry",
PreviousQuickEntry: "get previous quick menu entry",
NextQuickValue: "get next quick menu value",
PreviousQuickValue: "get previous quick menu value",
SaveSettings: "Saves your current Fenrir settings so they are the default.",
Mute: "enables or disables speech",
TempDisableSpeech: "disables speech until next keypress",
ProgressMonitor: "Toggle progress bar monitoring with ascending tones",
AutoRead: "enables or disables automatic reading of new text as it appears",
ToggleTracking: "enables or disables tracking of highlighted text",
PassNext: "sends the following keypress to the terminal or application",
Quit: "exits Fenrir",
SetWindow: "set Window Mode, needs 2 marks ",
ClearWindow: "Turn off window mode",
SetLiveRegion: "Set a live region from one or two marks",
ListReadingRegions: "List reading regions",
ClearLiveRegions: "Clear all live regions",
ClearReadingRegions: "Clear all reading regions",
ReadLiveRegion1: "Read live region 1",
ClearLiveRegion1: "Clear live region 1",
ReadLiveRegion2: "Read live region 2",
ClearLiveRegion2: "Clear live region 2",
ReadLiveRegion3: "Read live region 3",
ClearLiveRegion3: "Clear live region 3",
ReadLiveRegion4: "Read live region 4",
ClearLiveRegion4: "Clear live region 4",
ReadLiveRegion5: "Read live region 5",
ClearLiveRegion5: "Clear live region 5",
ReadLiveRegion6: "Read live region 6",
ClearLiveRegion6: "Clear live region 6",
ReadLiveRegion7: "Read live region 7",
ClearLiveRegion7: "Clear live region 7",
ReadLiveRegion8: "Read live region 8",
ClearLiveRegion8: "Clear live region 8",
ReadLiveRegion9: "Read live region 9",
ClearLiveRegion9: "Clear live region 9",
ReadLiveRegion10: "Read live region 10",
ClearLiveRegion10: "Clear live region 10",
SetMark: "places marks to select text to copy to the clipboard",
RemoveMarks: "Removes marks from selected text",
MarkedText: "Presents the currently selected text that will be copied to the clipboard",
CopyMarked: "copies marked text to the currently selected clipboard",
CopyLastEcho: "copies last presented text to the clipboard",
CurrentClipboard: "speaks the contents of the currently selected clipboard",
PreviousClipboard: "selects the previous clipboard",
NextClipboard: "selects the next clipboard",
FirstClipboard: "selects the first clipboard",
LastClipboard: "selects the last clipboard",
ClearClipboard: "clears the currently selected clipboard",
PasteClipboard: "pastes the text from the currently selected clipboard",
ImportClipboard: "imports text from clipboard file to the clipboard",
ExportClipboard: "export the current fenrir clipboard to a file",
ImportXClipboard: "imports the graphical clipboard to Fenrir's clipboard",
ExportXClipboard: "Export current fenrir clipboard to X or GUI clipboard",
}
// Description translates at presentation time, like Python command help.
func Description(id ID) string {
message := descriptions[id]
if message == "" {
message = "no description available"
}
return i18n.T(message)
}
func Known(id ID) bool { _, ok := descriptions[id]; return ok }
// IDs lists all available actions, including those absent from a custom layout.
func IDs() []ID {
ids := make([]ID, 0, len(descriptions))
for id := range descriptions {
ids = append(ids, id)
}
slices.Sort(ids)
return ids
}