mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-15 04:05:11 +01:00
date: Amend some comments about the month names
Some source code comments amended to avoid possible future confusion. It has been explained that a month name is used in a genitive case only if it is required by the language rules. Also it has been explained that %OB is also supported by other platforms (e.g., BSD) but for this test we are focused on glibc 2.27 vs. Windows. https://bugzilla.gnome.org/show_bug.cgi?id=749206
This commit is contained in:
parent
f5d1ac0d40
commit
2c15b903e2
@ -984,10 +984,14 @@ g_date_fill_parse_tokens (const gchar *str, GDateParseTokens *pt)
|
|||||||
i = 1;
|
i = 1;
|
||||||
while (i < 13)
|
while (i < 13)
|
||||||
{
|
{
|
||||||
/* Here month names will be in a genitive case.
|
/* Here month names may be in a genitive case if the language
|
||||||
|
* grammatical rules require it.
|
||||||
* Examples of how January may look in some languages:
|
* Examples of how January may look in some languages:
|
||||||
* Catalan: "de gener", Croatian: "siječnja", Polish: "stycznia",
|
* Catalan: "de gener", Croatian: "siječnja", Polish: "stycznia",
|
||||||
* Upper Sorbian: "januara".
|
* Upper Sorbian: "januara".
|
||||||
|
* Note that most of the languages can't or don't use the the
|
||||||
|
* genitive case here so they use nominative everywhere.
|
||||||
|
* For example, English always uses "January".
|
||||||
*/
|
*/
|
||||||
if (long_month_names[i] != NULL)
|
if (long_month_names[i] != NULL)
|
||||||
{
|
{
|
||||||
|
@ -187,15 +187,20 @@ test_month_names (void)
|
|||||||
|
|
||||||
g_test_bug ("749206");
|
g_test_bug ("749206");
|
||||||
|
|
||||||
/* This test can only work (on non-Windows platforms) if libc supports the %OB
|
/* This test can only work (on non-Windows platforms) if libc supports
|
||||||
* (etc.) format placeholders. If it doesn’t, strftime() (and hence
|
* the %OB (etc.) format placeholders. If it doesn’t, strftime() (and hence
|
||||||
* g_date_strftime()) will return the placeholder unsubstituted.
|
* g_date_strftime()) will return the placeholder unsubstituted.
|
||||||
* g_date_strftime() explicitly documents that it doesn’t provide any more
|
* g_date_strftime() explicitly documents that it doesn’t provide any more
|
||||||
* format placeholders than the system strftime(), so we should skip the test
|
* format placeholders than the system strftime(), so we should skip the test
|
||||||
* in that case. If people need %OB support, they should depend on a suitable
|
* in that case. If people need %OB support, they should depend on a suitable
|
||||||
* version of libc, or use g_date_time_format(). */
|
* version of libc, or use g_date_time_format(). Note: a test for a support
|
||||||
|
* of _NL_ABALTMON_* is not strictly the same as checking for %OB support.
|
||||||
|
* Some platforms (BSD, OS X) support %OB while _NL_ABALTMON_* and %Ob
|
||||||
|
* are supported only by glibc 2.27 and newer. But we don’t care about BSD
|
||||||
|
* here, the aim of this test is to make sure that our custom implementation
|
||||||
|
* for Windows works the same as glibc 2.27 native implementation. */
|
||||||
#if !defined(HAVE_LANGINFO_ABALTMON) && !defined(G_OS_WIN32)
|
#if !defined(HAVE_LANGINFO_ABALTMON) && !defined(G_OS_WIN32)
|
||||||
g_test_skip ("libc doesn’t support alternate month names");
|
g_test_skip ("libc doesn’t support all alternative month names");
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#define TEST_DATE(d,m,y,f,o) \
|
#define TEST_DATE(d,m,y,f,o) \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user