Re: Formatting a date/time string

2005-12-28 Thread Abel Cheung
On 12/29/05, Federico Mena Quintero <[EMAIL PROTECTED]> wrote:
> Rick Stockton has been looking into adding a Time field to
> GtkFileChooser:
>
> http://bugzilla.gnome.org/show_bug.cgi?id=324543
>
> Nautilus seems to use a plain "%c" format for strftime(), but that seems
> to produce really long strings.
>
> Is there a standard format string that we can use to produce a short
> representation of the date and time?  Or should we just use %c and
> assume that the locale data will be acceptable to the user?

%c poses some usability annoyance since the file dialog will be either very
large, or the date/time part is simply hidden under cover and users have
to scroll horizontally before seeing it.

If short string is more desired, I'd suggest showing only the time if
modification time is within 1 day, and only showing the date if more than
1 day. And use ISO8601 format for date representation as well:
"%Y-%m-%d". This avoids ambiguity. For display of time, perhaps
the seconds part can be removed as well?

And of course, make the string translatable is the best thing to do, since
translators can decide if there are any better date/time representation
for their own language.

Abel

>
> Thanks,
>
>   Federico
>
> ___
> gnome-i18n mailing list
> gnome-i18n@gnome.org
> http://mail.gnome.org/mailman/listinfo/gnome-i18n
>


--
Abel Cheung   (GPG Key: 0xC67186FF)
Key fingerprint: 671C C7AE EFB5 110C D6D1  41EE 4152 E1F1 C671 86FF

* GNOME Hong Kong - http://www.gnome.hk/
* Opensource Application Knowledge Assoc. - http://oaka.org/
___
gnome-i18n mailing list
gnome-i18n@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-i18n


Re: Formatting a date/time string

2005-12-29 Thread Roozbeh Pournader
On Wed, 2005-12-28 at 20:44 -0600, Federico Mena Quintero wrote:
> Is there a standard format string that we can use to produce a short
> representation of the date and time?  Or should we just use %c and
> assume that the locale data will be acceptable to the user?

The standard way to do it is using whatever makes sense to use for
United States English that strftime offers (say "%b %e, %y ..."), then
make it translatable with a comment like: "translators should try to
make this as short as possible, while mentioning the complete date and
mentioning both minutes and hours in the translation". Something like
that.

