chore(examples): update website localization example #12476
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi there 👋
What?
This is an attempt at providing an up to date localization example using the latest website template.
Why?
Getting familiar with payload, I wanted to dive into the localization part of it.
Though, I quickly faced the issue of the official example being not fully up to date.
Such examples are critical (IMO) in smoothing the learning curve and facilitating adoption of complex features.
I am not the only one having the issue it seems.
How?
It's mostly based on #10134, applying relevant parts to the latest website template (created with
npx create-payload-app@latest
on May 21st 2025).To improve readability, you can check a diff between the "raw" website code and the proposed changes here:
https://github.com/francoishernandez/payload-website-template/pull/1/files
--> This can also be helpful (I hope!) for anyone trying to pinpoint what kind of adaptations are required to enable localization on any payload project.
Important Note
Changes are probably not exhaustive. This is merely a proposal to gauge interest. If that's considered merge-worthy, we can probably have another go to refine or extend. (E.g. better seeding, messages and some components lacking locale support.)