# What I put in is not what I get back

**URL:** <https://www.ruby-forum.com/t/what-i-put-in-is-not-what-i-get-back/205952>\
**Category:** Rails I18n\
**Created:** [April 19, 2011, 10:33am UTC](https://www.ruby-forum.com/t/what-i-put-in-is-not-what-i-get-back/205952 "2011-04-19T10:33:31Z")\
**Posts on this page:** 1\
**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:** [April 19, 2011, 10:33am UTC](https://www.ruby-forum.com/t/what-i-put-in-is-not-what-i-get-back/205952/1 "2011-04-19T10:33:31Z")

</div>

Hi,

Rails date\_select method takes an order argument, like this:  
date\_select ‘page’, ‘publish\_at’, :order =\> [:day, :month, :year]

The items in the order array _must_ be symbols, so this does not work:  
date\_select ‘page’, ‘publish\_at’, :order =\> [‘day’, ‘month’, ‘year’]

Lets say we have this locale file:  
en:  
date:  
order:  
- :year  
- :month  
- :day

When using i18n’s simple backend, I18n.t(‘date.order’), would return  
exactly [:day, :month, :year] (an array of symbols).

However, if I change the backend to a key/value-store, such as a Hash  
or Redis, the return value of I18n.t(‘date.order’) would be exactly  
[‘day’, ‘month’, ‘year’] (an array of strings).

Obiously this raises a problem in Rails since the date\_select (an  
friends) do not accept strings in the array.

So, who to blame?

- Should all key/value stores support Ruby symbols?
- Should Rails accept strings in the array?
- Should i18n try to be clever (if even possible)?
- …

Thanks!
