# Month, Day etc. names in other languages other than English

**URL:** <https://www.ruby-forum.com/t/month-day-etc-names-in-other-languages-other-than-english/145919>\
**Category:** Ruby\
**Created:** [August 15, 2008, 2:05am UTC](https://www.ruby-forum.com/t/month-day-etc-names-in-other-languages-other-than-english/145919 "2008-08-15T02:05:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Diego](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f04885/32.png) [@Diego](https://www.ruby-forum.com/u/Diego)\
**Post date:** [August 15, 2008, 2:05am UTC](https://www.ruby-forum.com/t/month-day-etc-names-in-other-languages-other-than-english/145919/1 "2008-08-15T02:05:45Z")

</div>

Hi all,

I was wondering if it was possible to internationalize the constant  
month and day names, used by DateTime class (for example), in to  
something other than English?

I’m using gettext in a Rails application where I am able to  
internationalize most of the application. But in some cases where I  
take something like a Time class and represent it with a string, I see  
the English names for days and months. “Thu”, “Aug” etc.

I /think/ this goes all the way down to Ruby and not Rails, hence my  
post here. Any help would be appreciated as to how I can  
internationalize this area of my application.

Thanks.

Cheers,  
Diego

---

<div class="post-metadata">

**Author:** ![Diego](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f04885/32.png) [@Diego](https://www.ruby-forum.com/u/Diego)\
**Post date:** [August 15, 2008, 2:56am UTC](https://www.ruby-forum.com/t/month-day-etc-names-in-other-languages-other-than-english/145919/2 "2008-08-15T02:56:14Z")

</div>

Diego wrote:

> Hi all,
> 
> I was wondering if it was possible to internationalize the constant  
> month and day names, used by DateTime class (for example), in to  
> something other than English?
> 
> I’m using gettext in a Rails application where I am able to  
> internationalize most of the application. But in some cases where I  
> take something like a Time class and represent it with a string, I see  
> the English names for days and months. “Thu”, “Aug” etc.
> 
> I /think/ this goes all the way down to Ruby and not Rails, hence my  
> post here. Any help would be appreciated as to how I can  
> internationalize this area of my application.
> 
> Thanks.
> 
> Cheers,  
> Diego

If it is a ruby issue, you can override the constants defined in the  
Date class. It will earn you a warning: already initialized constant,  
but that’s just what we mean to do. Using Dutch daynames:

require ‘Date’  
Date.const\_set(“DAYNAMES”,%w(zondag maandag dinsdag woensdag donderdag  
vrijdag zaterdag))  
p Date.today.strftime(“%A”)

Check [http://www.ruby-doc.org/stdlib/libdoc/date/rdoc/classes/Date.html](http://www.ruby-doc.org/stdlib/libdoc/date/rdoc/classes/Date.html)  
for the other constants like MONTHNAMES, ABBR\_MONTHNAMES, and  
ABBR\_DAYNAMES.

hth,

Siep

---

<div class="post-metadata">

**Author:** ![Diego](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/f04885/32.png) [@Diego](https://www.ruby-forum.com/u/Diego)\
**Post date:** [August 16, 2008, 4:03am UTC](https://www.ruby-forum.com/t/month-day-etc-names-in-other-languages-other-than-english/145919/3 "2008-08-16T04:03:07Z")

</div>

Siep K. wrote:

> If it is a ruby issue, you can override the constants defined in the  
> Date class. It will earn you a warning: already initialized constant,  
> but that’s just what we mean to do. Using Dutch daynames:

Doing so breaks DateTime. E.g. parsing will fail afair. There’s probably  
more issues.

> require ‘Date’

Don’t require ‘Date’, require ‘date’ instead. Otherwise your apps/libs  
will break on case sensitive file systems.

Regards  
Stefan R. (“apeiros”)
