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

Using a shared languages state #21

Closed phh closed 1 year ago

phh commented 1 year ago

We are currently using objects for translations but for good reasons we are considering moving to arrays and specific this plugin.

In our Studio we have quite a few translatable fields and we would like to limit some clicks and some possible mistakes from our editors.

We see now that it's possible to add a title field in en and da, while adding da, it, es to a description field. Since our editors already know from the start what languages the document should be translated into, it's many click to add x amount of languages to x amount of fields - instead of adding them from the beginning.

If it instead would be possible to have a shared languages across all translatable field with this plugin that would solve our needs better.

Something like adding a shared languages field once (using same UI):

image

That then would add the translateable fields:

image
SimeonGriggs commented 1 year ago

Thanks for this. Yes it's a feature request I'm considering at the moment, to only have those + buttons once at the top of the document and have it effect all arrays.

SimeonGriggs commented 1 year ago

Version 1.9.0 adds support for buttonLocations: ['document'] to move these "add" buttons to the top of the document and populate internationalized arrays at the root of the document schema.

https://github.com/sanity-io/sanity-plugin-internationalized-array#configuring-the-add-translation-buttons