LC_TIME for Buddhist Era in Thailand
numata at jp.fujitsu.com
Fri May 13 03:35:42 PDT 2005
Thawatchai Piyawat wrote:
> I've created a locale th_TH (Thai in Thailand). It can be found in
> ports/misc/thailocale. Everything seems to work fine so far except a
> problem in LC_TIME.
> To solve the problem, I would like to ask everyone the following questions:
> 1) In Thailand, we use the Buddhist Era that starts 543BC. This year
> (2005) is the year 2548 in Thailand. The problem is that I can't
> figure out how to put "plus 543" in the LC_TIME file.
I've read the source code of libc's time- and locale-related
functions. It seems to me that the current LC_TIME support
does not have "era" support.
I've read the following files:
and found that the lc_time_T structure defined in timelocal.h
(which is used to contain locale-dependent strings for month
names, date format, etc.) does not have any era-related members.
The Single UNIX Specification, the standard for UNIX systems,
defines how to describe era in LC_TIME definition. Currently
only commercial UNIX systems such as Solaris and HP-UX have
suport of era. The following is the manual for HP-UX:
Search for "LC_TIME" and see how era definitions are described.
> 2) I can't find a syntax reference for FreeBSD locale definitions.
> I've created th_TH by looking at the source of other locales. This
> method works, but it doesn't give me certainty that what I've done is
> correct. If such references exist, it would really help me.
I couldn't find such document neither. The format of LC_TIME
seems that the file contains lines of text string, each line
corresponds to one string entry of lc_time_T structure. For
example, the first line corresponds to mon string, the
second line to mon string, and so on.
The lines that begin with "#" character are comments and will
be deleted before installation, so only data lines are included
in the installed locale files.
More information about the freebsd-i18n