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.

Locale inside PayloadRequest is always in default locale for collections w/ localization

default discord avatar
yhn57902 years ago
3

I'm trying to implement

locale

based RBAC. Basically, I want certain fields to be edited only on one locale for example config related fields however the

req.locale

is always

en (default locale)

. How do I get the current locale? 🤔

  • default discord avatar
    jessrynkarlast year

    Hi

    @541306947463282698

    , this issue was recently fixed. If you have already migrated to 2.0, you can upgrade to v2.2.0 to fix this! Let us know if you have any further questions or issues.

  • default discord avatar
    yhn5790last year
    :payloadlove:
  • default discord avatar
    nunoferreira_600332 months ago

    Hi,


    I'm on version

    v2.22.0

    and this still is happening.


    When calling the local API, the

    PayloadRequest.locale

    is equal to

    PayloadRequest.fallbackLocale

    and not equal to the current selected

    locale

    .

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.