You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Collection labels'collections.{collectionSlug}.labels.singular''collections.{collectionSlug}.labels.plural'// Field labels'collections.{collectionSlug}.fields.{fieldName}'// Common fields'common.fields.{fieldName}'
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Background
We needed to implement a flexible internationalization system for our PayloadCMS v3 project that would:
Solution Overview
We created a system consisting of:
Translations Collection
Translation Utility
withTranslations
HOC to wrap collection configsSeeding System
Implementation Details
1. Translations Collection Structure
2. Translation Keys Structure
3. Using the System
Key Features
Challenges Overcome
beforeRead
toafterRead
hook for proper translation applicationfilterOptions
) to avoid serialization issuesUsage Example
GET /api/seed?reseed=true
Benefits
Future Improvements
Has anyone tried to tackle a similar concept?
Beta Was this translation helpful? Give feedback.
All reactions