There was some discussion about localized tznames. SunOS currently doesn't support localized tzname's. If we were to implement it, we would probably take the approach of i18n messages. We could create message catalogs for Olson timezone tznames, which contain translated tznames for the locales. A message-id could be created, perhaps by concatenating the timezone name with the tzname (for example, "America/Los_Angeles_PST"). The message-id could be passed to dcgettext(), which would return the localized tzname according to the locale specified by LC_TIME. We might use a new specifier in strftime() (which would call dcgettext()) to return the localized tzname or the original tzname if no localized tzname exists. We would keep the values of TZ and tzname[] as elements from the portable character set. The TZ environment variable is inherited by applications. By default applications start in the C locale. If a time function is called before setlocale() is done (or if the application does not call setlocale()), the time function could fail if TZ is composed of invalid characters for the C locale. Also, if TZ or tzname[] is composed of multibyte characters, and the application changes locales, it could invalidate those characters. Robbin
Robbin Kawabata <Robbin.Kawabata@eng.sun.com> writes:
A message-id could be created, perhaps by concatenating the timezone name with the tzname (for example, "America/Los_Angeles_PST").
I like most of your proposal, and the basic idea makes sense, but unfortunately this particular method won't work in general. For example, for Europe/Portugal, the abbreviation "LMT" sometimes means "Local Mean Time" and sometimes "Lisbon Mean Time", so "Europe/Portugal_LMT" would be ambiguous. Perhaps the tz database needs to have an augmented form, that specifies an unambiguous name for each local zone abbreviation. That might be something that gets folded in while we're adding support for 64-bit time_t values, perhaps?
We might use a new specifier in strftime() (which would call dcgettext()) to return the localized tzname or the original tzname if no localized tzname exists.
This should be the %EZ specifier, since E designates the locale's alternative representation.
participants (2)
-
Paul Eggert -
Robbin Kawabata