/me@(voip.)?|www./ SamLown.com

Ruby: Dates in Gettext

My contribution to supporting dates, at least half decently, in Ruby on rails using Gettext.

http://www.ruby-forum.com/topic/129944

The approach I’ve taken is designed to act as a drop-in transparent replacement for the current standard date methods. The end result is that there is no need to change any of the existing date calls as they will automatically be internationalised. There are still a few extra bits to support, such as the Rails date_select methods, which I intend to add to a GettextDate plugin as soon as possible, and after a bit more testing of this approach.

Previously, I rather naively thought that dates would be easy to support in Gettext, but it turned out that it was a bit of a black spot with no clear solution. I expect most people just ended up using Globalite, Globalize, or just used name-less strings to get around the problem.

written by Sam,


No comments yet


Write your comment



HTML will be removed, but Textile formating is permitted. Log in for your comment to be posted without review.