# Translation key escape suggestion

**URL:** <https://www.ruby-forum.com/t/translation-key-escape-suggestion/184859>\
**Category:** Rails I18n\
**Created:** [March 9, 2010, 4:19pm UTC](https://www.ruby-forum.com/t/translation-key-escape-suggestion/184859 "2010-03-09T16:19:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ginger72](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@ginger72](https://www.ruby-forum.com/u/ginger72)\
**Post date:** [March 9, 2010, 4:19pm UTC](https://www.ruby-forum.com/t/translation-key-escape-suggestion/184859/1 "2010-03-09T16:19:20Z")

</div>

Hi,

while working on globalize\_bridge, a plugin that is supposed to  
provide a seamless migration path to I18n from Globalize1, I  
discovered what might be a useful feature in future versions of I18n.

My app uses translations (mind I am using Globalize1) and therefore  
keys can look like this: “Cat. Or Dog.”, which, by default, is not  
picked up correctly by I18n, e.g.:

de:  
“Cat. Or Dog.”: “Katze oder Hund…outside namespace.”  
namespace:  
“Cat. Or Dog.”: “Katze oder Hund…within namespace.”

Reason being, the default separator (I18n.default\_separator) is set to  
“.”, therefore, normalize\_keys (or normalize\_translation\_keys) is not  
parsing key parameters correctly.

So I overloaded I18.normalize\_keys to parse translations defined like  
this:

I18n.t ‘namespace.“Cat. Or Dog.”’ -\> “Katze oder Hund…within  
namespace.”  
I18n.t “Cat. Or Dog.” -\> “Katze oder Hund…outside namespace.”

What are your thoughts?

Greetings,  
Juergen
