# Gettext Validation/Error localization problems

**URL:** <https://www.ruby-forum.com/t/gettext-validation-error-localization-problems/136204>\
**Category:** Rails I18n\
**Created:** [April 29, 2008, 7:56pm UTC](https://www.ruby-forum.com/t/gettext-validation-error-localization-problems/136204 "2008-04-29T19:56:47Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![max-lapshin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@max-lapshin](https://www.ruby-forum.com/u/max-lapshin)\
**Post date:** [April 29, 2008, 7:56pm UTC](https://www.ruby-forum.com/t/gettext-validation-error-localization-problems/136204/1 "2008-04-29T19:56:47Z")

</div>

Is there a way to turn off ruby-gettext’s feature that localizes the  
default validation/error messages in models? If I use gettext in my  
application, it breaks almost all of my unit tests.

From  
[http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html?ruby-gettext-howto-rails#Models](http://www.yotabanana.com/hiki/ruby-gettext-howto-rails.html?ruby-gettext-howto-rails#Models)  
:

“Default validation/error messages are also localized automatically.”

---

<div class="post-metadata">

**Author:** ![max-lapshin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c77e96/32.png) [@max-lapshin](https://www.ruby-forum.com/u/max-lapshin)\
**Post date:** [April 30, 2008, 7:27pm UTC](https://www.ruby-forum.com/t/gettext-validation-error-localization-problems/136204/2 "2008-04-30T19:27:29Z")

</div>

I’ve managed to fix the problems for the time being.  
I’ve had to make the following change on the majority of the  
assertions in my unit tests, but it got the job done:

From:  
assert @cp.errors[:package] == “can’t be blank”  
To:  
assert @cp.errors[:package] == “%{fn} can’t be blank”
