Alex Kost <alez...@gmail.com> 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. <https://lists.gnu.org/archive/html/guix-devel/2015-07/msg00609.html> Thank you very much for your reply, :) -- Mathieu Lirzin