[glib] date: Amend some comments about the month names
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] date: Amend some comments about the month names
- Date: Wed, 28 Feb 2018 11:34:21 +0000 (UTC)
commit 2c15b903e217beca02217ad20ca3c5fefea99649
Author: Rafal Luzynski <digitalfreak lingonborough com>
Date: Wed Feb 28 12:13:15 2018 +0100
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
glib/gdate.c | 6 +++++-
glib/tests/date.c | 13 +++++++++----
2 files changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/glib/gdate.c b/glib/gdate.c
index 8ff224b60..0f30a5934 100644
--- a/glib/gdate.c
+++ b/glib/gdate.c
@@ -984,10 +984,14 @@ g_date_fill_parse_tokens (const gchar *str, GDateParseTokens *pt)
i = 1;
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:
* Catalan: "de gener", Croatian: "siječnja", Polish: "stycznia",
* 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)
{
diff --git a/glib/tests/date.c b/glib/tests/date.c
index 4c2585281..b3d78347d 100644
--- a/glib/tests/date.c
+++ b/glib/tests/date.c
@@ -187,15 +187,20 @@ test_month_names (void)
g_test_bug ("749206");
- /* This test can only work (on non-Windows platforms) if libc supports the %OB
- * (etc.) format placeholders. If it doesn’t, strftime() (and hence
+ /* This test can only work (on non-Windows platforms) if libc supports
+ * the %OB (etc.) format placeholders. If it doesn’t, strftime() (and hence
* g_date_strftime()) will return the placeholder unsubstituted.
* g_date_strftime() explicitly documents that it doesn’t provide any more
* 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
- * 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)
- g_test_skip ("libc doesn’t support alternate month names");
+ g_test_skip ("libc doesn’t support all alternative month names");
#else
#define TEST_DATE(d,m,y,f,o) \
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]