diff --git a/pkg/i18n/i18n.go b/pkg/i18n/i18n.go index 2f48cac9..267d8afe 100644 --- a/pkg/i18n/i18n.go +++ b/pkg/i18n/i18n.go @@ -37,18 +37,6 @@ import ( //go:embed locales/*.json var localeFS embed.FS -// Message represents a translation - either a simple string or plural forms. -// Supports full CLDR plural categories for languages with complex plural rules. -type Message struct { - Text string // Simple string value (non-plural) - Zero string // count == 0 (Arabic, Latvian, Welsh) - One string // count == 1 (most languages) - Two string // count == 2 (Arabic, Welsh) - Few string // Small numbers (Slavic: 2-4, Arabic: 3-10) - Many string // Larger numbers (Slavic: 5+, Arabic: 11-99) - Other string // Default/fallback form -} - // IsPlural returns true if this message has any plural forms. func (m Message) IsPlural() bool { return m.Zero != "" || m.One != "" || m.Two != "" || diff --git a/pkg/i18n/interface.go b/pkg/i18n/interface.go index eb70ccb6..7e05502e 100644 --- a/pkg/i18n/interface.go +++ b/pkg/i18n/interface.go @@ -108,3 +108,15 @@ type MissingKeyAction = MissingKey // rule := i18n.GetPluralRule("ru") // category := rule(5) // Returns PluralMany for Russian type PluralRule func(n int) PluralCategory + +// Message represents a translation - either a simple string or plural forms. +// Supports full CLDR plural categories for languages with complex plural rules. +type Message struct { + Text string // Simple string value (non-plural) + Zero string // count == 0 (Arabic, Latvian, Welsh) + One string // count == 1 (most languages) + Two string // count == 2 (Arabic, Welsh) + Few string // Small numbers (Slavic: 2-4, Arabic: 3-10) + Many string // Larger numbers (Slavic: 5+, Arabic: 11-99) + Other string // Default/fallback form +}