Message ID | 2089098891.499245.1498644359928@poczta.nazwa.pl |
---|---|
State | Superseded |
Headers |
Received: (qmail 99966 invoked by alias); 28 Jun 2017 10:06:03 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <libc-alpha.sourceware.org> List-Unsubscribe: <mailto:libc-alpha-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:libc-alpha-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 99956 invoked by uid 89); 28 Jun 2017 10:06:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-23.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY autolearn=ham version=3.3.2 spammy=Majority, month X-HELO: aev204.rev.netart.pl X-Spam-Score: 0 Date: Wed, 28 Jun 2017 12:05:59 +0200 (CEST) From: Rafal Luzynski <digitalfreak@lingonborough.com> Reply-To: Rafal Luzynski <digitalfreak@lingonborough.com> To: libc-alpha@sourceware.org Message-ID: <2089098891.499245.1498644359928@poczta.nazwa.pl> Subject: [RFC][PATCH v8 08/16] Let alternative month names be a copy of regular ones (bug 10871). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Originating-Client: com.openexchange.ox.gui.dhtml |
Commit Message
Rafal Luzynski
June 28, 2017, 10:05 a.m. UTC
If alt_mon definition is missing from a locale then let it be a copy of mon array. Majority of languages do not need this feature so let us accept the locale definition file without alt_mon and provide the same content as mon when software requires alt_mon. [BZ #10871] * locale/programs/ld-time.c: alternative month names are a copy of mon if not provided explicitly. --- locale/programs/ld-time.c | 8 ++++++++ 1 file changed, 8 insertions(+) default:
Comments
On 06/28/2017 06:05 AM, Rafal Luzynski wrote: > If alt_mon definition is missing from a locale then let it be > a copy of mon array. Majority of languages do not need this feature > so let us accept the locale definition file without alt_mon and > provide the same content as mon when software requires alt_mon. This seems a reasonable policy, but it should be documented. > + /* If alt_mon is missing then let it be a copy of mon. */ "Let it be <thing>" is unusual in English, although it does get used in formal mathematical writing. Instead /* If alt_mon was not specified, make it a copy of mon. */ zw
On Mon, 3 Jul 2017, Zack Weinberg wrote: > On 06/28/2017 06:05 AM, Rafal Luzynski wrote: > > If alt_mon definition is missing from a locale then let it be > > a copy of mon array. Majority of languages do not need this feature > > so let us accept the locale definition file without alt_mon and > > provide the same content as mon when software requires alt_mon. > > This seems a reasonable policy, but it should be documented. It's essentially *required* (by the fact that we suppose building locale definition sources that follow existing versions of POSIX, which won't use a feature that's only added in a bug tagged issue8, i.e. for the next major revision of POSIX), and putting any other text in there clearly be worse than copying mon. (It still makes sense to document this consequence of supporting existing POSIX versions, if there's somewhere suitable to document it.)
3.07.2017 23:33 Zack Weinberg <zackw@panix.com> wrote: > > > On 06/28/2017 06:05 AM, Rafal Luzynski wrote: > > If alt_mon definition is missing from a locale then let it be > > a copy of mon array. Majority of languages do not need this feature > > so let us accept the locale definition file without alt_mon and > > provide the same content as mon when software requires alt_mon. > > This seems a reasonable policy, but it should be documented. OK but where is the documentation of the locale data file? I can't find it. > > + /* If alt_mon is missing then let it be a copy of mon. */ > > "Let it be <thing>" is unusual in English, although it does get used in > formal mathematical writing. Instead > > /* If alt_mon was not specified, make it a copy of mon. */ Thank you. If I didn't say it before then I must say now that as a non-English native speaker I will need some proofreading of the natural language texts, for example the documentation. While at this, I'm not sure if I named the symbols for the abbreviated alternative month names correctly: locale data source file label: "ab_alt_mon" macros in locale/langinfo.h: _NL_ABALTMON_1 ...12, _NL_WABALTMON_1 ...12 Compare this with alternative month names (my new feature) and abbreviated month names (already existing): locale data source file label: "alt_mon", "abmon" macros in locale/langinfo.h: ALTMON_1 ...12, _NL_WALTMON_1 ...12, ABMON_1 ...12, _NL_WABMON_1 ...12 Sorry if it looks nit-picky again but I'm aware that once the decision is made it will be difficult to undo it. Regards, Rafal
Hello, It's time to get my hands dirty with this again: 4.07.2017 01:12 Joseph Myers <joseph@codesourcery.com> wrote: > > > On Mon, 3 Jul 2017, Zack Weinberg wrote: > > > On 06/28/2017 06:05 AM, Rafal Luzynski wrote: > > > If alt_mon definition is missing from a locale then let it be > > > a copy of mon array. Majority of languages do not need this feature > > > so let us accept the locale definition file without alt_mon and > > > provide the same content as mon when software requires alt_mon. > > > > This seems a reasonable policy, but it should be documented. > > It's essentially *required* (by the fact that we suppose building locale > definition sources that follow existing versions of POSIX, which won't use > a feature that's only added in a bug tagged issue8, i.e. for the next > major revision of POSIX), and putting any other text in there clearly be > worse than copying mon. (It still makes sense to document this > consequence of supporting existing POSIX versions, if there's somewhere > suitable to document it.) Zack, Joseph, please explain where should I document: * that if alt_mon is missing from the locale definition file then its contents is copied from mon (and ab_alt_mon is copied from abmon as well) * all other changes? Regards, Rafal
diff --git a/locale/programs/ld-time.c b/locale/programs/ld-time.c index 66a9e30..a6bf2b1 100644 --- a/locale/programs/ld-time.c +++ b/locale/programs/ld-time.c @@ -960,6 +960,14 @@ time_read (struct linereader *ldfile, struct localedef_t *result, lr_error (ldfile, _("\ %1$s: definition does not end with `END %1$s'"), "LC_TIME"); lr_ignore_rest (ldfile, now->tok == tok_lc_time); + + /* If alt_mon is missing then let it be a copy of mon. */ + if (!ignore_content && !time->alt_mon_defined) + { + memcpy (time->alt_mon, time->mon, sizeof (time->mon)); + memcpy (time->walt_mon, time->wmon, sizeof (time->wmon)); + time->alt_mon_defined = 1; + } return;