Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

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

default discord avatar
richardvanbergen4 years ago
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?

  • Selected Answer
    discord user avatar
    jmikrut
    4 years ago

    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
  • default discord avatar
    richardvanbergen4 years ago

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

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.