# Custom error message with i18n

**URL:** <https://jsonforms.discourse.group/t/custom-error-message-with-i18n/1029>\
**Category:** General\
**Created:** [September 17, 2022, 5:13am UTC](https://jsonforms.discourse.group/t/custom-error-message-with-i18n/1029 "2022-09-17T05:13:14Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![newbieJson](https://avatars.discourse-cdn.com/v4/letter/n/4bbf92/32.png) [@newbieJson](https://jsonforms.discourse.group/u/newbieJson)\
**Post date:** [September 17, 2022, 5:13am UTC](https://jsonforms.discourse.group/t/custom-error-message-with-i18n/1029/1 "2022-09-17T05:13:14Z")

</div>

Based on i18n preview documentation and previous topics, I have tried out custom error message. It is working for single fields. However, it is not working when i tried to custom error message for fields inside the array.

I have also tried out the ajv-errors for fields inside an array in react. It is not working.

> [@Custom error message with Ajv-errors on nested schema](https://jsonforms.discourse.group/t/custom-error-message-with-ajv-errors-on-nested-schema/995):
>
> Hi, I have tried the template part of Ajv-errors documentation in changing the displayed error message under a text field. I tried to add the same logic into my nested schema but I can’t get it to display the custom error message. The schema i’m working on have deep layers of nested properties and items. It will be too big for me to post it here. Please advise. Thanks in advance. 1. Single object fields based on the template provided in Ajv-errors (no issue) 2. Fields inside an ar…

Please advise on custom error message in jsonforms

i18n preview documentation: [i18n - JSON Forms](https://deploy-preview-222--jsonforms.netlify.app/docs/i18n/)  
[Unclear of how to implement ajv-errors to display customer error messages below the label/input element - #9 by Icenwharth](https://jsonforms.discourse.group/t/unclear-of-how-to-implement-ajv-errors-to-display-customer-error-messages-below-the-label-input-element/479/9)

1. Single fields (Working)  
 ![image](https://global.discourse-cdn.com/free1/uploads/jsonforms/original/1X/234f98f02b3241e881ae59c45c7ad4cae6d07909.png)  
 ![image](https://global.discourse-cdn.com/free1/uploads/jsonforms/original/1X/b61dae1ab06daf0d8d3d1449428130a60eb49141.png)  

2. Fields in array (Not working)  

schema.json

```auto
    const schema = {
        type: "object",
        properties: {
            comments: {
                type: "array",
                items: {
                    type: "object",
                            properties: {
                                message: {
                                    type: "string",
                                    maxLength: 5,
                                },
                                enum: {
                                    type: "string",
                                    enum: ["foo", "bar"],
                                },
                            }
                },
            },
        },
    };

```

uischema.json

```auto
    const uischema = {
        type: "VerticalLayout",
        elements: [
            {
                type: "Control",
                scope: "#/properties/comments",
            },
        ],
    };

```

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [September 29, 2022, 10:31am UTC](https://jsonforms.discourse.group/t/custom-error-message-with-i18n/1029/2 "2022-09-29T10:31:46Z")

</div>

Hi @newbieJson,

Sadly the internationalization support is currently only implemented for the regular bindings, not for the cell bindings. This is why it doesn’t work for you.

Until this is implemented you will need to handle the internationalization yourself via custom cell renderers. Of course you can reuse the core JSON Forms internationalization utils for that.

If applicable to you, you could use the “array layout” renderer instead of the “array table” renderer. The array layout renderer renders each array item in an own collapsible section. There only the regular renderers are used which have full internationalization support.

---

<div class="post-metadata">

**Author:** ![airocat-ng](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/airocat-ng/32/1274_2.png) [@airocat-ng](https://jsonforms.discourse.group/u/airocat-ng)\
**Post date:** [April 29, 2025, 5:57pm UTC](https://jsonforms.discourse.group/t/custom-error-message-with-i18n/1029/3 "2025-04-29T17:57:24Z")

</div>

Is internationalization support still only implemented for the regular bindings?

As @newbieJson (the topic starter) did, I tried to use i18n for custom error message implementation. It’s working for single fields. It is not working to provide custom error message for fields inside the array.

---

<div class="post-metadata">

**Author:** ![sdirix](https://yyz2.discourse-cdn.com/free1/user_avatar/jsonforms.discourse.group/sdirix/32/1073_2.png) [@sdirix](https://jsonforms.discourse.group/u/sdirix)\
**Post date:** [May 2, 2025, 9:42am UTC](https://jsonforms.discourse.group/t/custom-error-message-with-i18n/1029/4 "2025-05-02T09:42:35Z")

</div>

Hi @airocat-ng,

The translator [is also invoked on cell errors](https://github.com/eclipsesource/jsonforms/blob/52182632589658b61394c870df1cefacff7d8775/packages/core/src/mappers/cell.ts#L147-L156). Can you post more details on what is not working for you.
