i18n

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2026 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package i18n provides internationalization for Lore CLI. All user-facing strings are centralized here. AI prompt directives and content signals remain in English (not part of this package).

Architecture note: catalogs are Go code (catalog_en.go, catalog_fr.go). This is appropriate for 2-4 languages. If the project reaches 5+ languages, consider migrating to resource files (JSON/TOML) with code generation, to avoid requiring Go expertise from translators.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(lang string)

Init sets the active language catalog. If lang is not supported, falls back silently to EN. The warning for unsupported languages is added in story 7b.4a (requires streams access).

func IsSupported

func IsSupported(lang string) bool

IsSupported checks if a language has a catalog available.

Types

type AngelaMessages

type AngelaMessages struct {
	// persona.go — DraftCheck messages (user-facing suggestions)
	PersonaWhyTooListy     string
	PersonaLongParagraphs  string
	PersonaMissingVerify   string
	PersonaNoTradeoffs     string
	PersonaUxNoImpact      string
	PersonaBusinessNoValue string

	// draft.go — completeness checks
	DraftMissingWhat    string
	DraftMissingWhy     string
	DraftMissingAltWarn string
	DraftMissingAltInfo string
	DraftMissingImpact  string
	DraftBodyTooShort   string
	DraftBodyExceedsMax string
	DraftAddTags        string
	DraftAddRelated     string
	DraftWhyTooBrief    string

	// coherence.go
	CoherencePossibleDup   string // args: filename, tags
	CoherenceRelatedFound  string // args: filename, tags
	CoherenceMentionedBody string // arg: filename

	// diff.go
	DiffChangeHeader string // args: current, total
	DiffApplyPrompt  string
	DiffInputEnded   string // arg: remaining

	// review.go
	ReviewParseError string
	ReviewMinDocs    string // arg: count

	// style.go
	StyleUnknownRule string // arg: key
}

AngelaMessages holds user-facing strings for the Angela AI reviewer. NOTE: PromptDirective, Principles, and ContentSignals remain in English.

type CmdMessages

type CmdMessages struct {
	// root.go
	RootShort         string
	RootConfigErrHint string // arg: error
	StoreUnavailWarn  string // arg: error

	// init.go
	InitShort              string
	InitNotGitRepo         string
	InitNotGitRepoHint     string
	InitAlreadyInitialized string
	InitCreatedLore        string
	InitCreatedLorerc      string
	InitCreatedLorercLocal string
	InitModifiedGitignore  string
	InitWarningPrefix      string
	InitHooksPathWarn      string // arg: path
	InitInstalledHook      string
	InitNotInPathWarn      string
	InitInstallHint        string
	InitAddToPathHint      string
	InitBashPathHint       string
	InitZshPathHint        string
	InitFishPathHint       string
	InitPowerShellHint     string
	InitTagline            string
	InitDemoPrompt         string
	InitDemoWarning        string

	// new.go
	NewUse            string
	NewShort          string
	NewCommitNotFound string // arg: hash
	NewCommitFlagDesc string

	// list.go
	ListShort        string
	ListLong         string
	ListParseWarning string // arg: error
	ListNoDocsOfType string // arg: type
	ListNoDocsYet    string
	ListTagSingular  string
	ListTagPlural    string

	// show.go
	ShowUse            string
	ShowShort          string
	ShowLong           string
	ShowTypeExclusive  string
	ShowUsageHint      string
	ShowTryHint        string
	ShowNoMatchKeyword string // arg: keyword
	ShowTryAll         string
	ShowNoDocsFound    string
	ShowSelectPrompt   string

	// delete.go
	DeleteUse           string
	DeleteShort         string
	DeleteInvalidName   string // arg: filename
	DeleteNotFound      string // arg: filename
	DeleteRefWarning    string
	DeleteRefNotUpdated string
	DeleteForceRequired string
	DeleteConfirmPrompt string // arg: filename
	DeleteCancelled     string

	// note.go
	NoteShort string

	// pending.go
	PendingShort        string
	PendingLong         string
	PendingListShort    string
	PendingResolveShort string
	PendingSkipShort    string
	PendingFlagQuiet    string
	PendingFlagCommit   string
	PendingFlagType     string
	PendingFlagWhat     string
	PendingFlagWhy      string
	PendingFlagAlt      string
	PendingFlagImpact   string
	PendingNoPending    string
	PendingResolveHint  string
	PendingSkipHint     string
	PendingNoPendingRes string
	PendingInvalidSel   string // args: input, max
	PendingSelectPrompt string // arg: max
	PendingInvalidSelIn string // args: input, max
	PendingSkipError    string // arg: error
	PendingListHeader   string

	// status.go
	StatusShort             string
	StatusLong              string
	StatusHeader            string // arg: branch/path
	StatusHookNotInstalled  string
	StatusHookNotInstHint   string
	StatusHookInstalled     string
	StatusHookLabel         string
	StatusDocsDocumented    string // arg: count
	StatusDocsPending       string // arg: count
	StatusDocsLabel         string
	StatusExpressLine       string // args: pct, express, total, altPct
	StatusExpressUnreadable string // arg: count
	StatusExpressLabel      string
	StatusAngelaMode        string // arg: mode
	StatusAngelaNoApiKey    string
	StatusAngelaProvider    string // arg: provider
	StatusAngelaDocsReview  string // arg: count
	StatusAngelaAllClean    string
	StatusAngelaLabel       string
	StatusReviewNoIssues    string
	StatusReviewFindings    string // args: count, age
	StatusReviewLabel       string
	StatusHealthAllGood     string
	StatusHealthIssues      string // arg: count
	StatusHealthLabel       string
	StatusTagline           string
	StatusReviewAgeJustNow  string
	StatusReviewAgeHours    string // arg: hours
	StatusReviewAgeDays     string // arg: days
	StatusFlagQuiet         string
	StatusFlagBadge         string

	// hook.go
	HookShort             string
	HookInstallShort      string
	HookInstallHooksPathW string // arg: path
	HookInstallCannotAuto string
	HookInstallManualHint string
	HookInstallVerb       string
	HookUninstallShort    string
	HookUninstallVerb     string
	HookPostCommitShort   string

	// demo.go
	DemoShort         string
	DemoConsentPrompt string
	DemoSimCommit     string // arg: message
	DemoTypePrompt    string // arg: value
	DemoTypeConfirm   string // arg: value
	DemoWhatPrompt    string // arg: value
	DemoWhatConfirm   string // arg: value
	DemoWhyPrompt     string // arg: value
	DemoIndexWarning  string // arg: error
	DemoSimShow       string
	DemoShowType      string // arg: type
	DemoShowWhat      string // arg: what
	DemoShowWhy       string // arg: why
	DemoShowDate      string // arg: date
	DemoShowCommit    string // arg: hash
	DemoShowStatus    string
	DemoTagline       string

	// release.go
	ReleaseShort            string
	ReleaseNotInitMsg       string
	ReleaseNotInitHint      string
	ReleaseNoTagsError      string
	ReleaseNoTagsHint       string
	ReleaseParseWarning     string // arg: error
	ReleaseNoChanges        string
	ReleaseNoChangesHint    string
	ReleaseChangelogHdrWarn string
	ReleaseIndexRegenWarn   string // arg: error

	// doctor.go
	DoctorShort          string
	DoctorConfigCheck    string
	DoctorConfigOK       string
	DoctorActiveValues   string
	DoctorValueNotSet    string
	DoctorDocsCheck      string
	DoctorNoneFound      string
	DoctorConfigOKInline string
	DoctorHealthAllGood  string
	DoctorIssuesFound    string // arg: count
	DoctorManualFix      string // args: issue, hint
	DoctorFixSummary     string // args: fixed, remaining
	DoctorStoreRebuilt   string // arg: docCount
	DoctorStoreSkipped   string // arg: count
	DoctorStoreCommits   string // arg: count

	// config_cmd.go
	ConfigShort          string
	SetKeyShort          string
	SetKeyUnknownProv    string // args: provider, supported
	SetKeyPrompt         string // arg: provider
	SetKeyStored         string // arg: provider
	DeleteKeyShort       string
	DeleteKeyUnknownProv string // args: provider, supported
	DeleteKeyDeleted     string // arg: provider
	ListKeysShort        string
	ListKeysStored       string // arg: provider
	ListKeysNotSet       string // arg: provider

	// lore_check.go
	LoreCheckNotInit     string
	LoreCheckNotInitHint string

	// angela.go
	AngelaShort              string
	AngelaDraftShort         string
	AngelaDraftNoFile        string
	AngelaDraftNotFound      string // arg: filename
	AngelaDraftCorpusWarn    string // arg: error
	AngelaDraftNoSuggestions string
	AngelaDraftHeader        string // arg: filename
	AngelaDraftScoreLine     string // args: score, label
	AngelaDraftSuggCount     string // arg: count
	AngelaDraftAllNoDocs     string
	AngelaDraftAllHeader     string // arg: count
	AngelaDraftAllSugg       string // args: count, score
	AngelaDraftAllSuggWarn   string // args: count, warnings, score
	AngelaDraftAllSummary    string // args: needAttention, total, suggestions

	// angela_polish.go
	AngelaPolishShort       string
	AngelaPolishNotFound    string // arg: filename
	AngelaPolishNoProvider  string
	AngelaPolishNoChanges   string
	AngelaPolishNoneApplied string
	AngelaPolishIndexWarn   string // arg: error
	AngelaPolishVerb        string // arg: filename

	// angela_review.go
	AngelaReviewShort      string
	AngelaReviewNoProvider string
	AngelaReviewCorpusNote string // arg: count
	AngelaReviewCacheWarn  string // arg: error
	AngelaReviewHdrPartial string // args: analyzed, total
	AngelaReviewHdrFull    string // arg: count
	AngelaReviewCoherent   string
	AngelaReviewFindingSum string // args: count, severity
	AngelaReviewMinDocs    string // args: minRequired, currentCount
	AngelaReviewParseErr   string
	AngelaPolishModified   string

	// decision.go
	DecisionShort           string
	DecisionDiffWarn        string // arg: error
	DecisionCommitLabel     string // arg: hash
	DecisionSubjectLabel    string // arg: subject
	DecisionScoreLabel      string // arg: score
	DecisionActionLabel     string // arg: action
	DecisionConfidenceLabel string // arg: confidence
	DecisionSignalsHeader   string
	DecisionPrefillHeader   string
	DecisionPrefillWhat     string // arg: what
	DecisionPrefillWhy      string // args: why, confidence
	DecisionStoreUnavail    string

	// completion.go
	CompletionShort string
	CompletionLong  string

	// root.go — language warnings
	UnsupportedLangWarn string // arg: lang

	// show.go — deprecation
	ShowAllDeprecated string
}

