`select` and `selectordinal` solve two different but common localization needs. `select` branches on string values like role or status; `selectordinal` handles ordinal language such as 1st, 2nd, 3rd.
Many teams implement this logic directly in UI code, which quickly becomes hard to maintain across locales. ICU templates centralize branching in translation resources and reduce product-specific conditional clutter.
The key is keeping branch values predictable and messages readable for translators.
Use select for stable string enums
Use `select` when input values are known enums like `admin`, `editor`, `viewer`, or status values such as `active` and `paused`. Normalize values before formatting to avoid mismatched branches.
Always include an `other` fallback branch for unknown or new enum values. This protects user experience when backend values evolve.
- `{role, select, admin {You can manage users} editor {You can edit posts} other {View only}}`
- Normalize casing before format: lowercase values are easier to maintain
Use selectordinal for rank and milestone copy
Ordinal behavior varies by locale, so suffix logic should not be hardcoded per language in UI components. `selectordinal` lets ICU apply locale rules and keeps rank text translatable.
This is especially useful in gamification, leaderboard, and progress milestones where ordinal phrasing is frequent.
- `{rank, selectordinal, one {#st} two {#nd} few {#rd} other {#th}} place`
- Test ordinal output in multiple locales before launch
Keep nesting readable and maintainable
You can nest select/plural blocks, but avoid excessive complexity in a single key. If a message becomes difficult to review, split it into smaller keys while preserving sentence integrity.
Add translator notes when branch intent is business-critical, such as permissions, risk labels, or billing states.
Operational tips for teams
Track all enum values that map into select branches and review them during API changes. If a new enum is introduced without message updates, users may hit generic fallback text unexpectedly.
For high-traffic product surfaces, include select/selectordinal snapshots in your localization regression suite.
Key takeaways
- Use `select` for normalized enum-like values.
- Use `selectordinal` for locale-aware rank and order text.
- Always define `other` fallback branches.
- Keep nested templates readable and documented.
Frequently asked questions
Is `select` only for gendered language?
No. It works for any stable string category such as role, status, subscription tier, or channel.
Can selectordinal replace plural?
No. Use plural for quantity-based grammar and selectordinal for positional/ranking language.