Skip to content

Latest commit

 

History

History
24 lines (24 loc) · 512 Bytes

File metadata and controls

24 lines (24 loc) · 512 Bytes

Example: Conditionally set a locale visible or not editable

  defineField({
    type: 'i18n.string',
    name: 'field1',
    title: 'Field 1',
    options: {
      locales: [
        {
          code: 'it',
          hidden: ({value}) => {
            return value?.en === 'pizza with 🍍' ? true : false
          },
        },
        {
          code: 'en',
          readOnly: ({value}) => {
            return value?.it === 'pizza' ? true : false
          },
        },
      ],
    },
  }),