Locale depend time output?

Hi All,

Is there a way to change this:

irb(main):005:0> Time.new.strftime(’%A’)
=> “Monday”

In this:

irb(main):005:0> Time.new.strftime(’%A’)
=> “Montag”

This would be the ideal implementation:

require ‘locale’

Locale.locale=‘de_DE’ do

The new locale just exists in this block

p Time.new.strftime(’%A’) # => ‘Montag’
end

Now the Locale has been set back to default.

p Time.new.strftime(’%A’) # => ‘Monday’

Does such a library exist?

Markus S. wrote:

irb(main):005:0> Time.new.strftime(’%A’)
=> “Montag”
[snip]
Does such a library exist?

I know nothing about it, but 30s of Googling turned up this:
http://www.yotabanana.com/hiki/ruby-gettext.html

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs