Snider
9645cea7d6
refactor(i18n): standardise code patterns and naming
...
- Add nil safety to chainable Subject methods (Count, Gender, In, Formal, Informal, Formality)
- Rename getters to use return type suffix pattern:
- CountValue → CountInt
- GenderValue → GenderString
- Location → LocationString
- NounValue → NounString
- FormalityValue → FormalityString
- Fix comment style for plural rule functions to follow Go doc conventions
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 17:53:11 +00:00
Snider
46f6d4c5fe
feat(i18n): add Phase 4 extended language support
...
Fluent Intent Builder API:
- I("core.delete").For(S("file", path)).Question()
- I("core.delete").With(subject).Compose()
- Convenience methods: Question(), Success(), Failure(), Meta(), IsDangerous()
Formality Levels (for Sie/du, vous/tu languages):
- FormalityNeutral, FormalityInformal, FormalityFormal constants
- Subject.Formal(), Subject.Informal(), Subject.Formality()
- Service.SetFormality(), Service.Formality()
- Package-level SetFormality()
CLDR Plural Categories:
- PluralZero, PluralOne, PluralTwo, PluralFew, PluralMany, PluralOther
- Language-specific plural rules: English, German, French, Spanish, Russian, Polish, Arabic, Chinese, Japanese, Korean
- Message.ForCategory() for proper plural selection
- Service.PluralCategory() for getting category by count
RTL Text Direction Support:
- TextDirection type (DirLTR, DirRTL)
- IsRTLLanguage() for language detection
- Service.Direction(), Service.IsRTL()
- Package-level Direction(), IsRTL()
GrammaticalGender type:
- GenderNeuter, GenderMasculine, GenderFeminine, GenderCommon
- For future gender agreement in gendered languages
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-30 12:55:41 +00:00