Austin Group Defect Tracker

Aardvark Mark III


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001166 [1003.1(2016)/Issue7+TC2] System Interfaces Comment Enhancement Request 2017-10-27 20:11 2017-10-27 22:53
Reporter zackw View Status public  
Assigned To
Priority normal Resolution Open  
Status New  
Name Zack Weinberg
Organization
User Reference
Section strftime
Page Number ?
Line Number ?
Interp Status ---
Final Accepted Text
Summary 0001166: Case variants needed for strftime %b as well as %B
Description In the process of implementing the resolution to defect #258 <http://austingroupbugs.net/view.php?id=258> [^] in the GNU C Library, we have found that case variants are needed for abbreviated month names (%b) as well as full month names (%B). For example, in Russian the name of the fifth month is май, which is only three letters, so it doesn't change when abbreviated, and the abbreviation declines just like the full noun (май nominative, мая genitive).
Desired Action Make parallel changes for %b as were accepted for %B in #258. Suggested edits (these assume that the edits in #258 have already been applied):


Locale Sec 7.3.5.1 LC_TIME Locale Definition, at the end of the specification of the "abmon" keyword, add: For languages having both a genitive (when used with a day number) and a nominative (no day number) case, this operand shall be used to denote the genitive case.

Locale Sec 7.3.5.1 LC_TIME Locale Definition, after the specification of the "abmon" keyword, insert:
ab_alt_mon Define the abbreviated month names, corresponding to the %Ob conversion specification. The operand shall consist of twelve <semicolon>-separated strings, each surrounded by double-quotes. The first string shall be the abbreviated name of the first month of the year (January), the second the abbreviated name of the second month, and so on. For languages having both a genitive (when used with a day number) and a nominative (no day number) case, this operand shall be used to denote the nominative case.

Locale Sec 7.3.5.2 LC_TIME C-Language Access, after the specification of ABMON_x, insert:
ABALTMON_x The alternative abbreviated month names (for example, Jan), where x is a number from 1 to 12.

Locale Sec 7.3.5.3 LC_TIME Category in the POSIX Locale, after the "abmon" entries in the table, add these entries:
ab_alt_mon ABALTMON_1 %Ob N/A
ab_alt_mon ABALTMON_2 %Ob N/A
ab_alt_mon ABALTMON_3 %Ob N/A
ab_alt_mon ABALTMON_4 %Ob N/A
ab_alt_mon ABALTMON_5 %Ob N/A
ab_alt_mon ABALTMON_6 %Ob N/A
ab_alt_mon ABALTMON_7 %Ob N/A
ab_alt_mon ABALTMON_8 %Ob N/A
ab_alt_mon ABALTMON_9 %Ob N/A
ab_alt_mon ABALTMON_10 %Ob N/A
ab_alt_mon ABALTMON_11 %Ob N/A
ab_alt_mon ABALTMON_12 %Ob N/A

Locale Sec 7.4.2 Locale Grammar, to the "time_keyword_name" production add:
| 'ab_alt_mon'

langinfo.h, in the table of symbolic constants with type nl_item, after ABMON_12 add:
ABALTMON_1 LC_TIME Abbreviated alternative name of the first month of the year.
ABALTMON_2 LC_TIME Abbreviated alternative name of the second month.
ABALTMON_3 LC_TIME Abbreviated alternative name of the third month.
ABALTMON_4 LC_TIME Abbreviated alternative name of the fourth month.
ABALTMON_5 LC_TIME Abbreviated alternative name of the fifth month.
ABALTMON_6 LC_TIME Abbreviated alternative name of the sixth month.
ABALTMON_7 LC_TIME Abbreviated alternative name of the seventh month.
ABALTMON_8 LC_TIME Abbreviated alternative name of the eighth month.
ABALTMON_9 LC_TIME Abbreviated alternative name of the ninth month.
ABALTMON_10 LC_TIME Abbreviated alternative name of the tenth month.
ABALTMON_11 LC_TIME Abbreviated alternative name of the eleventh month.
ABALTMON_12 LC_TIME Abbreviated alternative name of the twelfth month.

strftime, in the list of conversion specifiers, after 'b' insert
Ob Replaced by the locale’s abbreviated alternative month name.

strptime, in the list of conversion specifiers, replace the definitions of 'b', 'B', and 'OB' with:
b The month, using the locale's month names; either the abbreviated or full version of either the default or the alternative month name may be specified.
B Equivalent to b.
Ob Equivalent to b.
OB Equivalent to b.

Also add immediately below 'h':
Oh Equivalent to b.


XSH date, section "modified conversion specifications", insert after "alt_mon":
ab_alt_mon,

XSH date, in the table of modified conversion specifiers, insert at an appropriate place:
%Ob The locale’s abbreviated alternative month name.
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0003872)
shware_systems (reporter)
2017-10-27 21:02

While a corner case, I agree for thoroughness this has merit. Additionally, having %Od and %OD so both %b and %Ob forms, or respectively %B and %OB with %D and %OD, may be accessible for the full date usages appears warranted. A way to test whether alternate forms are present in an active locale should also be documented for langinfo() for these specifiers, rather than require existing locales to all add dummy settings for these.
(0003873)
zackw (reporter)
2017-10-27 21:24

> rather than require existing locales to all add dummy settings for these

I didn't find a good place to add it to the spec, but what we are doing about this in glibc is, our version of the localedef utility will set the altmon/abaltmon strings equal to the mon/abmon strings if they aren't specified in a definition file.
(0003874)
shware_systems (reporter)
2017-10-27 22:53

The text may be in the standard already somewhere, about defaulting for other %O types and testing them. I added that to make sure it doesn't get overlooked. Some may prefer they default to empty strings, rather than be copies, as a design consideration too.

- Issue History
Date Modified Username Field Change
2017-10-27 20:11 zackw New Issue
2017-10-27 20:11 zackw Name => Zack Weinberg
2017-10-27 20:11 zackw Section => strftime
2017-10-27 20:11 zackw Page Number => ?
2017-10-27 20:11 zackw Line Number => ?
2017-10-27 21:02 shware_systems Note Added: 0003872
2017-10-27 21:24 zackw Note Added: 0003873
2017-10-27 22:53 shware_systems Note Added: 0003874


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker