# How can I translate form fields name in error messages?

**URL:** <https://www.ruby-forum.com/t/how-can-i-translate-form-fields-name-in-error-messages/201288>\
**Category:** Rails I18n\
**Created:** [January 4, 2011, 4:17pm UTC](https://www.ruby-forum.com/t/how-can-i-translate-form-fields-name-in-error-messages/201288 "2011-01-04T16:17:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![luislavena](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/0ea827/32.png) [@luislavena](https://www.ruby-forum.com/u/luislavena)\
**Post date:** [January 4, 2011, 4:17pm UTC](https://www.ruby-forum.com/t/how-can-i-translate-form-fields-name-in-error-messages/201288/1 "2011-01-04T16:17:58Z")

</div>

I have a form with labels that I translate using the I18n format with  
YAML files.

If the user does not fill in a field properly on the form an error  
message is displayed.

I have managed to set up the YAML file to translate the messages but the  
name of the field in the error message does not get translated.

For example:  
City doit être rempli

How to I make sure the field names are translated in the error message?

Thanks in advance.

Mitch

---

<div class="post-metadata">

**Author:** ![mitch\_newbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea5d25/32.png) [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Post date:** [January 4, 2011, 4:58pm UTC](https://www.ruby-forum.com/t/how-can-i-translate-form-fields-name-in-error-messages/201288/2 "2011-01-04T16:58:43Z")

</div>

2011/1/4 Mitchell G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> City doit tre rempli

Mybe this help you:

> **[Internationalization (I18n) — Ruby on Rails Guides](https://edgeguides.rubyonrails.org/i18n.html#translations-for-active-record-models)**
>
> In this guide you will learn how to translate your application into a single non-English language or provide multi-language support.After reading this guide, you will know: How I18n works in Ruby on Rails How to configure, set, and switch locales in...

en:  
activerecord:  
models:  
city: city in german

---

<div class="post-metadata">

**Author:** ![mitch\_newbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea5d25/32.png) [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Post date:** [January 5, 2011, 9:34am UTC](https://www.ruby-forum.com/t/how-can-i-translate-form-fields-name-in-error-messages/201288/3 "2011-01-05T09:34:53Z")

</div>

2011/1/5 Mitchell G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> > en:  
> > activerecord:  
> > models:  
> > city: city in german
> 
> Thank you very much that is perfect

Great 🙂

---

<div class="post-metadata">

**Author:** ![mitch\_newbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea5d25/32.png) [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Post date:** [January 5, 2011, 4:17am UTC](https://www.ruby-forum.com/t/how-can-i-translate-form-fields-name-in-error-messages/201288/4 "2011-01-05T04:17:29Z")

</div>

AndrÃ©s GutiÃ©rrez wrote in post #972249:

> 2011/1/4 Mitchell G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> > City doit tre rempli
> 
> Mybe this help you:

> **[Internationalization (I18n) — Ruby on Rails Guides](https://edgeguides.rubyonrails.org/i18n.html#translations-for-active-record-models)**
>
> In this guide you will learn how to translate your application into a single non-English language or provide multi-language support.After reading this guide, you will know: How I18n works in Ruby on Rails How to configure, set, and switch locales in...

> en:  
> activerecord:  
> models:  
> city: city in german

Thank you very much that is perfect

---

<div class="post-metadata">

**Author:** ![mitch\_newbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea5d25/32.png) [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Post date:** [January 5, 2011, 10:22am UTC](https://www.ruby-forum.com/t/how-can-i-translate-form-fields-name-in-error-messages/201288/5 "2011-01-05T10:22:33Z")

</div>

Just for clarification: " City doit tre rempli" is French and not German  
😉

2011/1/5 Andrs gutirrez [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![mitch\_newbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea5d25/32.png) [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Post date:** [January 5, 2011, 10:35am UTC](https://www.ruby-forum.com/t/how-can-i-translate-form-fields-name-in-error-messages/201288/6 "2011-01-05T10:35:06Z")

</div>

El 5 de enero de 2011 10:21, Andrs M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) escribi:

> Just for clarification: " City doit tre rempli" is French and not German  
> 😉

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![mitch\_newbie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/ea5d25/32.png) [@mitch\_newbie](https://www.ruby-forum.com/u/mitch_newbie)\
**Post date:** [March 26, 2012, 1:54pm UTC](https://www.ruby-forum.com/t/how-can-i-translate-form-fields-name-in-error-messages/201288/7 "2012-03-26T13:54:43Z")

</div>

On top of respond are actually ideal. They specified all answer intended  
for translate form fields name in error messages.

> **[Professional Human Translation, Subtitling & Interpretation Services](https://translatebyhumans.com/)**
>
> High-quality human translation, localisation, subtitling, and interpretation services provided by experts in 180+ languages
