# Date\_select problem with i18n

**URL:** <https://www.ruby-forum.com/t/date-select-problem-with-i18n/163101>\
**Category:** Rails\
**Created:** [March 17, 2009, 11:57am UTC](https://www.ruby-forum.com/t/date-select-problem-with-i18n/163101 "2009-03-17T11:57:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zeba-momin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/8e7dd6/32.png) [@zeba-momin](https://www.ruby-forum.com/u/zeba-momin)\
**Post date:** [March 17, 2009, 11:57am UTC](https://www.ruby-forum.com/t/date-select-problem-with-i18n/163101/1 "2009-03-17T11:57:56Z")

</div>

Hi,  
I’m localizing my rails 2.2.2 application using i18n.  
In my form(view) I have:  
\<%= date\_select :range,:start\_date,:order =\> [:month,:day,:year]%\>  
In environment.rb I have:  
I18n.default\_locale = ‘en-US’  
and in en-US.rb its:  
I18n.backend.store\_translations ‘en-US’,  
:date =\> {  
:order =\> [:month, :day, :year],  
:month\_names =\> %w[Jan Feb Mar Apr May Jun Jul Aug Spt Oct Nov Dec]  
}

My problem is that the date select options are not proper.  
Instead of month names in the drop down I get some 12 numeric  
values…!!! as 110,32,111,115…etc…  
How should I solve this???  
Please help…  
Thank You…

---

<div class="post-metadata">

**Author:** ![zeba-momin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/z/8e7dd6/32.png) [@zeba-momin](https://www.ruby-forum.com/u/zeba-momin)\
**Post date:** [July 14, 2009, 7:52pm UTC](https://www.ruby-forum.com/t/date-select-problem-with-i18n/163101/2 "2009-07-14T19:52:32Z")

</div>

Jeba M. wrote:

> Hi,  
> I’m localizing my rails 2.2.2 application using i18n.  
> In my form(view) I have:  
> \<%= date\_select :range,:start\_date,:order =\> [:month,:day,:year]%\>  
> In environment.rb I have:  
> I18n.default\_locale = ‘en-US’  
> and in en-US.rb its:  
> I18n.backend.store\_translations ‘en-US’,  
> :date =\> {  
> :order =\> [:month, :day, :year],  
> :month\_names =\> %w[Jan Feb Mar Apr May Jun Jul Aug Spt Oct Nov Dec]  
> }
> 
> My problem is that the date select options are not proper.  
> Instead of month names in the drop down I get some 12 numeric  
> values…!!! as 110,32,111,115…etc…  
> How should I solve this???  
> Please help…  
> Thank You…

Hi Jeba!  
I’m using Rails 2.3.2 and I’m developing a simple application with i18n  
features. I have put theese lines in a config/locales/fr.yml file:  
date:  
formats:  
default: “%d/%M/%Y”  
long: “%e %B %Y”  
short: “%d/%M/%y”

```
order: [:day, :month, :year]

month_names: [~, Janvier, FÃ©vrier, Mars, Avril, Mai, Juin, Juillet, 

```

AoÃ»t, Septembre, Octobre, Novembre, DÃ©cembre]

And my application is working out as I expect. For your information, I  
had tried on a first step without defining month\_names array and had  
same result than you describe.

Good luck!
