Access current editor locale in showIf for Section/Data Model fields

Hi,

we’re building a multi-locale site where each locale can display a different media type in a section model. The mediaType field is localized — one locale might show a video, another a static image.

We have dependent fields (videoPlaybackId, uploadFile, localAssetName, etc.) that should only appear when the relevant mediaType is selected for the current locale. This is a natural use case for showIf.

The problem:

options.get("mediaType") inside showIf returns the raw LocalizedValue object:

{
  "@type": "@builder.io/core:LocalizedValue",
  "de-DE": "Video",
  "en-US": "Image"
}

There is no way to resolve this to the current editor locale from within showIf. The current editor locale is not exposed anywhere in the showIf context (options, parent, parentElements).

Related known issue:

Combining showIf with localized: true on the same field makes the input uneditable in the editor — reported in 2022, still unresolved as far as we can tell.

Feature request:

Expose the current editor locale in the showIf context. For example:

showIf: (options, parent, parentElements, context) => {
  const locale = context?.locale // e.g. "de-DE"
  const mediaType = options.get("mediaType")
  const resolved = mediaType?.[locale] ?? mediaType
  return resolved === "Video"
}

Or a helper on options:

showIf: (options) => options.getLocalized("mediaType") === "Video"

This would make showIf actually usable for locale-aware field visibility — a common need on multi-locale projects.

Thanks!