View | Details | Raw Unified | Return to bug 10871 | Differences between
and this patch

Collapse All | Expand All

(-)a/ChangeLog (+9 lines)
Lines 1-6 Link Here
1
2017-11-16  Rafal Luzynski  <digitalfreak@lingonborough.com>
1
2017-11-16  Rafal Luzynski  <digitalfreak@lingonborough.com>
2
2
3
	[BZ #10871]
3
	[BZ #10871]
4
	* manual/locale.texi: Document ALTMON_1..12 constants for
5
	nl_langinfo.  Specify when to use ALTMON instead of MON.
6
	* manual/time.texi (strftime, strptime): Document GNU extension
7
	permitting O modifier with %B and %b.  Specify when to use
8
	%OB instead of %B.
9
10
2017-11-16  Rafal Luzynski  <digitalfreak@lingonborough.com>
11
12
	[BZ #10871]
4
	* locale/C-time.c: Add abbreviated alternative month names, define
13
	* locale/C-time.c: Add abbreviated alternative month names, define
5
	them as the same as abbreviated month names explicitly.
14
	them as the same as abbreviated month names explicitly.
6
	* locale/categories.def: ab_alt_mon and wide-ab_alt_mon added.
15
	* locale/categories.def: ab_alt_mon and wide-ab_alt_mon added.
(-)a/NEWS (+24 lines)
Lines 35-40 Major new features: Link Here
35
  are the same interfaces added in version 2.26 for some platforms where
35
  are the same interfaces added in version 2.26 for some platforms where
36
  this format is supported but is not the format of long double.
36
  this format is supported but is not the format of long double.
37
37
38
* Support for two grammatical forms of month name has been added.
39
  In a call to strftime, the "%B" and "%b" format specifiers will now
40
  produce the grammatical form required when the month is used as part
41
  of a complete date.  New "%OB" and "%Ob" specifiers produce the form
42
  required when the month is named by itself.  For instance, in Greek
43
  and in many Slavic and Baltic languages, "%B" will produce the month
44
  in genitive case, and "%OB" will produce the month in nominative case.
45
46
  In a call to strptime, "%B", "%b", "%h", "%OB", "%Ob", and "%Oh"
47
  are all valid and will all accept any known form of month
48
  name---standalone or complete, abbreviated or full.  In a call to
49
  nl_langinfo, the query constants MON_1..12 and ABMON_1..12 return
50
  the strings used by "%B" and "%b", respectively.  New query
51
  constants ALTMON_1..12 and _NL_ABALTMON_1..12 return the strings
52
  used by "%OB" and "%Ob", respectively.
53
54
  In a locale definition file, use "alt_mon" and "ab_alt_mon" to
55
  define the strings for %OB and %Ob, respectively; these have the
56
  same syntax as "mon" and "ab_mon".
57
58
  This feature is currently a GNU extension, but it is expected to
59
  be added to the next revision of POSIX, and it is also already
60
  available on some BSD-derived operating systems.
61
38
Deprecated and removed features, and other changes affecting compatibility:
62
Deprecated and removed features, and other changes affecting compatibility:
39
63
40
* On GNU/Linux, the obsolete Linux constant PTRACE_SEIZE_DEVEL is no longer
64
* On GNU/Linux, the obsolete Linux constant PTRACE_SEIZE_DEVEL is no longer
(-)a/manual/locale.texi (-3 / +23 lines)
Lines 923-929 corresponds to Sunday. Link Here
923
@itemx DAY_5
923
@itemx DAY_5
924
@itemx DAY_6
924
@itemx DAY_6
925
@itemx DAY_7
925
@itemx DAY_7
926
Similar to @code{ABDAY_1} etc., but here the return value is the
926
Similar to @code{ABDAY_1} etc.,@: but here the return value is the
927
unabbreviated weekday name.
927
unabbreviated weekday name.
928
@item ABMON_1
928
@item ABMON_1
929
@itemx ABMON_2
929
@itemx ABMON_2
Lines 937-943 unabbreviated weekday name. Link Here
937
@itemx ABMON_10
937
@itemx ABMON_10
938
@itemx ABMON_11
938
@itemx ABMON_11
939
@itemx ABMON_12
939
@itemx ABMON_12
940
The return value is abbreviated name of the month.  @code{ABMON_1}
940
The return value is the abbreviated name of the month, in the grammatical
941
form used when the month forms part of a complete date.  @code{ABMON_1}
941
corresponds to January.
942
corresponds to January.
942
@item MON_1
943
@item MON_1
943
@itemx MON_2
944
@itemx MON_2
Lines 951-958 corresponds to January. Link Here
951
@itemx MON_10
952
@itemx MON_10
952
@itemx MON_11
953
@itemx MON_11
953
@itemx MON_12
954
@itemx MON_12
954
Similar to @code{ABMON_1} etc., but here the month names are not abbreviated.
955
Similar to @code{ABMON_1} etc.,@: but here the month names are not abbreviated.
955
Here the first value @code{MON_1} also corresponds to January.
956
Here the first value @code{MON_1} also corresponds to January.
957
@item ALTMON_1
958
@itemx ALTMON_2
959
@itemx ALTMON_3
960
@itemx ALTMON_4
961
@itemx ALTMON_5
962
@itemx ALTMON_6
963
@itemx ALTMON_7
964
@itemx ALTMON_8
965
@itemx ALTMON_9
966
@itemx ALTMON_10
967
@itemx ALTMON_11
968
@itemx ALTMON_12
969
Similar to @code{MON_1} etc.,@: but here the month names are in the grammatical
970
form used when the month is named by itself.  The @code{strftime} functions
971
use these month names for the format specifier @code{OB}.
972
973
Note that not all languages need two different forms of the month names,
974
so the strings returned for @code{MON_@dots{}} and @code{ALTMON_@dots{}}
975
may or may not be the same, depending on the locale.
956
@item AM_STR
976
@item AM_STR
957
@itemx PM_STR
977
@itemx PM_STR
958
The return values are strings which can be used in the representation of time
978
The return values are strings which can be used in the representation of time
(-)a/manual/time.texi (-9 / +27 lines)
Lines 1346-1353 example, @code{%Ex} might yield a date format based on the Japanese Link Here
1346
Emperors' reigns.
1346
Emperors' reigns.
1347
1347
1348
@item O
1348
@item O
1349
Use the locale's alternate numeric symbols for numbers.  This modifier
1349
With all format specifiers that produce numbers: use the locale's
1350
applies only to numeric format specifiers.
1350
alternate numeric symbols.
1351
1352
With @code{%B} and @code{%b}: use the grammatical form for month names
1353
that is appropriate when the month is named by itself, rather than
1354
the form that is appropriate when the month is used as part of a
1355
complete date.  This is a GNU extension.
1351
@end table
1356
@end table
1352
1357
1353
If the format supports the modifier but no alternate representation
1358
If the format supports the modifier but no alternate representation
Lines 1365-1377 The abbreviated weekday name according to the current locale. Link Here
1365
The full weekday name according to the current locale.
1370
The full weekday name according to the current locale.
1366
1371
1367
@item %b
1372
@item %b
1368
The abbreviated month name according to the current locale.
1373
The abbreviated month name according to the current locale, in the
1374
grammatical form used when the month is part of a complete date.
1375
As a GNU extension, the @code{O} modifier can be used (@code{%Ob})
1376
to get the grammatical form used when the month is named by itself.
1369
1377
1370
@item %B
1378
@item %B
1371
The full month name according to the current locale.
1379
The full month name according to the current locale, in the
1380
grammatical form used when the month is part of a complete date.
1381
As a GNU extension, the @code{O} modifier can be used (@code{%OB})
1382
to get the grammatical form used when the month is named by itself.
1372
1383
1373
Using @code{%B} together with @code{%d} produces grammatically
1384
Note that not all languages need two different forms of the month
1374
incorrect results for some locales.
1385
names, so the text produced by @code{%B} and @code{%OB}, and by
1386
@code{%b} and @code{%Ob}, may or may not be the same, depending on
1387
the locale.
1375
1388
1376
@item %c
1389
@item %c
1377
The preferred calendar time representation for the current locale.
1390
The preferred calendar time representation for the current locale.
Lines 1778-1785 the full name. Link Here
1778
@item %b
1791
@item %b
1779
@itemx %B
1792
@itemx %B
1780
@itemx %h
1793
@itemx %h
1781
The month name according to the current locale, in abbreviated form or
1794
A month name according to the current locale.  All three specifiers
1782
the full name.
1795
will recognize both abbreviated and full month names.  If the
1796
locale provides two different grammatical forms of month names,
1797
all three specifiers will recognize both forms.
1798
1799
As a GNU extension, the @code{O} modifier can be used with these
1800
specifiers; it has no effect, as both grammatical forms of month
1801
names are recognized anyway.
1783
1802
1784
@item %c
1803
@item %c
1785
The date and time representation for the current locale.
1804
The date and time representation for the current locale.
1786
- 

Return to bug 10871