From mboxrd@z Thu Jan 1 00:00:00 1970 From: "pelzflorian (Florian Pelz)" Subject: Website translation (was: Re: Guix beyond 1.0: =?utf-8?B?bGV04oCZ?= =?utf-8?Q?s?= have a roadmap!) Date: Sun, 7 Jul 2019 18:57:22 +0200 Message-ID: <20190707165722.we3q5jne7a3wnvq4@pelzflorian.localdomain> References: <82379e4b458703ebd2a0b000b2acc46c@autoproduzioni.net> <87sgri9b90.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:48246) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hkATf-0008Fk-OC for guix-devel@gnu.org; Sun, 07 Jul 2019 12:57:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hkATe-0007o4-EV for guix-devel@gnu.org; Sun, 07 Jul 2019 12:57:27 -0400 Content-Disposition: inline In-Reply-To: <87sgri9b90.fsf@gnu.org> 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" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org, matias_jose_seco@autoproduzioni.net On Sun, Jul 07, 2019 at 04:20:59PM +0200, Ludovic Court=C3=A8s wrote: > Thanks for bringing this up. I=E2=80=99m very much convinced this is a= n > important task, and I=E2=80=99m happy there=E2=80=99s already a team of= dedicated > volunteers who=E2=80=99ve worked hard translating the manual and messag= es! > Yes. :) > The next obvious step is to translate the web site. There were open > questions as to how to do it, but I think Julien and Florian had more o= r > less found a way forward, so I hope we can work on it soonish. >=20 The method I use is the _ macro at (Guix sensibly would call such a macro G_). It simply calls setlocale once for each string that needs to be translated. This has better runtime performance than using libgettextpo via nyacc unless there are a very great number of strings. The best performance could be gained by reading the compiled MO file directly, but then Guile code would need to be written for reading MO files, also performance does not matter that much when building a static website. Ricardo Wurmus thankfully recommended using sxpath for formatting, see what I called __ in my code. Note that many improvements could be made in my code, e.g. current-lingua could be a parameter, so (I hope) it can be avoided to change various parts of Haunt to accept procedures like (lambda (current-lingua) =E2=80=A6) instead of plain sxml/shtml like I di= d. Regards, Florian