From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Lirzin Subject: Re: Texinfo in descriptions? Date: Sun, 30 Aug 2015 14:24:55 +0200 Message-ID: <87si71j754.fsf@openmailbox.org> 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> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49234) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZW1fg-0006n6-2P for guix-devel@gnu.org; Sun, 30 Aug 2015 08:25:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZW1fc-00006K-4W for guix-devel@gnu.org; Sun, 30 Aug 2015 08:25:16 -0400 In-Reply-To: <87a8t99jeo.fsf@gmail.com> (Alex Kost's message of "Sun, 30 Aug 2015 13:10:07 +0300") 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: Alex Kost Cc: guix-devel@gnu.org 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. >> - (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". > 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. > ... 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, :) -- Mathieu Lirzin