Skip to content

Config of sanity-plugin-internationalized-array is influenced by document-internationalization #511

@jessetan

Description

@jessetan

When the sanity-plugin-internationalized-array plugin is used in a project that also uses the document-internationalization plugin, the order in which the plugins are configured can influence the behaviour of the sanity-plugin-internationalized-array plugin. I expect these to be independent.

To Reproduce

Add the following to the Sanity config. Note that the sanity-plugin-internationalized-array plugin is configured before the document-internationalization plugin

    internationalizedArray({
      languages: [
        { id: "en", title: "English" },
        { id: "nl", title: "Dutch" },
        { id: "de", title: "German" },
      ],
      fieldTypes: ["string", "text", "portableText"],
    }),
    documentInternationalization({
      supportedLanguages: [
        { id: "en", title: "English" },
        { id: "nl", title: "Dutch" },
        { id: "fr", title: "French" },
      ],
      schemaTypes: ["page"],
    }),

The "add document" button displays the expected languages:
Image

But the display of the field-level translations also display French as the third option, while the config asked for German:
Image

Expected behavior

Switch the order of the plugin configuration (doc level translations first, then field level translations):

    documentInternationalization({
      supportedLanguages: [
        { id: "en", title: "English" },
        { id: "nl", title: "Dutch" },
        { id: "fr", title: "French" },
      ],
      schemaTypes: ["page"],
    }),
    internationalizedArray({
      languages: [
        { id: "en", title: "English" },
        { id: "nl", title: "Dutch" },
        { id: "de", title: "German" },
      ],
      fieldTypes: ["string", "text", "portableText"],
    }),

The "add document" button still displays the expected languages:
Image

And the field-level translations allow adding a German field, just as was configured
Image

A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Which versions of Sanity are you using?

@sanity/cli (global)                   4.22.0 (latest: 5.6.0)
@sanity/cli                            4.22.0 (latest: 5.6.0)
@sanity/dashboard                       5.0.1 (up to date)
@sanity/document-internationalization   4.1.0 (latest: 4.1.1)
@sanity/image-url                       2.0.2 (latest: 2.0.3)
@sanity/ui                             3.1.11 (up to date)
@sanity/vision                         4.22.0 (latest: 5.6.0)
sanity                                 4.22.0 (latest: 5.6.0)

from package.json:

"sanity-plugin-internationalized-array": "3.2.2"

What operating system are you using?

macOS 26.2

Which versions of Node.js / npm are you running?

11.6.2
v24.12.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions