sanity-io / sanity-plugin-internationalized-array

A plugin to register array fields with a custom input component to store field values in multiple languages, queryable by using the language ID as an array `_key`.
MIT License
42 stars 10 forks source link

Error using plugin with blockContent #15

Closed LeonardoRick closed 1 year ago

LeonardoRick commented 1 year ago

I can't use internationalizedArrayBlockContent without getting the following error everytime I type something.

image

It works properly with the text field, so thanks for that! But it's a very annoying bug, even not blocking me to continue producing content.

This is my config:

  internationalizedArray({
    languages,
    fieldTypes: ['string', 'blockContent'], // internationalizedArray<type>
  }),
SimeonGriggs commented 1 year ago

Can you share your schema for blockContent?

LeonardoRick commented 1 year ago

@SimeonGriggs It's the one from the sanity blog boilerplate: https://github.com/cre8tive-studio/cms-leonardorick/blob/main/schemas/blockContent.ts

andresclua commented 1 year ago

hey guys, I'm having the same problem. If I define this

defineField({
      name: 'field_test2',
      type: 'internationalizedArrayblockContent',
    }),

I have "Unknown type: internationalizedArrayblockContent."

SimeonGriggs commented 1 year ago

I'll look into this error, however, as stated in the Localization Docs, it is not recommended to use field-level translation for Portable Text fields

LeonardoRick commented 1 year ago

@SimeonGriggs thats fine, I'm using basic text for now but would be nice to have it since it's something present on the demo sanity project.

If you find out that it's really not supported maybe add some note on the plug-in instructions just for people to be aware.

josephine-jc commented 1 year ago

We would also like to use this plugin with block content.

We get that this is not recommend for now, but we do have a mix of common fields and language specific fields, so using the the document language mode would mean a lot of duplicate information for us.

So right now there doesn't seem to be a good solution for our wishes for multi-language in Sanity.

SimeonGriggs commented 1 year ago

The current issue with block content appears to be with the Portable Text Editor input in newer versions of the Studio. Once resolved this plugin should begin to work again with Portable Text.

matthewborgman commented 1 year ago

The current issue with block content appears to be with the Portable Text Editor input in newer versions of the Studio. Once resolved this plugin should begin to work again with Portable Text.

@SimeonGriggs is there a GH issue to track for fixing the PTE inout in Studio? https://github.com/sanity-io/sanity/issues/4576 hasn't even been acknowledged.

SimeonGriggs commented 1 year ago

Fixed in 1.10.0