CmdMessages holds strings for CLI commands (cmd/ package). Each field documents its format args in a comment when applicable.

type DecisionMessages

type DecisionMessages struct {
	// calibration.go — report labels
	CalibrationTitle        string
	CalibrationTotalCommits string
	CalibrationAutoSkipped  string // args: count, pct
	CalibrationSuggestSkip  string
	CalibrationAskReduced   string
	CalibrationAskFull      string
	CalibrationQualityHdr   string
	CalibrationFalseNegRate string // arg: rate
	CalibrationFalsePosRate string // arg: rate
	CalibrationAskFullDoc   string // arg: rate
	CalibrationAutoSkipRate string // arg: rate
}

DecisionMessages holds strings for calibration report and signal reasons.

type EngagementMessages

type EngagementMessages struct {
	Milestone3  string
	Milestone8  string
	Milestone21 string
	Milestone55 string

	// Star prompt (Story 7f.3 AC2)
	StarPrompt string // "Enjoying Lore? Star us → ..."
}

EngagementMessages holds milestone reinforcement messages. These are the Fibonacci milestone messages (3, 8, 21, 55).

type Lang

type Lang string

Lang represents a supported language.

const (
	EN Lang = "en"
	FR Lang = "fr"
)

func SupportedLanguages

func SupportedLanguages() []Lang

SupportedLanguages returns the list of languages with available catalogs. Phase A: EN only. Phase B adds FR.

type Messages

type Messages struct {
	Cmd        CmdMessages
	Workflow   WorkflowMessages
	UI         UIMessages
	Angela     AngelaMessages
	Engagement EngagementMessages
	Decision   DecisionMessages
	Shared     SharedMessages
	Notify     NotifyMessages
}

Messages is the root catalog containing all user-facing strings organized by functional domain. Each sub-struct is defined in its own file (messages_cmd.go, etc.) for maintainability.

func T

func T() *Messages

T returns the active Messages catalog. Never returns nil. Safe to call from any goroutine, including before Init().

type NotifyMessages

type NotifyMessages struct {
	// Dialog titles and labels
	DialogTitle     string // "Lore"
	DialogTitleWhat string // "Lore — What"
	DialogTitleWhy  string // "Lore — Why"

	// Dialog prompts
	PromptType string // "Type:"
	PromptWhat string // "What did you change?"
	PromptWhy  string // "Why did you make this change?"

	// Dialog buttons
	ButtonCancel string // "Cancel"
	ButtonNext   string // "Next"
	ButtonSave   string // "Save"
	ButtonSkip   string // "Skip"

	// Simple notification
	SimplePending string // "lore pending — %s"

	// Dialog error handling
	ErrorPrefix  string // "Lore error: "
	ErrorResolve string // "Failed to resolve pending"
	ButtonOK     string // "OK"

	// Pending resolve
	NoMatchingPending string // "No pending commit matching %q"
}

NotifyMessages holds strings for OS notification dialogs (internal/notify/).

type SharedMessages

