# I18n.t returns a empty hash when a translation is missing

**URL:** <https://www.ruby-forum.com/t/i18n-t-returns-a-empty-hash-when-a-translation-is-missing/191098>\
**Category:** Rails I18n\
**Created:** [July 5, 2010, 12:14pm UTC](https://www.ruby-forum.com/t/i18n-t-returns-a-empty-hash-when-a-translation-is-missing/191098 "2010-07-05T12:14:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tdd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/35a633/32.png) [@tdd](https://www.ruby-forum.com/u/tdd)\
**Post date:** [July 5, 2010, 12:14pm UTC](https://www.ruby-forum.com/t/i18n-t-returns-a-empty-hash-when-a-translation-is-missing/191098/1 "2010-07-05T12:14:13Z")

</div>

Hello,

I’m migrating from rails 2.2.2 to rails 2.3.8 and I have a strange issue  
with I18n.translate.

In rails 2.2.2 development, when I try to get an untranslated key I have  
a error like “Translation missing: […]”

In rails 2.3.8 development, The I18n.t method returns an empty hash ({})  
for the same missing translation.

In environment.rb, I have the following code that is related to the I18n  
module:  
config.after\_initialize do

# No fallback locales in development environment; we want to see those

# translation missing errors.

fallbacks = {}  
I18n.valid\_locales.each do |l|  
fallbacks[l] = [l]  
end  
I18n.fallbacks = fallbacks

# Additionally, we log missing keys

require ‘globalize/i18n/missing\_translations\_log\_handler’  
I18n.missing\_translations\_logger = RAILS\_DEFAULT\_LOGGER  
I18n.exception\_handler = :missing\_translations\_log\_handler  
end

I tried to comment it out but it the same empty hash was returned.

Also, the I18n.t :default option seems to be broken as well. I suspect  
this is due to my stange behavior.

Any suggestion?

Thanks in advance,  
Christophe

---

<div class="post-metadata">

**Author:** ![tdd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/35a633/32.png) [@tdd](https://www.ruby-forum.com/u/tdd)\
**Post date:** [July 5, 2010, 12:26pm UTC](https://www.ruby-forum.com/t/i18n-t-returns-a-empty-hash-when-a-translation-is-missing/191098/2 "2010-07-05T12:26:10Z")

</div>

Find out: it was the globalize2 plugin that caused this strange issue.
