From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Kost Subject: Re: Texinfo in descriptions? Date: Sun, 30 Aug 2015 18:19:24 +0300 Message-ID: <874mjgajnn.fsf@gmail.com> References: <87wpy0nygt.fsf@gmail.com> <87y4ige2ux.fsf@openmailbox.org> <87wpy0t83c.fsf@gnu.org> <87r3o7pz3h.fsf@openmailbox.org> <87y4ietrdz.fsf_-_@gnu.org> <874mkx8a5o.fsf@openmailbox.org> <87wpxs9ux0.fsf@gnu.org> <87h9ov51j9.fsf@gnu.org> <87a8tcfnox.fsf@openmailbox.org> <87a8t99jeo.fsf@gmail.com> <87si71j754.fsf@openmailbox.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:46409) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZW4OK-00045A-Su for guix-devel@gnu.org; Sun, 30 Aug 2015 11:19:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZW4OF-0001q8-VA for guix-devel@gnu.org; Sun, 30 Aug 2015 11:19:32 -0400 Received: from mail-la0-x229.google.com ([2a00:1450:4010:c03::229]:34890) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZW4OF-0001ov-CA for guix-devel@gnu.org; Sun, 30 Aug 2015 11:19:27 -0400 Received: by lanb10 with SMTP id b10so22527483lan.2 for ; Sun, 30 Aug 2015 08:19:22 -0700 (PDT) In-Reply-To: <87si71j754.fsf@openmailbox.org> (Mathieu Lirzin's message of "Sun, 30 Aug 2015 14:24:55 +0200") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: Mathieu Lirzin Cc: guix-devel@gnu.org Mathieu Lirzin (2015-08-30 15:24 +0300) wrote: > Alex Kost writes: > >> Mathieu Lirzin (2015-08-28 00:04 +0300) wrote: >> >>> Here is a first attempt. It doesn't feel right to me but fornow I don't >>> know what to do without duplicating code or reorganizing the world. The >>> problem is that translations are handle in (guix ui) so we need to >>> regenerate texi->plain-text. >> >> I don't understand what you mean by 'regenerate texi->plain-text'. > > Maybe the correct expression should have been "reiterate > texi->plain-text". What I meant was that the process of converting from > texinfo to plain-text need to be done in (guix ui) too, because > translated package description are texinfo fragment. Ah, now I understand what you mean. >>> - (define (description->recutils str) >>> - (let ((str (P_ str))) >>> + (define (description->recutils str) >>> + (let ((str (texi->plain-text (P_ str)))) >> >> IIUC there is no need to use 'texi->plain-text' here. Instead you can >> replace 'package-description' with 'package-description-string' in the >> body of 'package->recutils'. Or did I miss anything? > > That was my first solution before realizing that this will lead to a > problem that this unrealistic example illustrates. > > ;; with fr_FR.UTF-8 locale > > (package-description foo) > => "socks @code{foo}." > > (package-description-string foo) > => "socks `foo'.\n\n" > > (N_ (package-description foo)) > => "chaussettes @code{foo}." > > (N_ (package-description-string foo)) > => "socks `foo'.\n\n" > > In the last evaluation gettext was unable to find the translated string > corresponding to msgid "socks `foo'.\n\n". Now I see, thanks for the explanation! Honestly I don't know how/when/where this translation stuff happens, so I don't have any useful comments. >> Also I think the same replacement should be done in (guix scripts >> lint) ... > > I think more can be done in (guix scripts lint). For example checking > if invoking 'package-description-string' fails which would indicate that > the markup is not correctly used. Indeed. >> ... and (guix scripts package). > > This script uses 'package-description' to search in it. IIUC it was > suggested by Ludo to search using the raw Texinfo fragment and to > display using the plain-text version. > > > Thank you very much for your reply, :) It wasn't a very useful reply, isn't it :-) Sorry for the noize. -- Alex