type SharedMessages struct {
	// config/config.go
	ConfigInsecurePerms string // args: path, mode, path
	ConfigUnknownWarn   string // arg: warning

	// config/validate.go
	ConfigNotSet          string
	ValidateUnknownDidYou string // args: field, file, suggestion
	ValidateUnknownField  string // args: field, file

	// ai/provider.go
	AINoKeyAnthropic   string
	AINoKeyOpenAI      string
	AIUnknownProvider  string // args: provider, supported
	AIKeychainNotAvail string
	AIPlaintextKeyWarn string // arg: provider

	// storage/index.go
	IndexTitle           string
	IndexAutoGenNote     string
	IndexTableHeaderDoc  string
	IndexTableHeaderType string
	IndexTableHeaderDate string
	IndexTableHeaderStat string
	IndexTableHeaderTags string
	IndexDocSingular     string
	IndexDocPlural       string
	IndexTotalCount      string // args: count, unit

	// storage/release.go
	ReleaseSectionFeatures  string
	ReleaseSectionBugFixes  string
	ReleaseSectionRefactors string
	ReleaseSectionDecisions string
	ReleaseSectionNotes     string
	ReleaseTitle            string // arg: version
}

SharedMessages holds strings used across multiple packages.

type UIMessages

type UIMessages struct {
	// logo.go
	Tagline string // "your code knows what. lore knows why."

	// error.go
	ErrorPrefix string // "Error:"
	RunPrefix   string // "Run:"

	// verb.go
	VerbDeleted string // "Deleted"

	// list.go
	ListTruncated   string // "... and %d more. Refine your search." (arg: remaining count)
	ListPromptRange string // "Please enter a number between 1 and %d." (arg: max)
	ListNoInput     string // "no input"

	// prompt.go
	PromptWithDefault string // "? %s [%s]: " (args: question, default)
	PromptNoDefault   string // "? %s\n> " (arg: question)

	// readme_bridge.go
	ReadmeBridgeTitle   string // "About .lore/"
	ReadmeBridgeIntro   string // "This repository is documented with [Lore](...)."
	ReadmeBridgeDesc    string // "Lore captures the *why* behind code changes..."
	ReadmeBridgeLink    string // "Learn more: ..."
	ReadmeBridgeGenNote string // "This file was generated by `lore init`..."

	// badge.go
	BadgeCoverageDetail  string // "Coverage: %d%% (%d eligible: %d documented, %d skipped, %d gaps)"
	BadgeNoEligible      string // "no eligible commits"
	BadgeSkipRateWarning string // "⚠ Skip rate: %d%% (%d/%d eligible commits skipped)"
	BadgeSkipRateHint    string // "A high skip rate may indicate documentation avoidance."
	BadgeLabelDocumented string // "documented" / "documente"
}

UIMessages holds strings for terminal UI components (internal/ui/ package).

type WorkflowMessages

type WorkflowMessages struct {
	// reactive.go
	SuggestSkipPrompt     string // "Document this commit? [y/N] "
	SuggestSkipSkipped    string // "Skipped."
	AmendUpdatingExisting string // arg: filename
	AmendNoDocCreatingNew string // arg: ref

	// detection.go
	MergeCommitSkipMsg string
	AutoSkipMsg        string // args: score, subject

	// proactive.go
	AlreadyDocumented string
	CreateAnother     string // "Create another document? [y/N] "

	// common.go
	IndexWarning string // arg: error

	// questions.go
	QuestionWhyLabel          string
	QuestionAlternativesLabel string
	QuestionImpactLabel       string

	// resolve.go
	ResolveHeader         string
	ResolveCommitLabel    string // arg: hash
	ResolveMessageLabel   string // arg: message
	ResolveDateLabel      string // arg: date
	ResolveCheckCommitW   string // args: hash, error
	ResolveCommitGoneW    string // arg: hash
	ResolveDeletePendingW string // arg: error

	// pending.go
	PendingReadWarn  string // args: path, error
	PendingParseWarn string // args: path, error

	// pending.go relative time
	RelativeAgeJustNow string
	RelativeAgeMinutes string // arg: count
	RelativeAge1Hour   string
	RelativeAgeHours   string // arg: count
	RelativeAge1Day    string
	RelativeAgeDays    string // arg: count
	RelativeAge1Week   string
	RelativeAgeWeeks   string // arg: count
	RelativeAge1Month  string
	RelativeAgeMonths  string // arg: count

	// line_renderer.go
	LineRendererConfirm     string // args: label, value
	LineRendererExpressSkip string // arg: count
}

WorkflowMessages holds strings for workflow orchestration (internal/workflow/).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL