locale.5: Document glibc conventions regarding days and week

Based on existing practice and glibc community wiki page at
https://sourceware.org/glibc/wiki/Locales

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
This commit is contained in:
Marko Myllynen 2014-05-26 08:51:06 +03:00 committed by Michael Kerrisk
parent bf1debcce1
commit 756f4b9742
1 changed files with 53 additions and 13 deletions

View File

@ -974,14 +974,14 @@ followed by a list of abbreviated names of the days of the week.
The list starts with the first day of the week
as specified by
.I week
(Sunday by default).
(Sunday by default). See NOTES.
.TP
.I day
followed by a list of names of the days of the week.
The list starts with the first day of the week
as specified by
.I week
(Sunday by default).
(Sunday by default). See NOTES.
.TP
.I abmon
followed by a list of abbreviated month names.
@ -1020,16 +1020,7 @@ Regarding the start of the week,
shall be used for Sunday and
.B 19971201
shall be used for Monday.
Thus, countries using
.B 19971130
should have local Sunday name as the first day in the
.I day
list,
while countries using
.B 19971201
should have Monday translation as the first item in the
.I day
list.
See NOTES.
.TP
.IR first_weekday " (since glibc 2.2)"
followed by the number of the first day from the
@ -1040,7 +1031,7 @@ The default value of
corresponds to either Sunday or Monday depending
on the value of the second
.I week
list item.
list item. See NOTES.
.TP
.IR first_workday " (since glibc 2.2)"
followed by the number of the first working day from the
@ -1048,6 +1039,7 @@ followed by the number of the first working day from the
list.
The default value is
.BR 2 .
See NOTES.
.TP
.I cal_direction
.\" from localedata/locales/uk_UA
@ -1082,6 +1074,54 @@ Usual default locale archive location.
Usual default path for locale definition files.
.SH CONFORMING TO
POSIX.2, ISO/IEC TR 14652.
.SH NOTES
The collective GNU C library community wisdom regarding
.IR day ,
.IR week ,
and
.I first_weekday
states at
https://sourceware.org/glibc/wiki/Locales
the following:
.PP
The value of the second
.I week
list item specifies the base of the
.I day
list.
.PP
.I first_weekday
specifies the offset of the first day-of-week in the
.I day
list.
.PP
For compatibility reasons, all glibc locales should set the value of the
second
.I week
list item to
.B 19971130
(Sunday) and base the
.I day
list appropriately, and set
.I first_weekday
to
.B 1
or
.BR 2 ,
depending on whether the week actually starts on Sunday or Monday
for the locale.
.PP
Thus, a locale which week starts on Monday
.I first_weekday
and
.I first_workday
should be set to
.B 2
and
.I abday
and
.I day
should have the locale representation of Sunday as the first list item.
.SH BUGS
This manual page isn't complete.
.\" .SH AUTHOR