Like what we’re doing? Star us on GitHub!

Is there a way to get the current locale for the page you're editing in preview?

last year
1 1

Hey guys, pretty simple question I need to know which locale the user is currently editing when creating the preview button. Just wondering if there's an officially supported way of doing this?

  • jmikrut
    Payload Team
    last year

    Hey @richardvanbergen — we can pass in the locale to that function for sure. Give us a bit today and we'll deploy a new version with locale added to the generatePreviewURL function.

    Good call!

    1 reply
  • richardvanbergen
    last year

    Wonderful that would certainly be a lot less hacky than the way I'm doing it now 😆

Open the post
Continue the discussion in GitHub
Can't find what you're looking for?
Get help straight from the Payload team with an Enterprise License.Learn More