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

default discord avatar
richardvanbergen
2 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?

  • discord user avatar
    jmikrut
    Payload Team
    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
    richardvanbergen
    2 years ago

    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
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.