refactor(i18n): rename check.go to checks.go, move IsPlural
- Rename check.go → checks.go (fix typo) - Move Message.IsPlural() from i18n.go to checks.go Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
56afd4b97f
commit
bb6aa034e4
2 changed files with 6 additions and 6 deletions
|
|
@ -49,3 +49,9 @@ func isPluralObject(m map[string]any) bool {
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// IsPlural returns true if this message has any plural forms.
|
||||||
|
func (m Message) IsPlural() bool {
|
||||||
|
return m.Zero != "" || m.One != "" || m.Two != "" ||
|
||||||
|
m.Few != "" || m.Many != "" || m.Other != ""
|
||||||
|
}
|
||||||
|
|
@ -34,12 +34,6 @@ import (
|
||||||
//go:embed locales/*.json
|
//go:embed locales/*.json
|
||||||
var localeFS embed.FS
|
var localeFS embed.FS
|
||||||
|
|
||||||
// IsPlural returns true if this message has any plural forms.
|
|
||||||
func (m Message) IsPlural() bool {
|
|
||||||
return m.Zero != "" || m.One != "" || m.Two != "" ||
|
|
||||||
m.Few != "" || m.Many != "" || m.Other != ""
|
|
||||||
}
|
|
||||||
|
|
||||||
// ForCategory returns the appropriate text for a plural category.
|
// ForCategory returns the appropriate text for a plural category.
|
||||||
// Falls back through the category hierarchy to find a non-empty string.
|
// Falls back through the category hierarchy to find a non-empty string.
|
||||||
func (m Message) ForCategory(cat PluralCategory) string {
|
func (m Message) ForCategory(cat PluralCategory) string {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue