# I18n paths for array rules

**URL:** <https://discourse.dry-rb.org/t/i18n-paths-for-array-rules/1097>\
**Category:** dry-validation\
**Created:** [July 28, 2020, 2:59pm UTC](https://discourse.dry-rb.org/t/i18n-paths-for-array-rules/1097 "2020-07-28T14:59:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![adamransom](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/adamransom/32/580_2.png) [@adamransom](https://discourse.dry-rb.org/u/adamransom)\
**Post date:** [July 28, 2020, 2:59pm UTC](https://discourse.dry-rb.org/t/i18n-paths-for-array-rules/1097/1 "2020-07-28T14:59:31Z")

</div>

I’m struggling to figure out how I need to structure my I18n YML file in order for custom array rule keys to be picked up. For example:

```auto
params do
  required(:people).filled(:array)
end

rule(:people).each do
   key.failure(:invalid_person) if person_invalid?
end

```

I tried to structure my I18n file as such (with all the correct namespaces and backends configured in the contract of course):

```auto
en:
  dry_validations:
    errors:
      my_contract:
        rules:
          people:
            invalid_person: 'Something'

```

but I get an error that dry-validation can’t find the `invalid_person` key under `people.0`. I can make it work by moving the `invalid_person` key directly under `my_contract` (I guess relying on fallback behaviour), but it doesn’t seem quite right.

Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![solnic](https://yyz1.discourse-cdn.com/flex031/user_avatar/discourse.dry-rb.org/solnic/32/779_2.png) [@solnic](https://discourse.dry-rb.org/u/solnic)\
**Post date:** [July 29, 2020, 6:45am UTC](https://discourse.dry-rb.org/t/i18n-paths-for-array-rules/1097/2 "2020-07-29T06:45:46Z")

</div>

This works:

```auto
en:
  dry_validation:
    errors:
      my_contract:
        invalid_person: 'Something'

```

Custom errors are looked up directly under `:errors` key, including namespaced errors. Customized errors per key (`:people` in this case) is not supported yet. You could report an issue about this, actually.