We will try to make date and time formatting better in Giulia
(http://live.gnome.org/LocaleProject), possibly even as the first
priority, but the project is currently inactive because of the very
limited developer resources.

roozbeh


___
gnome-i18n mailing list
gnome-i18n@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-i18n


Re: Formatting a date/time string

2005-12-29 Thread Christian Rose
On 12/29/05, Abel Cheung <[EMAIL PROTECTED]> wrote:
> %c poses some usability annoyance since the file dialog will be either very
> large, or the date/time part is simply hidden under cover and users have
> to scroll horizontally before seeing it.

Agreed.


> If short string is more desired, I'd suggest showing only the time if
> modification time is within 1 day, and only showing the date if more than
> 1 day. And use ISO8601 format for date representation as well:
> "%Y-%m-%d". This avoids ambiguity. For display of time, perhaps
> the seconds part can be removed as well?

I'd say try to use %x and/or %X for dates and times. They usually
produce shorter string representations than the %c specifier.
Unfortunately, there is no standard specifier that produces a
localized time string without the seconds part... :-(

> And of course, make the string translatable is the best thing to do, since
> translators can decide if there are any better date/time representation
> for their own language.

Agreed. If you want to use both %x and %X in the time display, you
probably have to make it translateable, so that translators can
reorder the arguments if necessary.

However, this sucks for users who only want to have the display
language be something different (LC_MESSAGES), but otherwise want to
have times etc. be formatted according to their own locale, since
doing it like this and hooking up the date/time display in the
translations makes the time display be dependant on the display
language. But it is probably the best thing to do right now, until we
have something better.


Christian
___
gnome-i18n mailing list
gnome-i18n@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-i18n


Re: Formatting a date/time string

2005-12-30 Thread Abel Cheung
Hi,


On 12/30/05, Rick Stockton <[EMAIL PROTECTED]> wrote:

>  Yes, it's NASTY-WIDE. My Proposed Patch implements the wider dialog. Both
> "Date/Time" and "Size" are re-sizable columns, which helps a little bit. But
> the key, I think, is to address the internationalized format itself. If we
> have to work from %c (which we probably DON'T, see asterisk section below)
> then I think that:
>
>  the first thing to chop off is the time zone, DEFINITELY not needed;
>  the second thing to chop off is the seconds, (hard to imagine when someone
> would need "seconds" within the filechooser.)
>  And, the 3rd thing I'd like to chop off is the day-of-week.
>
>  If necessary, this leads to 2 questions:
>
>  (1) Are all timezones shown via a 3-character code, or do some locales have
> more characters? (I'm not counting bytes, I'm counting characters). If so,
> we could chop it off inline. I've got a bad feeling that at least one of the
> many-glyph languages (e.g., Chinese), might use just a single character for
> this.

See below.

>
>  (2) Similarly, is it possible that all locales use a 3-character code  for
> Day-Of-Week? Again, I doubt it, but it would be easy to chop off if this was
> true.

Both (1) and (2) may not be true. There exists 4-letter timezone (e.g. HKST)
though I don't really know if anything like that is actively in use. And
you guessed it correctly that some places don't use 3 letters to represent
day of week.

In general, chopping letters off %c is almost certain to cause problem.

>
>
>  If short string is more desired, I'd suggest showing only the time if
> modification time is within 1 day, and only showing the date if more than
> 1 day. And use ISO8601 format for date representation as well:
> "%Y-%m-%d". This avoids ambiguity. For display of time, perhaps
> the seconds part can be removed as well?
>
>  Per above, I really like chopping out the seconds. But showing "time" only
> for today's files doesn't really do any good-- once we've printed a couple
> files with the time included, the column width is set large, and the empty
> space (shown with the other files) wouldn't save room, it would just be a
> visual distraction. More importantly, I think that we'd be cutting out
> useful data.

May I ask: what useful data will be cut out?


>
>  3rd idea, I don't like it. I feel that using ISO8601 is really ugly for
> "non-experts" in the US locale: 2005-10-11 is clearly the 11th of October,
> but almost *EVERY* other program they've used, especially if they come from
> Windoze, shows m/d/y. Too radical and upsetting, I think.

For other countries, I'd disagree; but for US people, then I also think you're
correct.


>  I'd say try to use %x and/or %X for dates and times. They usually
> produce shorter string representations than the %c specifier.
> Unfortunately, there is no standard specifier that produces a
> localized time string without the seconds part... :-(
>
>  *** THANK YOU  
>
>  How about %x (local-appropriate date),
>
>  preceded by %R (24-hour hh:mm) ???
>
>
>  if %x leaves out stuff which we don't want, like Time Zone, but handles
>  correct MM/DD/ versus /MM/DD according to the locale, I think that
>  further adjustments are low priority.
>  (But I'm a newby, and I can't even spell "i10n".)

Agreed %x would be the better default choice, and I'd be grateful if
it's translatable - because on the contrary of most locales, %x is a bad
and ugly choice for Taiwan and Hong Kong.

About %R: beware that some countries may prefer 12hr notation instead
of 24hr one. I'm not sure what can be done in this area. gnome-panel
currently uses translation to decide whether to use 12 or 24hr.

>
>  Is 24 hour clock formatted as "hh:mm" universally understood? I suspect
> that it *is*.
>  There went the seconds!
> 
>
>
>  And of course, make the string translatable is the best thing to do, since
> translators can decide if there are any better date/time representation
> for their own language.
>
>  If any translator is not pleased by the %x date, or the hh:mm time
> preceding it,
>  then we WILL want to go there.

Yes, yes, please :-)

Abel


>  Agreed. If you want to use both %x and %X in the time display, you
> probably have to make it translateable, so that translators can
> reorder the arguments if necessary.
>
> However, this sucks for users who only want to have the display
> language be something different (LC_MESSAGES), but otherwise want to
> have times etc. be formatted according to their own locale, since
> doing it like this and hooking up the date/time display in the
> translations makes the time display be dependant on the display
> language. But it is probably the best thing to do right now, until we
> have something better.
>
> Christian
>
>  I don't have any idea of the weakness in having locale control
> everything...
>  but you do, so I'm all ears. For right now, I think that

Re: Formatting a date/time string

2005-12-30 Thread Mohammad DAMT
Pada hari Kamis, tanggal 29/12/2005 pukul 11:57 +0100, Christian Rose
menulis:
> However, this sucks for users who only want to have the display
> language be something different (LC_MESSAGES), but otherwise want to
> have times etc. be formatted according to their own locale, since
> doing it like this and hooking up the date/time display in the
> translations makes the time display be dependant on the display
> language. But it is probably the best thing to do right now, until we
> have something better.

I would rather go having separate PO file and put the MO file in LC_TIME
directory instead of put them together in LC_MESSAGES.

> Christian
> ___
> gnome-i18n mailing list
> gnome-i18n@gnome.org
> http://mail.gnome.org/mailman/listinfo/gnome-i18n

___
gnome-i18n mailing list
gnome-i18n@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-i18n


Re: Formatting a date/time string

2005-12-30 Thread Mohammad DAMT
Pada hari Jumat, tanggal 30/12/2005 pukul 18:53 +0200, Mohammad DAMT
menulis:

> I would rather go having separate PO file and put the MO file in LC_TIME
> directory instead of put them together in LC_MESSAGES.

And fetch the message using dcgettext (domain, text, LC_TIME);

___
gnome-i18n mailing list
gnome-i18n@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-i18n


Re: Formatting a date/time string

2006-01-01 Thread Roozbeh Pournader
On Thu, 2005-12-29 at 18:08 -0800, Rick Stockton wrote:
> If necessary, this leads to 2 questions:
> 
> (1) Are all timezones shown via a 3-character code, or do some locales
> have more characters? (I'm not counting bytes, I'm counting
> characters).

The timezone abbreviations become 4 characters in some cases. Generally,
you can't assume anything about them, specially if it could become
localized. for example, the localized version of Iranian timezone to
Persian, is usually three *words*.

> (2) Similarly, is it possible that all locales use a 3-character code
> for Day-Of-Week? Again, I doubt it, but it would be easy to chop off
> if this was true.

No. Actually some locales (including Persian) don't even have an
abbreviation for weekdays.

> Is 24 hour clock formatted as "hh:mm" universally understood? I
> suspect that it *is*.

Not necessarily. You shouldn't assume it is universally understood.

> > The standard way to do it is using whatever makes sense to use for
> > United States English that strftime offers (say "%b %e, %y ..."), then
> > make it translatable with a comment like: "translators should try to
> > make this as short as possible, while mentioning the complete date and
> > mentioning both minutes and hours in the translation". Something like
> > that.
> > 
> >   
> I *don't* like this-- most of the world is -MM-DD, we shouldn't
> hard-code the WEIRD
> en-us as the standard. (But mostly, I suspect that we won't have to...
> testing shortly).

No, you are not hard coding the WEIRD en-us as the standard. This is the
way gettext works. You should use whatever is more appropriate in the
en_US locale, and at the same time let localizers localize that. This is
the way it has been working in GNOME for ages. Developers shouldn't try
to do something that is "acceptable" to all locales, they should provide
localization mechanisms.

roozbeh


___
gnome-i18n mailing list
gnome-i18n@gnome.org
http://mail.gnome.org/mailman/listinfo/gnome-i18n