<p>You can't translate that field. I've tried it too once but it can't be done right now without effort because <code>craft\elements\User</code>has no <code>attributeLabels()</code> function in it in order to translate the attribute so all Yii2 does is to change <code>newPassword</code> to <code>New Password</code> but it doesn't translate anything.</p>

<p>You can either submit a feature request for it or do some hacky stuff.</p>

<p>I submitted a feature request <a href="https://github.com/craftcms/cms/issues/3196" rel="nofollow noreferrer">in their git</a></p>

<p><strong>Edit</strong> 13.08.2018 <a href="https://github.com/craftcms/cms/commit/0111023ab679ca53e233ecb300b9faf0e8eb46e0" rel="nofollow noreferrer">This</a> commit changed it, you'll be able to translate those messages now</p>

CC BY-SA 4.0
2018-08-13T17:47:23.350Z
Thank you @robinschambach for the information. Good on you for the feature request, this definitely needs to be addressed. 

Since I am using Ajax to submit the form and display errors, I think I will resort to a simple find and replace in Javascript to translate those fields before displaying the error messages.
Rhys Halsey
CC BY-SA 4.0
2018-08-13T16:57:23.413Z
2018-08-13T18:53:46.167Z
2018-08-13T18:53:46.167Z
Robin Schambach
<p>I am trying to change the label for Craft's form errors. My site local is currently fr_CA, and when I try to submit a form with an error, the error message returned is in french, but the label of the field is in english. </p>

<p>I have managed to translate field labels for plugins, such as the Contact Form plugin by P&amp;T, without any issues by using static translations. All I simply did was create a file with the plugin translation category as a name such as 'contact-form.php' and it works flawlessly. </p>

<p>However, with the forms included in Craft, it doesn't seem to work. For example, with the user registration form, if I submit it without a password, it will come up with an error saying the password needs to have at least 6 characters. Here is the message I receive : </p>

<blockquote>
  <p>New Password doit comporter au moins 6 caractères.</p>
</blockquote>

<p>The 'New Password' is in english while the rest of the message is in french. </p>

<p>If I try to create a file called 'site.php' or 'app.php' in the translations folder under the right locale, it doesn't translate the 'New Password'. Here is the content of the file : </p>

<pre><code>&lt;?php

return [
    'New Password' =&gt; 'Nouveau mot de passe'
];
</code></pre>

<p>It's like none of the translations supplied to Craft are being recognized. Has anyone run into this problem or have a solution? </p>

<craft3><form>
Translating Craft form error message labels
# Translating Craft form error message labels

(Asked by: username_0 on 2018-08-13)

I am trying to change the label for Craft's form errors. My site local is currently fr_CA, and when I try to submit a form with an error, the error message returned is in french, but the label of the field is in english. 
I have managed to translate field labels for plugins, such as the Contact Form plugin by P&T, without any issues by using static translations. All I simply did was create a file with the plugin translation category as a name such as 'contact-form.php' and it works flawlessly. 
However, with the forms included in Craft, it doesn't seem to work. For example, with the user registration form, if I submit it without a password, it will come up with an error saying the password needs to have at least 6 characters. Here is the message I receive : 

New Password doit comporter au moins 6 caractères.

The 'New Password' is in english while the rest of the message is in french. 
If I try to create a file called 'site.php' or 'app.php' in the translations folder under the right locale, it doesn't translate the 'New Password'. Here is the content of the file : 
 'Nouveau mot de passe'
];

It's like none of the translations supplied to Craft are being recognized. Has anyone run into this problem or have a solution?

**Tags:** craft3, form

---

## 1 answers

### Answer by username_1 on 2018-08-13. Score: 2 | Accepted answer

You can't translate that field. I've tried it too once but it can't be done right now without effort because `craft\elements\User`has no `attributeLabels()` function in it in order to translate the attribute so all Yii2 does is to change `newPassword` to `New Password` but it doesn't translate anything.

You can either submit a feature request for it or do some hacky stuff.

I submitted a feature request [in their git](https://github.com/craftcms/cms/issues/3196)

**Edit** 13.08.2018 [This](https://github.com/craftcms/cms/commit/0111023ab679ca53e233ecb300b9faf0e8eb46e0) commit changed it, you'll be able to translate those messages now

> **Comments:**
> **username_0**: Thank you @robinschambach for the information. Good on you for the feature request, this definitely needs to be addressed.   Since I am using Ajax to submit the form and display errors, I think I will resort to a simple find and replace in Javascript to translate those fields before displaying the error messages.  

---

