# Translations in Kirby Uniform plugin

**URL:** <https://forum.getkirby.com/t/translations-in-kirby-uniform-plugin/13189>\
**Category:** Questions\
**Tags:** v3\
**Created:** [March 5, 2019, 10:17am UTC](https://forum.getkirby.com/t/translations-in-kirby-uniform-plugin/13189 "2019-03-05T10:17:24Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yanickvw](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/yanickvw/32/6340_2.png) [@yanickvw](https://forum.getkirby.com/u/yanickvw)\
**Post date:** [March 5, 2019, 10:17am UTC](https://forum.getkirby.com/t/translations-in-kirby-uniform-plugin/13189/1 "2019-03-05T10:17:25Z")

</div>

Hi,

My website has translations in three languages. I would like to know how i can translate the **validation messages** and **success template** of the Kirby Uniform plugin.

I’ve build my controller like the example in de docs: [Extended - Kirby Uniform](https://kirby-uniform.readthedocs.io/en/latest/examples/extended/)

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [March 5, 2019, 12:04pm UTC](https://forum.getkirby.com/t/translations-in-kirby-uniform-plugin/13189/2 "2019-03-05T12:04:52Z")

</div>

Instead of hardcoding the strings here

```auto
'message' => 'Please enter your name',

```

You can define the strings [in your translations array for each language](https://getkirby.com/docs/guide/languages/custom-language-variables) and the use the [`t()`](https://getkirby.com/docs/reference/templates/helpers/t) helper to fetch those strings.

```auto
'message' => t('name.message'),

```

```auto
 'translations' => [
    'name.message' => 'Please enter your name',
    'email.message' => 'Please enter your email',

  ]

```

---

<div class="post-metadata">

**Author:** ![yanickvw](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/yanickvw/32/6340_2.png) [@yanickvw](https://forum.getkirby.com/u/yanickvw)\
**Post date:** [March 5, 2019, 12:22pm UTC](https://forum.getkirby.com/t/translations-in-kirby-uniform-plugin/13189/3 "2019-03-05T12:22:00Z")

</div>

Great! Thank you for the quick response.

---

<div class="post-metadata">

**Author:** ![illycz](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/illycz/32/5190_2.png) [@illycz](https://forum.getkirby.com/u/illycz)\
**Post date:** [October 3, 2019, 8:41am UTC](https://forum.getkirby.com/t/translations-in-kirby-uniform-plugin/13189/4 "2019-10-03T08:41:10Z")

</div>

I’m using ajax solution: [https://kirby-uniform.readthedocs.io/en/latest/examples/ajax/](https://kirby-uniform.readthedocs.io/en/latest/examples/ajax/) within Uniform and your suggestion not working. I’m getting string from default language. Same with panel field in email template.

Is there any difference when the form is submitted throu ajax?

Thanks

---

<div class="post-metadata">

**Author:** ![RoBoBo](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/robobo/32/8033_2.png) [@RoBoBo](https://forum.getkirby.com/u/RoBoBo)\
**Post date:** [September 15, 2022, 10:16am UTC](https://forum.getkirby.com/t/translations-in-kirby-uniform-plugin/13189/5 "2022-09-15T10:16:56Z")

</div>

Hi. I have the same problem as [illycz](https://forum.getkirby.com/u/illycz) right now (and 3 years later).  
Have you or someone else found a solution for this yet?

I have also tried the following without success … I get the message only in the default language

```auto
/**
 * Request Form
 */
[
   'pattern' => '(:any)',
   'method' => 'POST',
   'language' => 'en', // de is the default
    'action' => function($language) {
       $langcode = $language->code();

       $form = new \Uniform\Form([
           'name' => [
              'rules' => ['required'],
             // 'message' => t('requestFormMessageName'), // also does not work
             // 'message' => I18n::translate('requestFormMessageName', null, $langcode), // also does not work
              'message' => t('requestFormMessageName', null, $langcode), // not working
           ],
           ....
      ]
   }
],

```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [September 15, 2022, 11:04am UTC](https://forum.getkirby.com/t/translations-in-kirby-uniform-plugin/13189/6 "2022-09-15T11:04:20Z")

</div>

Is that in a plugin? Or in the config? Which Kirby version?

---

<div class="post-metadata">

**Author:** ![RoBoBo](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/robobo/32/8033_2.png) [@RoBoBo](https://forum.getkirby.com/u/RoBoBo)\
**Post date:** [September 15, 2022, 1:30pm UTC](https://forum.getkirby.com/t/translations-in-kirby-uniform-plugin/13189/7 "2022-09-15T13:30:32Z")

</div>

Hi texnixe,

in the config. i found the error, it came from the rest of my code. i additionally overwrite the parent page slug … there was another error …

Thanks and best regards,  
Robert
