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

default discord avatar
richardvanbergen2 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
    2 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
    richardvanbergen2 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 help straight from the Payload team with an Enterprise License.