i18n

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package i18n defines semantic types for internationalization and localization findings and projects them into the domain-neutral findingspec.Finding.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Issue

type Issue struct {
	ID          string `json:"id"`
	Title       string `json:"title"`
	Description string `json:"description,omitempty"`
	// Kind categorizes the issue.
	Kind Kind `json:"kind,omitempty"`
	// Key is the affected message key, when applicable.
	Key string `json:"key,omitempty"`
	// Locale is the affected locale (BCP 47), when applicable.
	Locale string `json:"locale,omitempty"`
	// Severity is the impact of the issue; defaults to Medium when unset.
	Severity findingspec.Severity `json:"severity,omitempty"`

	Location    *findingspec.Location    `json:"location,omitempty"`
	Remediation *findingspec.Remediation `json:"remediation,omitempty"`
	Status      findingspec.Status       `json:"status,omitempty"`
	DetectedAt  *time.Time               `json:"detectedAt,omitempty"`
}

Issue is an internationalization finding.

func (Issue) ToFinding

func (i Issue) ToFinding() findingspec.Finding

ToFinding projects the issue into a domain-neutral findingspec.Finding in the i18n domain. When Severity is unset it defaults to Medium.

type Kind

type Kind string

Kind categorizes an internationalization issue.

const (
	// KindMissingTranslation is a message key with no translation for a locale.
	KindMissingTranslation Kind = "missing_translation"
	// KindHardcodedString is user-facing text that is not externalized for
	// translation.
	KindHardcodedString Kind = "hardcoded_string"
	// KindInvalidPlaceholder is a translation whose placeholders do not match
	// the source string.
	KindInvalidPlaceholder Kind = "invalid_placeholder"
	// KindUntranslatedFormat is a locale-specific formatting problem (dates,
	// numbers, currency, pluralization).
	KindUntranslatedFormat Kind = "untranslated_format"
)

Jump to

Keyboard shortcuts

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