Mailinglist Archive: yast-devel (52 mails)

< Previous Next >
[yast-devel] Dates localization in YaST
  • From: Ancor Gonzalez Sosa <ancor@xxxxxxx>
  • Date: Wed, 11 Feb 2015 18:18:02 +0100
  • Message-id: <54DB8ECA.7040304@suse.de>
While writing the YaST Journal module I faced a problem I'm not sure how
to solve. I wanted to format a date here:
https://github.com/ancorgs/yast-journal/blob/master/src/lib/systemd_journal/entry_presenter.rb#L49

I wanted to mimic the format used by journalctl itself, which in plain
English would be "%b %d %H:%M:%S". The problem is that using %b is not
i18n-friendly. Obviously the problem goes further, like those crazy US
people writing Feb. 1st as 02/01/2015. :-)

In Rails the i18n gem is used. It offers an "localize" method that deals
with date formatting
http://www.rubydoc.info/github/svenfuchs/i18n/master/I18n/Backend/Base:localize

But I don't know how to do it in YaST or if I'm the first one facing the
problem.

Cheers.
--
Ancor González Sosa
YaST Team at SUSE Linux GmbH
--
To unsubscribe, e-mail: yast-devel+unsubscribe@xxxxxxxxxxxx
To contact the owner, e-mail: yast-devel+owner@xxxxxxxxxxxx

< Previous Next >