Bug#361223: cal: should use locale for knowing first day of the week
On Sat, Apr 08, 2006 at 01:56:26AM +0200, Samuel Thibault wrote: Graham Wilson, le Fri 07 Apr 2006 16:26:44 -0500, a ?crit : The next upload of bsdmainutils will support using _NL_TIME_FIRST_WEEKDAY (see #288472), now that glibc properly supports this. Great! Do you think this bug can be merged with #288472, or are there issues that you still feel are unresolved? -- gram -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#361223: cal: should use locale for knowing first day of the week
Package: bsdmainutils Version: 6.1.3 Severity: wishlist Hi, cal currently has -s and -m options for choosing the first day of the week. This shouldn't be necessary, thanks to locales (langinfo(_NL_TIME_FIRST_WEEKDAY)). Regards, samuel -- System Information: Debian Release: testing/unstable APT prefers testing APT policy: (900, 'testing'), (500, 'unstable'), (500, 'stable'), (1, 'experimental') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.17-rc1 Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15) Versions of packages bsdmainutils depends on: ii bsdutils 1:2.12r-8 Basic utilities from 4.4BSD-Lite ii debianutils 2.15.3 Miscellaneous utilities specific t ii libc6 2.3.6-3GNU C Library: Shared libraries an ii libncurses5 5.5-1 Shared libraries for terminal hand bsdmainutils recommends no packages. -- debconf information excluded -- Samuel Thibault [EMAIL PROTECTED] I develop for Linux for a living, I used to develop for DOS. Going from DOS to Linux is like trading a glider for an F117. (By [EMAIL PROTECTED], Lawrence Foard) -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#361223: cal: should use locale for knowing first day of the week
Hi, Samuel Thibault, le Fri 07 Apr 2006 11:28:31 +0200, a écrit : cal currently has -s and -m options for choosing the first day of the week. This shouldn't be necessary, thanks to locales (langinfo(_NL_TIME_FIRST_WEEKDAY)). Actually, more generally cal should use _NL_TIME_WEEK_NDAYS, _NL_TIME_WEEK_1STDAY, _NL_TIME_WEEK_1STWEEK, _NL_TIME_FIRST_WEEKDAY, and ABDAY_1, ABDAY_2, etc. for properly printing a fully localized calendar. Regards, Samuel
Bug#361223: cal: should use locale for knowing first day of the week
On Fri, Apr 07, 2006 at 11:42:10AM +0200, Samuel Thibault wrote: Samuel Thibault, le Fri 07 Apr 2006 11:28:31 +0200, a ?crit : cal currently has -s and -m options for choosing the first day of the week. This shouldn't be necessary, thanks to locales (langinfo(_NL_TIME_FIRST_WEEKDAY)). Actually, more generally cal should use _NL_TIME_WEEK_NDAYS, _NL_TIME_WEEK_1STDAY, _NL_TIME_WEEK_1STWEEK, _NL_TIME_FIRST_WEEKDAY, and ABDAY_1, ABDAY_2, etc. for properly printing a fully localized calendar. The next upload of bsdmainutils will support using _NL_TIME_FIRST_WEEKDAY (see #288472), now that glibc properly supports this. I've not, however, integrated support for any of the other constants. cal currently uses strftime to format names according to the current locale when it needs to. Is there a reason to use langinfo(3) for this instead? -- gram -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#361223: cal: should use locale for knowing first day of the week
Hi, Graham Wilson, le Fri 07 Apr 2006 16:26:44 -0500, a écrit : On Fri, Apr 07, 2006 at 11:42:10AM +0200, Samuel Thibault wrote: Samuel Thibault, le Fri 07 Apr 2006 11:28:31 +0200, a ?crit : cal currently has -s and -m options for choosing the first day of the week. This shouldn't be necessary, thanks to locales (langinfo(_NL_TIME_FIRST_WEEKDAY)). Actually, more generally cal should use _NL_TIME_WEEK_NDAYS, _NL_TIME_WEEK_1STDAY, _NL_TIME_WEEK_1STWEEK, _NL_TIME_FIRST_WEEKDAY, and ABDAY_1, ABDAY_2, etc. for properly printing a fully localized calendar. The next upload of bsdmainutils will support using _NL_TIME_FIRST_WEEKDAY (see #288472), now that glibc properly supports this. Great! I've not, however, integrated support for any of the other constants. cal currently uses strftime to format names according to the current locale when it needs to. Is there a reason to use langinfo(3) for this instead? Ah, ok. (I was indeed wondering where the weekdays were coming from). Well, stricly speaking, _NL_TIME_FIRST_WEEKDAY doesn't return an absolute day number, but a day number relatively to the day of _NL_TIME_WEEK_1STDAY: for instance, with a en_US locale, (int) nl_langinfo(_NL_TIME_WEEK_1STDAY) returns 19971130 as first day of week system, which is a Sunday. And * nl_langinfo(_NL_TIME_FIRST_WEEKDAY) returns 1, which means the first day of the week system, hence Sunday. With a fr_FR locale, (int) nl_langinfo(_NL_TIME_WEEK_1STDAY) returns 19971130 too (hence the first day of the week system is a Sunday too) and * nl_langinfo(_NL_TIME_FIRST_WEEKDAY) returns 2, which means 'the second day of the week system', hence Monday. Why such complexity? Because there may be other week systems, and there are: ISO/IEC 14652 sets _NL_TIME_WEEK_1STDAY to 19971201, which is a monday, and hence if in some locale * nl_langinfo(_NL_TIME_FIRST_WEEKDAY) returns 1, that means a monday (since the first day of the week system is 19971201, a monday). Plus there may be week systems where the number of days is not 7, so * nl_langinfo(_NL_TIME_WEEK_NDAYS) should be used for getting the number of days in a week, and then compute and display week days accordingly. Finally, there is * nl_langinfo(_NL_TIME_CAL_DIRECTION) that returns the direction of the days in a calendar: 1 : left-right from top 2 : top-down from left 3 : right-left from top Regards, Samuel -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]