From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:470:142:3::10]:56422) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hdvZw-00015U-HF for guix-patches@gnu.org; Thu, 20 Jun 2019 07:50:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hdvZt-0006tT-9p for guix-patches@gnu.org; Thu, 20 Jun 2019 07:50:08 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:34434) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hdvZr-0006rQ-7J for guix-patches@gnu.org; Thu, 20 Jun 2019 07:50:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hdvZq-000541-Vp for guix-patches@gnu.org; Thu, 20 Jun 2019 07:50:03 -0400 Subject: [bug#35790] [PATCH] scripts: lint: Handle warnings with a record type. Resent-Message-ID: From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20190518093206.22069-1-mail@cbaines.net> <878suz27ke.fsf@gnu.org> <87ef4dxgvl.fsf@cbaines.net> <87pnnpj15u.fsf@gnu.org> <87h88pu1cc.fsf@cbaines.net> Date: Thu, 20 Jun 2019 13:49:42 +0200 In-Reply-To: <87h88pu1cc.fsf@cbaines.net> (Christopher Baines's message of "Sun, 16 Jun 2019 14:05:55 +0100") Message-ID: <875zp0lbmx.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: Christopher Baines Cc: 35790@debbugs.gnu.org Christopher Baines skribis: > Ludovic Court=C3=A8s writes: > >> A possibility would be to pass =E2=80=98make-warning=E2=80=99 a =E2=80= =98format=E2=80=99 list instead of >> a single string: >> >> (make-warning package (list (G_ "~a is bad") 'something) =E2=80=A6) >> >> That=E2=80=99d solve the problem but it=E2=80=99d have to be packaged ni= cely to avoid >> having too much boilerplate. > > I've now made an attempt at doing this, I've kept the changes separate > for now, and I've sent them as a separate patch. Nice! > I'm not sure I've got it working yet though. I've been testing with the > zile package, as there's a lint warning for the synopsis, however, if I > try to set the language to Spanish, it isn't translated. > > I've also tried checking the existing behaviour, but that doesn't seem > to work either: > > =E2=86=92 LC_MESSAGES=3Des_ES LANGUAGE=3Des_ES LC_ALL=3Des_ES ./pre-ins= t-env guile > ... > scheme@(guile-user)> (use-modules (guix i18n)) > scheme@(guile-user)> (G_ "~a: ~a: proposed synopsis: ~s~%") > $1 =3D "~a: ~a: proposed synopsis: ~s~%" > > Many of the translated strings won't match up with the code now as I've > changed them. I did try changing the Spanish translation for this > proposed synopsis message to match the code, but it didn't seem to work. > > Any ideas on what's going on here? You need to tell libc (gettext) where to look for message catalogs. This is normally done in scripts/guix: (bindtextdomain "guix" "@localedir@") For testing purposes, you can probably do: (bindtextdomain "guix" "/run/current-system/profile/share/locale") HTH! Ludo=E2=80=99.