Documentation
¶
Overview ¶
Package prompt holds the natural-language text lich types into an agent session, in every language a user can pick for it. The UI has its own language and its own catalogs (native/i18n); the two settings are independent because people often run the interface in one language and talk to their agents in another.
A catalog is a struct rather than a map of string keys so that a wrong name is a compile error at the call site, and a locale that misses a field is caught by TestCatalogParity. Each field is a fmt format: use explicit argument indexes (%[2]s) when a translation needs the arguments in another order.
Index ¶
Constants ¶
const EnvVar = "LICH_PROMPT_LANG"
EnvVar is the variable lich exports into every session PTY with the prompt language at spawn time. Text composed outside the lich process (the lich CLI, its MCP server, the companion plugin's hooks) reads the language from here, because it has no way to read the setting itself.
Variables ¶
var Langs = []Lang{English, PortugueseBR, Spanish, ChineseCN, Japanese, Korean, Russian}
Langs is every language a catalog exists for, English first as the default.
Functions ¶
Types ¶
type Catalog ¶
type Catalog struct {
// internal/relay: SpawnBriefing. These are passed as one argv entry and a
// provider shipped as a .cmd is spawned through cmd.exe, so they must not
// contain a double quote or angle brackets in any locale.
BriefingIntro string
BriefingCards string
BriefingNative string
BriefingSessions string
BriefingCommandTools string
BriefingCommandCLI string
// BriefingArtifacts follows every route, its own leading space included
// where the language separates sentences with one; %s is how to open a
// page, a tool name or a command, never translated.
BriefingArtifacts string
// internal/relay: compose, origin and replyInstruction.
RelayMessage string
OriginCLI string
OriginSession string
ReplyCommand string
ReplyRouteCLI string
ReplyRouteTools string
ReplyOnlyWayBack string
PingPongWarning string
WorkerTask string
PickTicketNudge string
CompactReminder Plural
NudgeResultsReady Plural
NudgeRouteCLI string
NudgeRouteTools string
NudgeNotice string
// internal/relay: a subagent's report and block, a merge notice, a late
// scheduled prompt and the continuation parked at a usage limit.
SubagentReport string
SubagentReportBranch string
BlockedNotice string
ReportSummary Plural
BlockedSummary string
MergeNotice string
MergeSummary string
LateNotice string
// ResumePrompt is stored in the sessions table as a parked prompt, so a row
// written in one language has to be recognised in every other: match it
// with relay's isResumePrompt, never with ==.
ResumePrompt string
// The line in front of a watch's prompt, naming what was met. %[1]d is the
// pull request; %[2]s, where it appears, the commit.
WatchChecksFailed string
WatchChecksPassed string
WatchReview string
// `lich schedule` and schedule_prompt's answers.
ScheduledAtResult string // %[1]s is when
ScheduledOnResult string // %[1]s is the condition, %[2]d the run limit
ScheduleCleared string
// `lich check-log` and read_check_log's answers. %[1]d is the pull
// request, %[2]s the commit, then the counts named in the text.
CheckLogNoPR string
CheckLogClean string // %[3]d passed, %[4]d pending
CheckLogRunning string // %[3]d failed, %[4]d pending
CheckLogFailed string // %[3]d failed
CheckLogCut string // %[1]d is the lines left out
CheckLogNoLog string
// internal/drop: the line under a copied file's path.
CopyNotice string
// internal/artifact: the line under a copied artifact's path. %[1]s is its
// name, %[2]q the session it came from.
ArtifactCopyNotice string
// internal/cli: the lich command line and its MCP server, read from
// EnvVar. MCP tool descriptions, flag help and errors stay English.
MCPInstructions string
MCPArtifacts string // %s is the session's artifact directory
HandOverFailed string
SendToSessionPrivate string
OutcomeUnread string
OutcomeUndelivered string
OutcomeUnanswered string
OutcomeStopped string
OutcomeExpired string
StillWorkingPrivate string
StillWorkingOpen string
StillWorkingPrivateCLI string
StillWorkingOpenCLI string
CollectedNothing string
CollectedAnswer string
CollectedStillWorking string
OpenedProject string
OpenedWorktree string
OpenedConfined string
OpenedSession string
OpenedSessionLabelOnly string
ClosedRemoved string
ClosedKept string
ClosedPlain string
ClosedProject string
HandoffNote string
HandoffNone string
HandoffSent string
HandoffProfileSuggested string
HandoffProfileDropped string
// internal/cli: a browser page as the browser_* tools answer with it. The
// line tags (url:, title:, wait:, text:, interactive, downloading:, dialog
// open:) and browser_dialog stay English in every locale: the tool
// descriptions name them. PageListSame stands for an element list the
// agent's last page answer already gave it.
PageInteractive string
PageListSame string
PageMore string
PageFilled string
PageChecked string
PageDownloading string
PageWaitTimedOut string
PageConsoleMore Plural
PageDialogWaits string
// PageDialogWaitsCLI is PageDialogWaits for `lich browser`, which names
// its own verb instead of the MCP tool.
PageDialogWaitsCLI string
// contains filtered or unexported fields
}
Catalog is every prompt text in one language. Add a field here, then its text in en.go and in every other locale file; TestCatalogParity fails until each locale has it with the same format verbs.
Untranslated in every locale, because agents and tools match them literally: the [lich] token, tool and CLI names, ticket ids, and tool parameters.