From patchwork Mon May 26 05:51:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marko Myllynen X-Patchwork-Id: 352333 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id F0927140081 for ; Mon, 26 May 2014 15:51:24 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:reply-to:mime-version:to :cc:subject:content-type:content-transfer-encoding; q=dns; s= default; b=ulL9tuSrStvi6ZPurAvnq/DRinpsEHcC0GoE42qwH2mJb1rbBlnxy 1ai3giljgwlQTHVpKYDwTwcL3EFvYrGQJ9mkxy/8gmZvLuj7xjaiAks20abivjX7 QW8QYc/9I4AVutM8yvLc4lqntvvE79ZRzOKRtvUUqnmBIiB2EWt3IY= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:message-id:date:from:reply-to:mime-version:to :cc:subject:content-type:content-transfer-encoding; s=default; bh=ymhO40zQkMXl4rJu71iEBcWpOhc=; b=L3ajrbp1TW6KNJkUzVh24wmkCLMm QHc1Wn/gYLi0+W7qQbWxujtJF4hGjIBDZEG4Z2ASiSTHEB8hNA0jw5yNSlooCqzq jMzd76ayR/I5qu/u4alM4mfnVoFaUg38mDrsRC7Erwa07M/b9kxPoWvMaYFkJUvZ 7fx4tWETEW16IJ4= Received: (qmail 23033 invoked by alias); 26 May 2014 05:51:18 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 23008 invoked by uid 89); 26 May 2014 05:51:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Message-ID: <5382D64A.9020404@redhat.com> Date: Mon, 26 May 2014 08:51:06 +0300 From: Marko Myllynen Reply-To: myllynen@redhat.com User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 MIME-Version: 1.0 To: "mtk.manpages" CC: Petr Baudis , GNU C Library , linux-man@vger.kernel.org, libc-locales@sourceware.org Subject: [PATCH] locale.5: document glibc conventions regarding days and week Hi, let's document glibc de facto current interpretation of handling weekdays also on the locale(5) man page, based on Petr's research in the past, currently documented in the glibc Locales wiki page. From fc28ef135148e0b6c6546666422cc9999e64bfc3 Mon Sep 17 00:00:00 2001 From: Marko Myllynen Date: Mon, 26 May 2014 08:42:23 +0300 Subject: [PATCH] locale.5: document glibc conventions regarding days and week Based on existing practice and glibc community wiki page at https://sourceware.org/glibc/wiki/Locales --- man5/locale.5 | 69 +++++++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 53 insertions(+), 16 deletions(-) -- 1.7.1 Thanks, diff --git a/man5/locale.5 b/man5/locale.5 index 2ad8e59..1b0f57d 100644 --- a/man5/locale.5 +++ b/man5/locale.5 @@ -966,14 +966,14 @@ followed by a list of abbreviated names of the days of the week. The list starts with the first day of the week as specified by .I week -(Sunday by default). +(Sunday by default). See NOTES. .TP .I day followed by a list of names of the days of the week. The list starts with the first day of the week as specified by .I week -(Sunday by default). +(Sunday by default). See NOTES. .TP .I abmon followed by a list of abbreviated month names. @@ -1011,16 +1011,7 @@ Regarding the start of the week, shall be used for Sunday and .B 19971201 shall be used for Monday. -Thus, countries using -.B 19971130 -should have local Sunday name as the first day in the -.I day -list, -while countries using -.B 19971201 -should have Monday translation as the first item in the -.I day -list. +See NOTES. .TP .IR first_weekday " (since glibc 2.2)" followed by the number of the first day from the @@ -1031,12 +1022,12 @@ The default value of corresponds to either Sunday or Monday depending on the value of the second .I week -list item. +list item. See NOTES. .TP .IR first_workday " (since glibc 2.2)" followed by the number of the first working day from the .I day -list. +list. See NOTES. .TP .I cal_direction .\" from localedata/locales/uk_UA @@ -1067,10 +1058,56 @@ definition ends with the string \(em database for the current locale setting of that category .br /usr/lib/nls/charmap/* \(em charmap-files +.SH NOTES +The collective GNU C library community wisdom regarding +.IR day , +.IR week , +and +.I first_weekday +states at +https://sourceware.org/glibc/wiki/Locales +the following: +.PP +The value of the second +.I week +list item specifies the base of the +.I day +list. +.PP +.I first_weekday +specifies the offset of the first day-of-week in the +.I day +list. +.PP +For compatibility reasons, all glibc locales should set the value of the +second +.I week +list item to +.B 19971130 +(Sunday) and base the +.I day +list appropriately, and set +.I first_weekday +to +.B 1 +or +.BR 2 , +depending on whether the week actually starts on Sunday or Monday +for the locale. +.PP +Thus, a locale which week starts on Monday +.I first_weekday +and +.I first_workday +should be set to +.B 2 +and +.I abday +and +.I day +should have the locale representation of Sunday as the first list item. .SH CONFORMING TO POSIX.2, ISO/IEC 14652. -.SH BUGS -This manual page isn't complete. .\" .SH AUTHOR .\" Jochen Hein (Hein@Student.TU-Clausthal.de) .SH SEE ALSO