guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Website translation (was: Re: Guix beyond 1.0: let’s have a roadmap!)


From: pelzflorian (Florian Pelz)
Subject: Website translation (was: Re: Guix beyond 1.0: let’s have a roadmap!)
Date: Sun, 7 Jul 2019 18:57:22 +0200
User-agent: NeoMutt/20180716

On Sun, Jul 07, 2019 at 04:20:59PM +0200, Ludovic Courtès wrote:
> Thanks for bringing this up.  I’m very much convinced this is an
> important task, and I’m happy there’s already a team of dedicated
> volunteers who’ve worked hard translating the manual and messages!
>

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 or
> less found a way forward, so I hope we can work on it soonish.
> 

The method I use is the _ macro at
<https://pelzflorian.de/git/pelzfloriande-website/tree/haunt.scm>
(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) …) instead of plain sxml/shtml like I did.

Regards,
Florian



reply via email to

[Prev in Thread] Current Thread [Next in Thread]