<p>User accounts’ First Name field isn’t required, so I’m guessing this is a custom field?</p>

<p>You can translate your custom field names using <a href="https://docs.craftcms.com/v3/static-translations.html" rel="nofollow noreferrer">static message translations</a>.</p>

<p>Create a new file at <code>translations/&lt;Language&gt;/site.php</code>:</p>

<pre><code>my-project.test/
├── config/
├── ...
└── translations/
    └── &lt;Language&gt;/
        └── site.php
</code></pre>

<p>(replace <code>&lt;Language&gt;</code> with your language ID, e.g. <code>el</code>.)</p>

<p>Then have it return an array that translates your custom field names.</p>

<pre class="lang-php prettyprint-override"><code>&lt;?php

return [
    'First Name' =&gt; 'Ονομα',
];
</code></pre>

CC BY-SA 4.0
2018-09-03T17:14:13.953Z
Thanks for the reply. I'm already using `translations/el/site.php` for localization and I have already added the translation of `First name` and other field names there as suggested. The problem is that the error messages for 'el' appear like this: `Το «First Name» δεν μπορεί να είναι κενό.` (The field 'First name' cannot be empty).
Panos Spiliotis
CC BY-SA 4.0
2018-09-03T17:49:18.160Z
@PanosSpiliotis can you confirm that this is for a custom field that you created in Settings > Fields? If not please update your question with more context.
Brandon Kelly
CC BY-SA 4.0
2018-09-04T09:52:48.357Z
No, these are not custom fields. I used those fields as part of the demo templates of Craft Commerce, which I adapted for the needs of the website I am working on. I have updated my question with more information.
Panos Spiliotis
CC BY-SA 4.0
2018-08-24T19:29:35.857Z
2018-08-24T19:29:35.857Z
Brandon Kelly
<p>I'm using Craft Commerce v2 on a Craft 3 Pro website. </p>

<p>The checkout process of the shop includes a number of forms such as the ones that visitor can use to add or edit shopping and billing addresses. All the templates are based on the demo templates for Craft Commerce and I haven't created any of those input fields using <code>Settings &gt; Fields</code>.</p>

<p>When an error occurs in one of those forms, an error message is displayed as expected under each input field. However, the error messages are not fully localized. For example, if a field is required and the form is submitted without a value for that field, then the error message appears localised except for the title of the required field.</p>

<p>In this error message: <code>The field "First Name" must not be empty.</code></p>

<p>the name of the field, <code>First Name</code>, is not localized. </p>

<p>e.g. <code>Το «First Name» δεν μπορεί να είναι κενό.</code></p>

<p>How can I localize the <code>«First Name»</code> part?</p>

<plugin-craftcommerce2>
Is there a way to localise error messages in Craft Commerce 2?
# Is there a way to localise error messages in Craft Commerce 2?

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

I'm using Craft Commerce v2 on a Craft 3 Pro website.

The checkout process of the shop includes a number of forms such as the ones that visitor can use to add or edit shopping and billing addresses. All the templates are based on the demo templates for Craft Commerce and I haven't created any of those input fields using `Settings > Fields`.

When an error occurs in one of those forms, an error message is displayed as expected under each input field. However, the error messages are not fully localized. For example, if a field is required and the form is submitted without a value for that field, then the error message appears localised except for the title of the required field.

In this error message: `The field "First Name" must not be empty.`

the name of the field, `First Name`, is not localized.

e.g. `Το «First Name» δεν μπορεί να είναι κενό.`

How can I localize the `«First Name»` part?

**Tags:** plugin-craftcommerce2

---

## 1 answers

### Answer by username_1 on 2018-08-24. Score: 1

User accounts’ First Name field isn’t required, so I’m guessing this is a custom field?
You can translate your custom field names using static message translations.
Create a new file at translations//site.php:
my-project.test/
├── config/
├── ...
└── translations/
    └── /
        └── site.php

(replace  with your language ID, e.g. el.)
Then have it return an array that translates your custom field names.
 'Ονομα',
];

> **Comments:**
> **username_0**: Thanks for the reply. I'm already using `translations/el/site.php` for localization and I have already added the translation of `First name` and other field names there as suggested. The problem is that the error messages for 'el' appear like this: `Το «First Name» δεν μπορεί να είναι κενό.` (The field 'First name' cannot be empty).  
> **username_1**: @PanosSpiliotis can you confirm that this is for a custom field that you created in Settings > Fields? If not please update your question with more context.  
> **username_0**: No, these are not custom fields. I used those fields as part of the demo templates of Craft Commerce, which I adapted for the needs of the website I am working on. I have updated my question with more information.  

---

