[website] translations

  • Done
  • quality assurance status badge
Details
12 participants
  • Bengt Richter
  • ng0
  • Dmitry Alexandrov
  • Julien Lepiller
  • Ludovic Courtès
  • Christopher Baines
  • Tobias Geerinckx-Rice
  • ng0
  • pelzflorian (Florian Pelz)
  • sirgazil
  • Vagrant Cascadian
  • zimoun
Owner
unassigned
Submitted by
ng0
Severity
normal
N
(address . bug-guix@gnu.org)
20170329154040.ddscahwp2agknihb@abyayala
One thing I like about the template of https://taler.netis the usage of
javascript free translations of text (jinja2 is used), easy to select
and write.
I think translations of web sites are useful, necessary and important.
We must provide this in the long run on the Guix web site aswell.
N
(address . 26302@debbugs.gnu.org)
20170329161340.kxiixggwjsssh5hh@abyayala
ng0 transcribed 0.4K bytes:
Toggle quote (7 lines)
> One thing I like about the template of https://taler.netis the usage of
> javascript free translations of text (jinja2 is used), easy to select
> and write.
> I think translations of web sites are useful, necessary and important.
> We must provide this in the long run on the Guix web site aswell.
>

"Must" sounds very strong, but I think we should do this for the all
parts possible of the website, starting with the basic website.

Whoever has an idea how to approach this using Guile should pick this
task up.
N
(address . 26302@debbugs.gnu.org)
20170415120024.f5hb7kw5vzqdogia@abyayala
ng0 transcribed 0.7K bytes:
Toggle quote (15 lines)
> ng0 transcribed 0.4K bytes:
> > One thing I like about the template of https://taler.net is the usage of
> > javascript free translations of text (jinja2 is used), easy to select
> > and write.
> > I think translations of web sites are useful, necessary and important.
> > We must provide this in the long run on the Guix web site aswell.
> >
>
> "Must" sounds very strong, but I think we should do this for the all
> parts possible of the website, starting with the basic website.
>
> Whoever has an idea how to approach this using Guile should pick this
> task up.
>

Update on this bug, as I just had some insights in an OStatus Federation
thread with Rafa? Pi?tkowski.

We make use of SXML.
XML has native support for translations, but it's not "user friendly".
The goal here would be to simply the way translations are done.
Here is one way how you can achieve native xml translations:

Our newsposts are in Markdown.
Does Commonmark (what we use as far as I understand Haunt) support
extensions?
Otherwise we can write one new "post" per translation and have a
dialogue / menu to switch the language.


--
N
(address . 26302@debbugs.gnu.org)
20170415122614.ag3bbkpixtpc7457@abyayala
ng0 transcribed 1.4K bytes:
Toggle quote (38 lines)
> ng0 transcribed 0.7K bytes:
> > ng0 transcribed 0.4K bytes:
> > > One thing I like about the template of https://taler.net is the usage of
> > > javascript free translations of text (jinja2 is used), easy to select
> > > and write.
> > > I think translations of web sites are useful, necessary and important.
> > > We must provide this in the long run on the Guix web site aswell.
> > >
> >
> > "Must" sounds very strong, but I think we should do this for the all
> > parts possible of the website, starting with the basic website.
> >
> > Whoever has an idea how to approach this using Guile should pick this
> > task up.
> >
>
> Update on this bug, as I just had some insights in an OStatus Federation
> thread with Rafa? Pi?tkowski.
>
> We make use of SXML.
> XML has native support for translations, but it's not "user friendly".
> The goal here would be to simply the way translations are done.
> Here is one way how you can achieve native xml translations:
> https://www.xml.com/pub/a/2004/01/07/xmltm.html
>
> Our newsposts are in Markdown.
> Does Commonmark (what we use as far as I understand Haunt) support
> extensions?
> Otherwise we can write one new "post" per translation and have a
> dialogue / menu to switch the language.
>
>
> --
> PGP and more: https://people.pragmatique.xyz/ng0/
>
>
>

This
suggstest that at least with ReStructuredText (and Sphinx) we could
achieve something, so in case Commonmark doesn't work out,
ReStructuredText is an option.

--
L
L
Ludovic Courtès wrote on 31 Jul 2017 23:11
(name . ng0)(address . contact.ng0@cryptolab.net)(address . 26302@debbugs.gnu.org)
8760e8l3bd.fsf@gnu.org
Hi,

ng0 <contact.ng0@cryptolab.net> skribis:

Toggle quote (6 lines)
> One thing I like about the template of https://taler.netis the usage of
> javascript free translations of text (jinja2 is used), easy to select
> and write.
> I think translations of web sites are useful, necessary and important.
> We must provide this in the long run on the Guix web site aswell.

FWIW I agree.

I wouldn’t want to use JS for that, though.

It may be that the simplest solution would be to use Gettext since,
after all, the web site is a regular Scheme program.

I would welcome work in this direction!

Ludo’.
N
(name . Ludovic Courtès)(address . ludo@gnu.org)
20170731215448.6zsu2qcfykuzbcd2@abyayala
Ludovic Courtès transcribed 1.1K bytes:
Toggle quote (21 lines)
> Hi,
>
> ng0 <contact.ng0@cryptolab.net> skribis:
>
> > One thing I like about the template of https://taler.net is the usage of
> > javascript free translations of text (jinja2 is used), easy to select
> > and write.
> > I think translations of web sites are useful, necessary and important.
> > We must provide this in the long run on the Guix web site aswell.
>
> FWIW I agree.
>
> I wouldn’t want to use JS for that, though.
>
> It may be that the simplest solution would be to use Gettext since,
> after all, the web site is a regular Scheme program.
>
> I would welcome work in this direction!
>
> Ludo’.

I made some progress here, but only in theory and discussion.
It might take some time until I can write it down, and my approach
to websites and their translations might not be what we as Guix would want.

I'll update this with more info, I'll basically intend to use my own
project website as a testing ground for this with the version after
the current work in progress version.
--
ng0
GnuPG: A88C8ADD129828D7EAC02E52E22F9BBFEE348588
-----BEGIN PGP SIGNATURE-----

iQIzBAABCgAdFiEEqIyK3RKYKNfqwC5S4i+bv+40hYgFAll/pygACgkQ4i+bv+40
hYg+thAAmV+tXe+t62RzsM2DWBQCnJLgErwLiWpxFtkbdNL7FGhiPXO4QL3IfdGl
jVkOhxs4xtk0zXzCKQeMTO3FOdjX4lRi/wewgbG6iff4B8Tqzy9cWYBJErIVO0OM
pWrDkcsKC2a6D27GWhVDjaXPDKxgd/tnpb4PBlQtttB/VwEs6IOu0ZzhRpL5vN/f
zKRRdRiIr9iBIPNwf1JQI8dNfwVP/MLpt2s8f6dW5NSAl1k190C+OXKFE9crSC5R
EUGGYplE6ZPymmd/A5BC5MoA9/Ll2aeIeXR37pVWG1McxnOd2UO3qf0qs6IftHR5
tDnIXk50LDOiTWRgrsnZwtDa07SsgbBhbmJasawKvxxyAj9ULXOhkVln4upcDsiQ
JCsuwhcO4sCapuShT9Tw2IbDUaK3vPiTUHAVQ3TUlAoRxXab98JK7D+BeG5l5Rkb
ngVjL7tKTRYq2tYB3vAMcOU2F0xYpTjKGQ8K6/hTjJYmyKOP69EXul3GHGDKXJkT
nOLwIZqe0phKlp3bpGn0AOPqhel7sUofhtYMk2108HP0E3vq6/kjwC8VJBLG+BHo
CXrSi7IZPvYbXQxRMCLokI38C1jpv6h8ETOL7SGM6LbzZshbMsnA3DAH0J7B9QYX
14tjcqf22fEgM2ZE91JuqFTW6VBT8XktFUH0wO0sP9BoUMfwcwc=
=thlg
-----END PGP SIGNATURE-----


P
P
pelzflorian (Florian Pelz) wrote on 6 Sep 2019 16:25
(name . Mark H Weaver)(address . mhw@netris.org)
20190906142548.4crfjgvxilgalgrs@pelzflorian.localdomain
Hello!

I think it is better to continue here with the discussion from


Find attached preliminary patches that add a working website
translation system to guix-artwork. Of course, the patches should
*not* be pushed before there is a working nginx configuration with
appropriate redirects. (Except the first three patches; I do not
understand how you could even build the website without my first
patch?)


I am not entirely certain in my use of macros, but believe it is
right. See my discussion with Mark H Weaver at


In my patches, I have used spaces for indentation. Most previous
website code used a mix of tabs and spaces, like in emacs’ strange
default setting. If you want, I can tabify my patches. I cannot see
any reason for using mixed tabs+spaces with emacs-style Lisp
indentation though.


For redirecting previous URLs based on the HTTP Accept-Language
header, there is
It could be added to nginx.

I do not know what the new URLs should be. After reading
I now understand that there indeed should be separate URLs for each
language and Accept-Language headers are not sufficient. However,
Ludo’s idea of translating URLs including the basename
i.e. /help.html as /es/ayuda.html, leads to questions about the
implementation such as what Jelle Licht mentioned
We can do whatever we want, so let’s do what is best. What do you
think, /es/ayuda/ or /es/help/ or something else?

For ayuda, we would then need to make `guix build -f .guix.scm` build
with the static website also some kind of association list for
redirects that is readable by nginx lua code or whatever (could there
be guile plugins for nginx??).

We can do /es/help/ now and make /es/ayuda/ later.

Also, using the language code alone will no longer suffice once we
have two /zh/help/ for mainland and traditional-character Chinese.


One of the attached patches adds a PO file with a German translation
that was needed for testing purposes; of course translations should
normally be submitted via the Translation Project. The patch need not
be applied; do as you see fit.


With respect to the help mailing list blurbs on the website, my code
gives priority to the PO file translation of the blurb and uses the
previous hard-coded translations as a fall-back. I would keep the
blurbs this way until all are part of a PO file at the Translation
Project.

The Chinese language blurb is written in traditional Chinese
characters. I believe there never was a decision on
so I leave the language code as “zh” for now, even though someone may
add a “zh-cn” too.

I transferred the German blurb by Andreas Enge in
to the new German PO file, but changed the spelling “auf deutsch” to
the official orthography as per the official word list 2017 because
the German Translation Project team has decided on following official
orthography instead of allowing for personal style (but thank you to
Andreas Enge for showing me belleslettres who may well be right).


Next, I will look at adding a locale selection dropdown similar to the
About dropdown that is on the website now. I would like to make both
About and locale selection be of visible size dependent on whether a
hidden <input type=radio> or an <input type=checkbox> is checked (the
latter would allow multiple dropdowns to be shown simultaneously). A
probably insufficient, too new alternative is <details> (?). I would
like to make the dropdowns keyboard-navigable (reachable using only
the tab key and no mouse/pointing device) in a way similar to what
happens when pressing tab on https://en.wiktionary.org/wiki/geeks.
This would be incompatible with <details>, I believe.


Regards,
Florian
From fa96d7ec0a71dfea4b5c2cae8bdfb2a8f27f678d Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Thu, 18 Jul 2019 10:22:44 +0200
Subject: [PATCH 1/6] website: Use needed modules in posts.

* website/posts/back-from-seagl-2018.sxml: Use needed modules.
* website/posts/guix-at-libreplanet-2016.sxml: Use needed modules.
---
website/posts/back-from-seagl-2018.sxml | 3 ++-
website/posts/guix-at-libreplanet-2016.sxml | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)

Toggle diff (27 lines)
diff --git a/website/posts/back-from-seagl-2018.sxml b/website/posts/back-from-seagl-2018.sxml
index c5ad0a9..958369f 100644
--- a/website/posts/back-from-seagl-2018.sxml
+++ b/website/posts/back-from-seagl-2018.sxml
@@ -1,6 +1,7 @@
(begin
(use-modules (apps base templates components)
- (srfi srfi-19))
+ (apps base utils)
+ (srfi srfi-19))
`((title . "Back from SeaGL 2018")
(author . "Chris Marusich")
(date . ,(make-date 0 0 0 0 10 12 2018 -28800))
diff --git a/website/posts/guix-at-libreplanet-2016.sxml b/website/posts/guix-at-libreplanet-2016.sxml
index 8581be4..252def3 100644
--- a/website/posts/guix-at-libreplanet-2016.sxml
+++ b/website/posts/guix-at-libreplanet-2016.sxml
@@ -1,5 +1,6 @@
(begin
- (use-modules (srfi srfi-19))
+ (use-modules (srfi srfi-19)
+ (apps base templates components))
`((title . "Guix at LibrePlanet 2016")
(author . "David Thompson")
(date unquote (make-date 0 0 0 0 15 3 2016 3600))
--
2.23.0
From afd68ec639494320b5248b75315174d2dc1f7adb Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Sat, 31 Aug 2019 11:52:31 +0200
Subject: [PATCH 2/6] website: Fix typing mistake.

* website/apps/base/templates/contribute.scm (contribute-t):
Add missing word.
---
website/apps/base/templates/contribute.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/website/apps/base/templates/contribute.scm b/website/apps/base/templates/contribute.scm
index 6c4787f..4d68e87 100644
--- a/website/apps/base/templates/contribute.scm
+++ b/website/apps/base/templates/contribute.scm
@@ -201,7 +201,7 @@
(h3 (@ (id "testing")) "Test and Bug Reports")
(p
"Install the software and send feedback to the community
- about your experience. Help the project reporting bugs.")
+ about your experience. Help the project by reporting bugs.")
(p
"Before reporting a bug, please check whether the bug is
already "
--
2.23.0
From 3bd446c4242f278123a113bd65ef2bf302a29afd Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Sat, 31 Aug 2019 21:00:29 +0200
Subject: [PATCH 3/6] website: Fix typo.

* website/apps/base/templates/security.scm (security-t): Fix typo.
---
website/apps/base/templates/security.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/website/apps/base/templates/security.scm b/website/apps/base/templates/security.scm
index ea997b2..b772912 100644
--- a/website/apps/base/templates/security.scm
+++ b/website/apps/base/templates/security.scm
@@ -16,7 +16,7 @@
(theme
#:title '("Security")
#:description
- "Important information about geting security updates for your
+ "Important information about getting security updates for your
GNU�Guix installation, and instructions on how to report
security issues."
#:keywords
--
2.23.0
P
P
pelzflorian (Florian Pelz) wrote on 6 Sep 2019 16:42
20190906144202.5qi62iimhz2npdqp@pelzflorian.localdomain
The 6th patch wrongly updated guix-website.pot. I will not resend.
S
S
sirgazil wrote on 6 Sep 2019 20:17
[website] translations
(name . 26302)(address . 26302@debbugs.gnu.org)
16d07cb5a1d.ca69255821627.8144164908931126811@zoho.com
Hi, Florian :)

I haven't had the time to work on the website again, so I haven't tried your code yet. But I'm glad you're working on this.

Regarding URLs, I would prefer using IRIs, like follows:

/IETF-LANGUAGE-TAG/path/to/resource/

So:

/es-ES/vídeos/
/es-CO/videos/

Currently, I do this for document-like resources, but I haven't thought if the same should be done for other resources like images, videos, etc., that may need localization as well.

I have to say that I'm always afraid that something will break if you don't feed English to current systems, though. See for example the URLs that result when you export texinfo documentation written in other languages to HTML:


In this example, the accented "ó" of "Instalación" is changed in two different ways that make the URL less readable for a Spanish speaker.

Still, I think it's good to internationalize whatever is supposed to be "localizable" (in theory) to push systems to handle other languages better.

Speaking of the manual, I would also think about changing its URL path to the /IETF-LANGUAGE-TAG/manual/ form to make everything uniform if possible.

As for the website dropdowns, that could be reported as a separate issue (yes, they are not really accessible at the moment). I didn't know how to implement the tab navigation for them at that time, but I think it is possible using only CSS.



---
P
P
pelzflorian (Florian Pelz) wrote on 8 Sep 2019 19:16
(name . sirgazil)(address . sirgazil@zoho.com)(name . 26302)(address . 26302@debbugs.gnu.org)
20190908171638.cna67eearj4rbn2k@pelzflorian.localdomain
On Fri, Sep 06, 2019 at 01:17:10PM -0500, sirgazil via Bug reports for GNU Guix wrote:
Toggle quote (6 lines)
> Hi, Florian :)
>
> I haven't had the time to work on the website again, so I haven't
> tried your code yet. But I'm glad you're working on this.
>

:)


Toggle quote (10 lines)
> Regarding URLs, I would prefer using IRIs, like follows:
>
> /IETF-LANGUAGE-TAG/path/to/resource/
>
> So:
>
> /es-ES/vídeos/
> /es-CO/videos/
>

As I understand it, es and es-ES and es-Latn-ES would all be language
tags (or just subtags??) for Spanish from Spain. Do we use the full
tag es-Latn-ES? Probably es-ES makes more sense than es-Latn-ES for
many languages (but not all). The Translation Project will generally
only provide one script, it seems. Maybe often es is enough. I
suppose we could write an associative list mapping locales for which
translations exist to language tags.



Toggle quote (5 lines)
> Currently, I do this for document-like resources, but I haven't
> thought if the same should be done for other resources like images,
> videos, etc., that may need localization as well.
>

I would prefer if nginx responded with /es/help/index.html only if
/help/index.html does not exist, the same for other file extensions.



Toggle quote (16 lines)
> I have to say that I'm always afraid that something will break if
> you don't feed English to current systems, though. See for example
> the URLs that result when you export texinfo documentation written
> in other languages to HTML:
>
> https://guix.gnu.org/manual/es/html_node/Instalacion-del-sistema.html#Instalaci_00f3n-del-sistema
>
> In this example, the accented "ó" of "Instalación" is changed in two
> different ways that make the URL less readable for a Spanish
> speaker.
>
> Still, I think it's good to internationalize whatever is supposed to
> be "localizable" (in theory) to push systems to handle other
> languages better.
>

I believe Texinfo performs this rather complex mapping (especially for
Chinese manuals!) because domain registrars forbid Unicode characters
that do not match the Top Level Domain for security reasons. I am
unsure if we can translate anything to non-Latin filenames.



Toggle quote (5 lines)
> Speaking of the manual, I would also think about changing its URL
> path to the /IETF-LANGUAGE-TAG/manual/ form to make everything
> uniform if possible.
>

I agree.



Toggle quote (7 lines)
> As for the website dropdowns, that could be reported as a separate
> issue (yes, they are not really accessible at the moment). I didn't
> know how to implement the tab navigation for them at that time, but
> I think it is possible using only CSS.
>
>

I think a language selection dropdown is required for a multilingual
website.

I realize my code in patch 4 is insufficient when not run manually
because the Guix’ maintenance repository’s hydra/berlin.scm does not
run .guix.scm from the website directory. I will resend patch 4 when
I have a working dropdown and berlin virtual machine.

Regards,
Florian
L
L
Ludovic Courtès wrote on 8 Sep 2019 21:44
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
878sqy7etv.fsf@gnu.org
Hi Florian,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (7 lines)
> Find attached preliminary patches that add a working website
> translation system to guix-artwork. Of course, the patches should
> *not* be pushed before there is a working nginx configuration with
> appropriate redirects. (Except the first three patches; I do not
> understand how you could even build the website without my first
> patch?)

Cool, thanks for opening this issue!

Toggle quote (6 lines)
> In my patches, I have used spaces for indentation. Most previous
> website code used a mix of tabs and spaces, like in emacs’ strange
> default setting. If you want, I can tabify my patches. I cannot see
> any reason for using mixed tabs+spaces with emacs-style Lisp
> indentation though.

Spaces are good (easily pastable in the REPL), the whole Guix code base
is meant to use spaces only.

Toggle quote (5 lines)
> For redirecting previous URLs based on the HTTP Accept-Language
> header, there is
> <https://www.nginx.com/resources/wiki/modules/accept_language/#accept-language-installation>.
> It could be added to nginx.

Good.

Toggle quote (19 lines)
> I do not know what the new URLs should be. After reading
> <https://webmasters.stackexchange.com/questions/403/how-should-i-structure-my-urls-for-both-seo-and-localization>
> I now understand that there indeed should be separate URLs for each
> language and Accept-Language headers are not sufficient. However,
> Ludo’s idea of translating URLs including the basename
> <https://lists.gnu.org/archive/html/guix-devel/2019-08/msg00164.html>,
> i.e. /help.html as /es/ayuda.html, leads to questions about the
> implementation such as what Jelle Licht mentioned
> <https://lists.gnu.org/archive/html/guix-devel/2019-08/msg00169.html>.
> We can do whatever we want, so let’s do what is best. What do you
> think, /es/ayuda/ or /es/help/ or something else?
>
> For ayuda, we would then need to make `guix build -f .guix.scm` build
> with the static website also some kind of association list for
> redirects that is readable by nginx lua code or whatever (could there
> be guile plugins for nginx??).
>
> We can do /es/help/ now and make /es/ayuda/ later.

Yeah, let’s keep that for later.

Toggle quote (5 lines)
> One of the attached patches adds a PO file with a German translation
> that was needed for testing purposes; of course translations should
> normally be submitted via the Translation Project. The patch need not
> be applied; do as you see fit.

I wonder if we should use the TP for this. Thoughts?

Toggle quote (6 lines)
> With respect to the help mailing list blurbs on the website, my code
> gives priority to the PO file translation of the blurb and uses the
> previous hard-coded translations as a fall-back. I would keep the
> blurbs this way until all are part of a PO file at the Translation
> Project.

Sounds good.

Toggle quote (6 lines)
> The Chinese language blurb is written in traditional Chinese
> characters. I believe there never was a decision on
> <https://lists.gnu.org/archive/html/guix-devel/2018-03/msg00131.html>,
> so I leave the language code as “zh” for now, even though someone may
> add a “zh-cn” too.

Yeah, we can always adjust later.

Thanks!

Ludo’.
P
P
pelzflorian (Florian Pelz) wrote on 8 Sep 2019 22:46
(name . Ludovic Courtès)(address . ludo@gnu.org)
20190908204625.yjzkhzlwwbz6ivck@pelzflorian.localdomain
On Sun, Sep 08, 2019 at 09:44:44PM +0200, Ludovic Courtès wrote:
Toggle quote (3 lines)
> Cool, thanks for opening this issue!
>

Thank you! (Well, it was ng0’s old issue and people on the list
started talking about its topic again.)


Toggle quote (8 lines)
> > One of the attached patches adds a PO file with a German translation
> > that was needed for testing purposes; of course translations should
> > normally be submitted via the Translation Project. The patch need not
> > be applied; do as you see fit.
>
> I wonder if we should use the TP for this. Thoughts?
>

We can, because it’s an ordinary POT file like guix-manual (but easier
because no Texinfo knowledge is required). With the TP, there would
be many more translations, although often incomplete and in a few
cases wrong, but the readers will notice. All the translators can do
is reorder existing SHTML, at worst misrepresenting GNU, redirecting
translatable links wrongly or preventing the website from building.

Regards,
Florian
S
S
sirgazil wrote on 10 Sep 2019 02:49
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)(name . 26302)(address . 26302@debbugs.gnu.org)
16d18a5a9e8.12ab66c8254154.2756956535677606704@zoho.com
---- On Sun, 08 Sep 2019 12:16:38 -0500 pelzflorian (Florian Pelz) <pelzflorian@pelzflorian.de> wrote ----

> > Regarding URLs, I would prefer using IRIs, like follows:
> >
> > /IETF-LANGUAGE-TAG/path/to/resource/
> >
> > So:
> >
> > /es-ES/vídeos/
> > /es-CO/videos/
> >
>
> As I understand it, es and es-ES and es-Latn-ES would all be language
> tags (or just subtags??) for Spanish from Spain. Do we use the full
> tag es-Latn-ES? Probably es-ES makes more sense than es-Latn-ES for
> many languages (but not all). The Translation Project will generally
> only provide one script, it seems. Maybe often es is enough. I
> suppose we could write an associative list mapping locales for which
> translations exist to language tags.

I'm not suggesting any particular IETF language tags for Spanish variants, though. I think one could start supporting only the language tags equivalent to the teams defined in the Translation Project (TP).

In the case of Spanish, many libre projects start focusing only on "es" (which is the case for the TP), and that's ok, but it's good to support variants. As far as I understand, the TP allows creating teams for language variants (there is a pt_BR team). For example, I'd like to have an "es-CO" catalog to override some translations of the "es" catalog that are only common in Spain.
P
P
pelzflorian (Florian Pelz) wrote on 15 Sep 2019 22:18
(name . sirgazil)(address . sirgazil@zoho.com)(name . 26302)(address . 26302@debbugs.gnu.org)
20190915201819.3yxm25fayvbxwdpl@pelzflorian.localdomain
On Mon, Sep 09, 2019 at 07:49:33PM -0500, sirgazil wrote:
Toggle quote (5 lines)
> I think one could start supporting only the
> language tags equivalent to the teams defined in the Translation
> Project (TP).
>

This is a good suggestion, I think. Find attached new versions of all
patches that work on a berlin.scm virtual machine (slightly modified
to use substitutes and not run some services). These include patches
for dropdown accessibility and an ugly language dropdown.

The language dropdown redirects to the homepage, because Haunt offers
no nice way to get the name of the same page.

I have used the code “en” for U.S. English because the TP team for
British English is already called en_GB, so its code would be en-GB.

What’s missing is code for adding the nginx plugin


to Guix so it can be used on berlin.scm. It seems to offer all that
is required for redirecting existing URLs.

Regards,
Florian
From fa96d7ec0a71dfea4b5c2cae8bdfb2a8f27f678d Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Thu, 18 Jul 2019 10:22:44 +0200
Subject: [PATCH 1/8] website: Use needed modules in posts.

* website/posts/back-from-seagl-2018.sxml: Use needed modules.
* website/posts/guix-at-libreplanet-2016.sxml: Use needed modules.
---
website/posts/back-from-seagl-2018.sxml | 3 ++-
website/posts/guix-at-libreplanet-2016.sxml | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)

Toggle diff (27 lines)
diff --git a/website/posts/back-from-seagl-2018.sxml b/website/posts/back-from-seagl-2018.sxml
index c5ad0a9..958369f 100644
--- a/website/posts/back-from-seagl-2018.sxml
+++ b/website/posts/back-from-seagl-2018.sxml
@@ -1,6 +1,7 @@
(begin
(use-modules (apps base templates components)
- (srfi srfi-19))
+ (apps base utils)
+ (srfi srfi-19))
`((title . "Back from SeaGL 2018")
(author . "Chris Marusich")
(date . ,(make-date 0 0 0 0 10 12 2018 -28800))
diff --git a/website/posts/guix-at-libreplanet-2016.sxml b/website/posts/guix-at-libreplanet-2016.sxml
index 8581be4..252def3 100644
--- a/website/posts/guix-at-libreplanet-2016.sxml
+++ b/website/posts/guix-at-libreplanet-2016.sxml
@@ -1,5 +1,6 @@
(begin
- (use-modules (srfi srfi-19))
+ (use-modules (srfi srfi-19)
+ (apps base templates components))
`((title . "Guix at LibrePlanet 2016")
(author . "David Thompson")
(date unquote (make-date 0 0 0 0 15 3 2016 3600))
--
2.23.0
From afd68ec639494320b5248b75315174d2dc1f7adb Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Sat, 31 Aug 2019 11:52:31 +0200
Subject: [PATCH 2/8] website: Fix typing mistake.

* website/apps/base/templates/contribute.scm (contribute-t):
Add missing word.
---
website/apps/base/templates/contribute.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/website/apps/base/templates/contribute.scm b/website/apps/base/templates/contribute.scm
index 6c4787f..4d68e87 100644
--- a/website/apps/base/templates/contribute.scm
+++ b/website/apps/base/templates/contribute.scm
@@ -201,7 +201,7 @@
(h3 (@ (id "testing")) "Test and Bug Reports")
(p
"Install the software and send feedback to the community
- about your experience. Help the project reporting bugs.")
+ about your experience. Help the project by reporting bugs.")
(p
"Before reporting a bug, please check whether the bug is
already "
--
2.23.0
From 3bd446c4242f278123a113bd65ef2bf302a29afd Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Sat, 31 Aug 2019 21:00:29 +0200
Subject: [PATCH 3/8] website: Fix typo.

* website/apps/base/templates/security.scm (security-t): Fix typo.
---
website/apps/base/templates/security.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/website/apps/base/templates/security.scm b/website/apps/base/templates/security.scm
index ea997b2..b772912 100644
--- a/website/apps/base/templates/security.scm
+++ b/website/apps/base/templates/security.scm
@@ -16,7 +16,7 @@
(theme
#:title '("Security")
#:description
- "Important information about geting security updates for your
+ "Important information about getting security updates for your
GNU�Guix installation, and instructions on how to report
security issues."
#:keywords
--
2.23.0
From 88e8c06927411a814809be8126491144653e86b3 Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Sun, 15 Sep 2019 22:03:26 +0200
Subject: [PATCH 8/8] website: Add language selection dropdown to navbar.

* website/apps/base/templates/components.scm (navbar): Add it.
(horizontal-skip): New procedure.
* website/static/base/css/navbar.css: Add CSS for horizontal-skip.
Increase size at which website switches to mobile mode.
---
website/apps/base/templates/components.scm | 30 +++++++++++++++++++---
website/static/base/css/navbar.css | 6 ++++-
2 files changed, 32 insertions(+), 4 deletions(-)

Toggle diff (85 lines)
diff --git a/website/apps/base/templates/components.scm b/website/apps/base/templates/components.scm
index 1653c1e..278036c 100644
--- a/website/apps/base/templates/components.scm
+++ b/website/apps/base/templates/components.scm
@@ -23,6 +23,7 @@
contact->shtml
horizontal-line
horizontal-separator
+ horizontal-skip
link-more
link-subtle
link-yellow
@@ -180,6 +181,10 @@
`(src ,(guix-url "static/base/img/h-separator-dark.png")))
(alt ""))))
+(define (horizontal-skip)
+ "Return SHTML for a small horizontal space."
+ `(span (@ (class "hskip"))))
+
(define (horizontal-line)
"Return SHTML for a visible separator to be used in a dropdown menu
like a menu item."
@@ -400,13 +405,32 @@ manual.
(C_ "website menu" (menu-item #:label "Contact" #:active-item active-item #:url (guix-url "contact/")))
(C_ "website menu" (menu-item #:label "Contribute" #:active-item active-item #:url (guix-url "contribute/")))
(C_ "website menu" (menu-item #:label "Security" #:active-item active-item #:url (guix-url "security/")))
- (C_ "website menu" (menu-item #:label "Graphics" #:active-item active-item #:url (guix-url "graphics/")))))))
+ (C_ "website menu" (menu-item #:label "Graphics" #:active-item active-item #:url (guix-url "graphics/")))))
+ ,(horizontal-skip)
+ ;; Languages dropdown.
+ ,(menu-dropdown #:label (locale-display-name) #:active-item active-item
+ #:items
+ (map-in-order
+ (lambda (ietf-info)
+ (let ((lingua (car ietf-info))
+ (code (cdr ietf-info)))
+ (setlocale LC_ALL (string-append lingua ".utf8"))
+ (let ((out (menu-item #:label (locale-display-name)
+ #:active-item active-item
+ #:url (guix-url (string-append code "/")
+ #:localize #f))))
+ (setlocale LC_ALL "")
+ out)))
+ (sort (delete %current-lingua
+ ietf-tags-file-contents
+ (lambda (a b) (string=? a (car b))))
+ (lambda (a b) string<?))))))
+
;; Menu button.
(a
(@ (class "menu-btn")
- (href ,(guix-url "menu/"))) "")))
-
+ (href ,(guix-url "menu/"))) "")))
(define (page-indicator page-number total-pages)
"Return an SHTML span element in the form 'page X of Y' if there is
diff --git a/website/static/base/css/navbar.css b/website/static/base/css/navbar.css
index c8a6bd8..1146f13 100644
--- a/website/static/base/css/navbar.css
+++ b/website/static/base/css/navbar.css
@@ -109,6 +109,10 @@ label.menu-item {
background-position: top;
}
+.hskip {
+ padding-left: 10px;
+}
+
.hline {
display: none;
}
@@ -116,7 +120,7 @@ label.menu-item {
-@media screen and (min-width: 850px) {
+@media screen and (min-width: 900px) {
.navbar {
position: relative;
overflow: visible;
--
2.23.0
P
P
pelzflorian (Florian Pelz) wrote on 18 Sep 2019 15:00
(name . sirgazil)(address . sirgazil@zoho.com)(name . 26302)(address . 26302@debbugs.gnu.org)
20190918130055.gvx2z2iqh7i3qn6h@pelzflorian.localdomain
On Sun, Sep 15, 2019 at 10:18:20PM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (10 lines)
> What’s missing is code for adding the nginx plugin
>
> https://www.nginx.com/resources/wiki/modules/accept_language/
>
> to Guix so it can be used on berlin.scm. It seems to offer all that
> is required for redirecting existing URLs.
>
> Regards,
> Florian

Help is welcome. If berlin.scm uses the above module, a package like
but for the accept_language module and for Guix would be needed.
I would prefer someone more into nginx and its Guix service to do this
or suggest an alternative. If not, I will try making a package in a few days.

Regards,
Florian
L
L
Ludovic Courtès wrote on 18 Sep 2019 15:57
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87ef0daeqs.fsf@gnu.org
Hi Florian,

Could you create an account on Savannah so we can give you commit
access?

That’d allow you for you to push these patches first in a branch so we
can test, and it should make it easier for you.

Once you’ve created an account, please make sure to add the OpenPGP key
you’ll use to sign commits on Savannah and on key servers, and reply to
this message signed with that key.

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (4 lines)
> I am not entirely certain in my use of macros, but believe it is
> right. See my discussion with Mark H Weaver at
> <https://lists.gnu.org/archive/html/guile-user/2019-09/msg00008.html>.

I have a couple of comments on this specific issue below.

Toggle quote (5 lines)
> +;; NOTE: The sgettext macros have no hygiene because they use
> +;; datum->syntax and do not preserve the semantics of anything looking
> +;; like an sgettext macro. This is an exceptional use case; do not
> +;; try this at home.

:-)

Toggle quote (12 lines)
> +(define (sgettext x)
> + "After choosing an identifier for marking s-expressions for
> +translation, make it usable by defining a macro with it calling
> +sgettext. If for example the chosen identifier is G_,
> +use (define-syntax G_ sgettext)."
> + (syntax-case x ()
> + ((id exp)
> + (let* ((msgid (sexp->msgid (syntax->datum #'exp)))
> + (new-exp (deconstruct (syntax->datum #'exp)
> + (gettext msgid))))
> + (datum->syntax #'id new-exp)))))

For this and other similar macros you must use ‘define-syntax’, not
‘define’, so that they are defined at expansion time, not at run time.
(It doesn’t make any difference when you’re evaluating code since both
phases run in the same module, but it does make a difference when these
phases happen at different times, in different processes.)

Consequently, you must arrange for ‘sexp->msgid’ and ‘deconstruct’ to be
available at expansion time too. This can be done by wrapping their
definition in ‘eval-when’:

(eval-when (load expand eval)
(define (sexp->msgid …) …)
(define (deconstruct …) …))

But actually it’s not clear to me why these are macros. I think they
could be regular procedures and it’d work just fine, no?

Toggle quote (14 lines)
> +(define %plural-numbers
> + ;; Hard-coded list of input numbers such that for each language’s
> + ;; plural formula, for each possible output grammatical number,
> + ;; there is an n among %plural-numbers that yields this output
> + ;; (cf. section Plural forms in the gettext manual), except 1 is
> + ;; omitted from this list because it is a special case for
> + ;; sngettext. That is, calling ngettext with each number from
> + ;; %plural-numbers and with 1 in any locale is guaranteed to return
> + ;; each plural form at least once. It would be more resilient
> + ;; towards new languages if instead of hard-coding we computed this
> + ;; from the Plural-Forms in the MO file header entry, but that is
> + ;; not worth the incurred code complexity.
> + '(0 2 3 11 100))

I don’t understand this: are these the only plural numbers in all
languages, or…?

Thanks!

Ludo’.
P
P
pelzflorian (Florian Pelz) wrote on 19 Sep 2019 09:48
(name . Ludovic Courtès)(address . ludo@gnu.org)
20190919074829.hu3c7yy3bmeudfsw@florianbeaglebone.fritz.box
On Wed, Sep 18, 2019 at 03:57:47PM +0200, Ludovic Courtès wrote:
Toggle quote (6 lines)
> Hi Florian,
>
> Could you create an account on Savannah so we can give you commit
> access?
>

Done. My username is pelzflorian.


Toggle quote (15 lines)
> > +(define (sgettext x)
> > + "After choosing an identifier for marking s-expressions for
> > +translation, make it usable by defining a macro with it calling
> > +sgettext. If for example the chosen identifier is G_,
> > +use (define-syntax G_ sgettext)."
> > + (syntax-case x ()
> > + ((id exp)
> > + (let* ((msgid (sexp->msgid (syntax->datum #'exp)))
> > + (new-exp (deconstruct (syntax->datum #'exp)
> > + (gettext msgid))))
> > + (datum->syntax #'id new-exp)))))
>
> For this and other similar macros you must use ‘define-syntax’, not
> ‘define’, so that they are defined at expansion time, not at run time.

As per the above docstring, I already have a definition

(define-syntax G_ sgettext)

in (apps i18n). Possibly I should just move it here.



Toggle quote (16 lines)
> (It doesn’t make any difference when you’re evaluating code since both
> phases run in the same module, but it does make a difference when these
> phases happen at different times, in different processes.)
>
> Consequently, you must arrange for ‘sexp->msgid’ and ‘deconstruct’ to be
> available at expansion time too. This can be done by wrapping their
> definition in ‘eval-when’:
>
> (eval-when (load expand eval)
> (define (sexp->msgid …) …)
> (define (deconstruct …) …))
>
> But actually it’s not clear to me why these are macros. I think they
> could be regular procedures and it’d work just fine, no?
>

I do not understand. sexp->msgid and deconstruct are procedures, not
syntax transformers. I can add eval-when, but the current code runs
as expected for me.




Toggle quote (18 lines)
> > +(define %plural-numbers
> > + ;; Hard-coded list of input numbers such that for each language’s
> > + ;; plural formula, for each possible output grammatical number,
> > + ;; there is an n among %plural-numbers that yields this output
> > + ;; (cf. section Plural forms in the gettext manual), except 1 is
> > + ;; omitted from this list because it is a special case for
> > + ;; sngettext. That is, calling ngettext with each number from
> > + ;; %plural-numbers and with 1 in any locale is guaranteed to return
> > + ;; each plural form at least once. It would be more resilient
> > + ;; towards new languages if instead of hard-coding we computed this
> > + ;; from the Plural-Forms in the MO file header entry, but that is
> > + ;; not worth the incurred code complexity.
> > + '(0 2 3 11 100))
>
> I don’t understand this: are these the only plural numbers in all
> languages, or…?
>

Yes, in all languages for which a plural= formula is documented in the
gettext manual.

For example, Arabic has

Plural-Forms: nplurals=6; \
plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 \
: n%100>=11 ? 4 : 5;

with input plural numbers 0, 1, 2, 3, 11, 100 mapping to all outputs
0, 1, 2, 3, 4, 5.

Maybe I should add this example to the code comment.

Regards,
Florian
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEzvTLkUhWujgKIKfiMAiIyznGOBcFAl2DMsQACgkQMAiIyznG
OBdwMQf/Z4wLkn/4STj/7S08bRf9dIa8ksRXrAJ1wgJgkvXEkkLz9QBEH9RSF+WY
0EJgUwcRNMG7va+Knxb7ISwarDuRdTOP5zD8aAvEyVHzDUCut/kUDn1Fj7DEpoD/
9JVWRBNMhmpZ7oTYD1olktB6yci8nHZDJIQL16d8OJ8BDRhD+80X6ECpbNSULALC
uFdgUSEdiA7raBrzH9+ahhfyMwu6powhPvP8kXJQ6eRG4AZQrOwwIOkp26mUlnej
P4kgKTtovrrWHJVNofkRbUiQoSacxVZnSuGgFboUP8+l5JK2eJ6XwOweG7mbp2Yv
md/AA+VgzHAZF9oIeWpaPcKdlPOEfw==
=m9xB
-----END PGP SIGNATURE-----


L
L
Ludovic Courtès wrote on 19 Sep 2019 13:42
Adding Florian as a committer
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87zhj03430.fsf_-_@gnu.org
Hi Florian,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (9 lines)
> On Wed, Sep 18, 2019 at 03:57:47PM +0200, Ludovic Courtès wrote:
>> Hi Florian,
>>
>> Could you create an account on Savannah so we can give you commit
>> access?
>>
>
> Done. My username is pelzflorian.

I’ve added you now. I assume you’ll be signing commits with key
CEF4CB914856BA380A20A7E2300888CB39C63817. (You may want to set an
expiration date on the key, and to periodically update the expiration
date and re-upload the key.)

Please make sure to read ‘HACKING’ regarding the conventions and rules
that apply.

Thank you for your work, and welcome aboard! :-)

Ludo’.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEEPORkVYqE/cadtAz7CQsRmT2a67UFAl2DaZMACgkQCQsRmT2a
67VTHRAAmSzpBpKU5Xp2WbyFL7p/NQxnvaD2xnLq41YueoHYyuHpiBFXWr4rRVwG
vu/q8Hf6f/YBMKp4zjA9cQWUe1L9rssxTXfDLcv4NYRpIcQwh4+OrsJVcKqbZFC6
KwWQkHv1SQQ5jtSQEVMUo3tUoViCqGC2VkXZHAOfrwb+k9dp7gy9pqB8vNbjwj26
RQUw/oAx7pmFdIUBk2qQ4GtLTn9DRIxA9Hg8y72GCCpbgpBErcVQc4TcXwpTNHT7
bokTL7v8LD42KD70xvYkSYIXhtY95Rhh4/u2/uSbn4Uq/emsbei30WQEogKHznnX
G7Gnxpcp4YvtHHqjsz5LP0jVJJNNCQvTDHe7KB1/hiVf/oiZKUhVnUYL59Fy519q
2sfKZLaoAJA9+/BsiWNsh8iDvOW1n0cFgMd1SIkg4iNJSwwRKi7vPbiZmDo8tJih
ktXYziOm/if4gl84Uvf1jSM/0TdULpsliuna1d59yn/CEDB1XF7IYF6UtSgj+OZZ
aw77Fmj7/kYzH2Jsel+f8hPIuATBzBMBsUQUEPOTJ45IZ0KI3LfUM0++I48H0ZJx
zU4EPsHLXLG550Zd8UIWYkTx/a7Do9Bx6G3J0jfYFGtRkWKHcEmxZmA0njmNmZV3
TDLRSjKRFDeXa9k7pY1cfJchyfQOMhxhUcenR1whF+Mg0gpJSvA=
=o1xL
-----END PGP SIGNATURE-----

L
L
Ludovic Courtès wrote on 19 Sep 2019 13:50
Re: bug#26302: [website] translations
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87muf033pp.fsf@gnu.org
Hi,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (21 lines)
>> > +(define (sgettext x)
>> > + "After choosing an identifier for marking s-expressions for
>> > +translation, make it usable by defining a macro with it calling
>> > +sgettext. If for example the chosen identifier is G_,
>> > +use (define-syntax G_ sgettext)."
>> > + (syntax-case x ()
>> > + ((id exp)
>> > + (let* ((msgid (sexp->msgid (syntax->datum #'exp)))
>> > + (new-exp (deconstruct (syntax->datum #'exp)
>> > + (gettext msgid))))
>> > + (datum->syntax #'id new-exp)))))
>>
>> For this and other similar macros you must use ‘define-syntax’, not
>> ‘define’, so that they are defined at expansion time, not at run time.
>
> As per the above docstring, I already have a definition
>
> (define-syntax G_ sgettext)
>
> in (apps i18n). Possibly I should just move it here.

Hmmm right. It works, but it’s surprising and “borderline”.

If all you want is an alias, I’d recommend writing, say:

(define-syntax sgettext …)
(define-syntax G_
(identifier-syntax sgettext))

Toggle quote (20 lines)
>> (It doesn’t make any difference when you’re evaluating code since both
>> phases run in the same module, but it does make a difference when these
>> phases happen at different times, in different processes.)
>>
>> Consequently, you must arrange for ‘sexp->msgid’ and ‘deconstruct’ to be
>> available at expansion time too. This can be done by wrapping their
>> definition in ‘eval-when’:
>>
>> (eval-when (load expand eval)
>> (define (sexp->msgid …) …)
>> (define (deconstruct …) …))
>>
>> But actually it’s not clear to me why these are macros. I think they
>> could be regular procedures and it’d work just fine, no?
>>
>
> I do not understand. sexp->msgid and deconstruct are procedures, not
> syntax transformers. I can add eval-when, but the current code runs
> as expected for me.

I tried to explain above but you can check the Guile manual on
‘eval-when’ (info "(guile) Eval When"). The example there hopefully
clarifies what the problem is.

Toggle quote (32 lines)
>> > +(define %plural-numbers
>> > + ;; Hard-coded list of input numbers such that for each language’s
>> > + ;; plural formula, for each possible output grammatical number,
>> > + ;; there is an n among %plural-numbers that yields this output
>> > + ;; (cf. section Plural forms in the gettext manual), except 1 is
>> > + ;; omitted from this list because it is a special case for
>> > + ;; sngettext. That is, calling ngettext with each number from
>> > + ;; %plural-numbers and with 1 in any locale is guaranteed to return
>> > + ;; each plural form at least once. It would be more resilient
>> > + ;; towards new languages if instead of hard-coding we computed this
>> > + ;; from the Plural-Forms in the MO file header entry, but that is
>> > + ;; not worth the incurred code complexity.
>> > + '(0 2 3 11 100))
>>
>> I don’t understand this: are these the only plural numbers in all
>> languages, or…?
>>
>
> Yes, in all languages for which a plural= formula is documented in the
> gettext manual.
>
> For example, Arabic has
>
> Plural-Forms: nplurals=6; \
> plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 \
> : n%100>=11 ? 4 : 5;
>
> with input plural numbers 0, 1, 2, 3, 11, 100 mapping to all outputs
> 0, 1, 2, 3, 4, 5.
>
> Maybe I should add this example to the code comment.

Oh I see. Maybe just link to the relevant section of the manual ("info
(gettext) Plural forms").

I think you can go ahead and push this series to a branch, say
‘wip-i18n’ (the ‘wip-’ prefix meaning that you reserve the right to
rebase the branch as you will.)

We can then maybe set up a ‘static-web-site’ service on berlin, with
appropriate nginx rules, to build and publish the manual at a separate
URL so we can all test it. See hydra/berlin.scm in maintenance.git.

Thoughts?

Thank you!

Ludo’.
P
P
pelzflorian (Florian Pelz) wrote on 20 Sep 2019 00:08
(name . Ludovic Courtès)(address . ludo@gnu.org)
20190919220828.voohijutgmi6sd3w@florianbeaglebone.fritz.box
The branch wip-i18n is pushed now.

On Thu, Sep 19, 2019 at 01:50:10PM +0200, Ludovic Courtès wrote:
Toggle quote (29 lines)
> Hi,
>
> "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
>
> >> > +(define (sgettext x)
> >> > + "After choosing an identifier for marking s-expressions for
> >> > +translation, make it usable by defining a macro with it calling
> >> > +sgettext. If for example the chosen identifier is G_,
> >> > +use (define-syntax G_ sgettext)."
> >> > + (syntax-case x ()
> >> > + ((id exp)
> >> > + (let* ((msgid (sexp->msgid (syntax->datum #'exp)))
> >> > + (new-exp (deconstruct (syntax->datum #'exp)
> >> > + (gettext msgid))))
> >> > + (datum->syntax #'id new-exp)))))
> >>
> >> For this and other similar macros you must use ‘define-syntax’, not
> >> ‘define’, so that they are defined at expansion time, not at run time.
> >
> > As per the above docstring, I already have a definition
> >
> > (define-syntax G_ sgettext)
> >
> > in (apps i18n). Possibly I should just move it here.
>
> Hmmm right. It works, but it’s surprising and “borderline”.
>
> If all you want is an alias,

Yes, an alias is what I wanted, like gettext.


Toggle quote (7 lines)
> I’d recommend writing, say:
>
> (define-syntax sgettext …)
> (define-syntax G_
> (identifier-syntax sgettext))
>

This breaks the code, I think because the sgettext result gets
evaluated in a clean environment which lacks surrounding variables.
For example,

(let ((i 5) (G_ `("There are " ,i " apples"))))

fails to resolve i.

I have left this borderline code as it is.


Toggle quote (25 lines)
> >> (It doesn’t make any difference when you’re evaluating code since both
> >> phases run in the same module, but it does make a difference when these
> >> phases happen at different times, in different processes.)
> >>
> >> Consequently, you must arrange for ‘sexp->msgid’ and ‘deconstruct’ to be
> >> available at expansion time too. This can be done by wrapping their
> >> definition in ‘eval-when’:
> >>
> >> (eval-when (load expand eval)
> >> (define (sexp->msgid …) …)
> >> (define (deconstruct …) …))
> >>
> >> But actually it’s not clear to me why these are macros. I think they
> >> could be regular procedures and it’d work just fine, no?
> >>
> >
> > I do not understand. sexp->msgid and deconstruct are procedures, not
> > syntax transformers. I can add eval-when, but the current code runs
> > as expected for me.
>
> I tried to explain above but you can check the Guile manual on
> ‘eval-when’ (info "(guile) Eval When"). The example there hopefully
> clarifies what the problem is.
>

I had read that Guile manual section, but it is hard to understand
when eval-when is needed and when it is not needed, because the
manual’s negative example for wrong code runs just as fine for me as
the eval-when version, even when saved to a separate module.

I have not used eval-when for now.

Toggle quote (36 lines)
> >> > +(define %plural-numbers
> >> > + ;; Hard-coded list of input numbers such that for each language’s
> >> > + ;; plural formula, for each possible output grammatical number,
> >> > + ;; there is an n among %plural-numbers that yields this output
> >> > + ;; (cf. section Plural forms in the gettext manual), except 1 is
> >> > + ;; omitted from this list because it is a special case for
> >> > + ;; sngettext. That is, calling ngettext with each number from
> >> > + ;; %plural-numbers and with 1 in any locale is guaranteed to return
> >> > + ;; each plural form at least once. It would be more resilient
> >> > + ;; towards new languages if instead of hard-coding we computed this
> >> > + ;; from the Plural-Forms in the MO file header entry, but that is
> >> > + ;; not worth the incurred code complexity.
> >> > + '(0 2 3 11 100))
> >>
> >> I don’t understand this: are these the only plural numbers in all
> >> languages, or…?
> >>
> >
> > Yes, in all languages for which a plural= formula is documented in the
> > gettext manual.
> >
> > For example, Arabic has
> >
> > Plural-Forms: nplurals=6; \
> > plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 \
> > : n%100>=11 ? 4 : 5;
> >
> > with input plural numbers 0, 1, 2, 3, 11, 100 mapping to all outputs
> > 0, 1, 2, 3, 4, 5.
> >
> > Maybe I should add this example to the code comment.
>
> Oh I see. Maybe just link to the relevant section of the manual ("info
> (gettext) Plural forms").
>

I made the reference more clear in the %plural-forms comment now.

Toggle quote (8 lines)
> […]
> We can then maybe set up a ‘static-web-site’ service on berlin, with
> appropriate nginx rules, to build and publish the manual at a separate
> URL so we can all test it. See hydra/berlin.scm in maintenance.git.
>
> Thoughts?
>

I’ll leave this to you. :)

Regards,
Florian
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCAAdFiEEzvTLkUhWujgKIKfiMAiIyznGOBcFAl2D/FUACgkQMAiIyznG
OBfcEAf/dQDz/sQ3per0SfQ9/BbZtWX8zq2XPZzDCPQuIqOQki4gOZzi/181T8x9
1agtLzhgiJLW6NmLmHyOchYZO3MLKUBSgjcQOs6mD+wMwkc1o/rjaiKy+EuOUaVN
37T0yKrnM7dSMuRim+iRpREkZHf/q0/KcglbXaEQHm6O0Qpp8ikLORhQkPlSpe3o
nTJLSODcwkLOIkdhYx8sCLZf5Y46PYk7Rg26CM7ssG+0djQER0uEiye4D9Vno7nD
PfK707UAh97hdCnrQv2mgWYl3iOo7We+KIX30X3RExJY/tYgIKMMhmDb2ss2C9KF
5olG81ug7D9PbdtMG6xb51zO+pFsRw==
=Lmyr
-----END PGP SIGNATURE-----


P
P
pelzflorian (Florian Pelz) wrote on 7 Oct 2019 10:15
(name . 26302)(address . 26302@debbugs.gnu.org)
20191007081502.wog4q4wjptvhmejf@pelzflorian.localdomain
On Sun, Sep 15, 2019 at 10:18:20PM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (8 lines)
> What’s missing is code for adding the nginx plugin
>
> https://www.nginx.com/resources/wiki/modules/accept_language/
>
> to Guix so it can be used on berlin.scm. It seems to offer all that
> is required for redirecting existing URLs.
>

Please review the attached patch to Guix that adds
nginx-mod-accept-language. (This is not the upstream name; various
nginx modules use no consistent naming scheme for nginx modules.) I
have put it in a separate module from (gnu packages web) due to an
import cycle with tar/(gnu packages base). The second patch allows
using dynamic modules with the nginx service.

Using these patches, the attached slightly wrong patch to
guix/maintenance.git is meant to make the web server default to
serving the language configured in the browser when no language code
is specified in the URL, so old URLs remain functional. (Redirects of
non-html URLs are wrong and nginx does not run with this config,
perhaps I should use rewrite instead of try_files. I can try later
today.)

Nonetheless, href links on the website point to the localized pages on
purpose so if someone changes the language the change remains in
effect when following a link.

Some people on the internet (I forgot who) preferred having a cookie
store the preferred language. That would make it possible to continue
using the old URLs in href links on the website. However, I am not
sure how it would affect SEO.

On Thu, Sep 19, 2019 at 01:50:10PM +0200, Ludovic Courtès wrote:
Toggle quote (5 lines)
> We can then maybe set up a ‘static-web-site’ service on berlin, with
> appropriate nginx rules, to build and publish the manual at a separate
> URL so we can all test it. See hydra/berlin.scm in maintenance.git.
>

I see you @Ludo added such a service, but I cannot reach it. Perhaps
I am using the wrong URL.


Regards,
Florian
From 7747a416feae7139c2b2661ffeb37f2eb03eb2f9 Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Sun, 6 Oct 2019 15:31:23 +0200
Subject: [PATCH 2/2] services: Make it possible to include dynamic modules in
nginx.

* gnu/services/web.scm (<nginx-configuration>): Add load-modules field.
(nginx-configuration-load-modules): New field accessor.
(emit-load-module): New procedure.
(default-nginx-config): Add support for the load-modules field.
* doc/guix.texi (NGINX): Document it.
---
doc/guix.texi | 4 ++++
gnu/services/web.scm | 8 ++++++++
2 files changed, 12 insertions(+)

Toggle diff (70 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 42d2d77ae6..5c39e26155 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19718,6 +19718,10 @@ use the size of the processors cache line.
@item @code{server-names-hash-bucket-max-size} (default: @code{#f})
Maximum bucket size for the server names hash tables.
+@item @code{load-modules} (default: @code{'()})
+List of nginx dynamic modules to load. Should be a list of strings or
+string valued G-expressions.
+
@item @code{extra-content} (default: @code{""})
Extra content for the @code{http} block. Should be string or a string
valued G-expression.
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 899be1c168..a68f0235b7 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -9,6 +9,7 @@
;;; Copyright � 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
;;; Copyright � 2017, 2018, 2019 Christopher Baines <mail@cbaines.net>
;;; Copyright � 2018 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright � 2019 Florian Pelz <pelzflorian@pelzflorian.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -95,6 +96,7 @@
nginx-configuration-upstream-blocks
nginx-configuration-server-names-hash-bucket-size
nginx-configuration-server-names-hash-bucket-max-size
+ nginx-configuration-load-modules
nginx-configuration-extra-content
nginx-configuration-file
@@ -522,6 +524,7 @@
(default #f))
(server-names-hash-bucket-max-size nginx-configuration-server-names-hash-bucket-max-size
(default #f))
+ (load-modules nginx-configuration-load-modules (default '()))
(extra-content nginx-configuration-extra-content
(default ""))
(file nginx-configuration-file ;#f | string | file-like
@@ -542,6 +545,9 @@ of index files."
((? string? str) (list str " ")))
names))
+(define (emit-load-module module)
+ (list "load_module " module ";\n"))
+
(define emit-nginx-location-config
(match-lambda
(($ <nginx-location-configuration> uri body)
@@ -615,12 +621,14 @@ of index files."
server-blocks upstream-blocks
server-names-hash-bucket-size
server-names-hash-bucket-max-size
+ load-modules
extra-content)
(apply mixed-text-file "nginx.conf"
(flatten
"user nginx nginx;\n"
"pid " run-directory "/pid;\n"
"error_log " log-directory "/error.log info;\n"
+ (map emit-load-module load-modules)
"http {\n"
" client_body_temp_path " run-directory "/client_body_temp;\n"
" proxy_temp_path " run-directory "/proxy_temp;\n"
--
2.23.0
From ea5edd15586722b3557912e81171e69f7be339fa Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Mon, 7 Oct 2019 07:58:30 +0200
Subject: [PATCH] berlin: Redirect to localized website depending on
Accept-Language header.

* hydra/nginx/berlin.scm (guix.gnu.org-locations): Redirect html URLs.
(%nginx-configuration): Load required nginx dynamic module.
---
hydra/nginx/berlin.scm | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)

Toggle diff (44 lines)
diff --git a/hydra/nginx/berlin.scm b/hydra/nginx/berlin.scm
index df90873..9085183 100644
--- a/hydra/nginx/berlin.scm
+++ b/hydra/nginx/berlin.scm
@@ -1,6 +1,7 @@
;; Nginx configuration for ci.guix.info
-(use-modules (gnu services web))
+(use-modules (gnu packages web-xyz)
+ (gnu services web))
;; TODO: these settings cannot currently expressed with Guix:
@@ -462,6 +463,16 @@ PUBLISH-URL."
(nginx-location-configuration
(uri "~ \\.pdf$") ;*.pdf at the top level
(body (list "root /srv/guix-pdfs;")))
+ (nginx-location-configuration
+ (uri "~ (.*)/$")
+ (body (list
+ "try_files $1/index.html;")))
+ (nginx-location-configuration
+ (uri "~ (.html|.htm)$")
+ (body (list
+ ;; put en first so it is the default:
+ "set_from_accept_language $lang en de;"
+ "try_files /$lang/$uri $uri =404;")))
(nginx-location-configuration ;certbot
(uri "/.well-known")
@@ -758,5 +769,11 @@ PUBLISH-URL."
(define %nginx-configuration
(nginx-configuration
(server-blocks %berlin-servers)
+ (load-modules
+ (list
+ ;; We need this module for redirecting users to the localized
+ ;; website of their choice.
+ (file-append nginx-mod-accept-language "\
+/etc/nginx/modules/ngx_http_accept_language_module.so")))
(extra-content
(string-join %extra-content "\n"))))
--
2.23.0
P
P
pelzflorian (Florian Pelz) wrote on 8 Oct 2019 11:37
(name . 26302)(address . 26302@debbugs.gnu.org)
20191008093719.duvx26l2ods3fg75@pelzflorian.localdomain
On Mon, Oct 07, 2019 at 10:15:03AM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (6 lines)
> (Redirects of
> non-html URLs are wrong and nginx does not run with this config,
> perhaps I should use rewrite instead of try_files. I can try later
> today.)
>

I changed the patch and while nginx loads, redirects for files without
html suffix still fail. I will stop and wait for smarter people with
more nginx experience. Attached is the current patch and changes I
make to berlin for testing in a local VM using

GUILE_LOAD_PATH=$(readlink -f ~/git/maintenance/hydra/modules):$GUILE_LOAD_PATH guix system vm-image --image-size=14G berlin.scm --fallback

Regards,
Florian
From ef1d268cd75219c18ef098389a8ea5ef460ee542 Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Tue, 8 Oct 2019 08:30:59 +0200
Subject: [PATCH] berlin: Redirect to localized website depending on
Accept-Language header.

* hydra/nginx/berlin.scm (guix.gnu.org-locations): Redirect html URLs.
(%nginx-configuration): Load required nginx dynamic module.
---
hydra/nginx/berlin.scm | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)

Toggle diff (44 lines)
diff --git a/hydra/nginx/berlin.scm b/hydra/nginx/berlin.scm
index df90873..c716103 100644
--- a/hydra/nginx/berlin.scm
+++ b/hydra/nginx/berlin.scm
@@ -1,6 +1,7 @@
;; Nginx configuration for ci.guix.info
-(use-modules (gnu services web))
+(use-modules (gnu packages web-xyz)
+ (gnu services web))
;; TODO: these settings cannot currently expressed with Guix:
@@ -462,6 +463,16 @@ PUBLISH-URL."
(nginx-location-configuration
(uri "~ \\.pdf$") ;*.pdf at the top level
(body (list "root /srv/guix-pdfs;")))
+ (nginx-location-configuration
+ (uri "~ (.*)/$")
+ (body (list
+ "try_files $1/index.html =404;")))
+ (nginx-location-configuration
+ (uri "~ (.html|.htm)$")
+ (body (list
+ ;; put en first so it is the default:
+ "set_from_accept_language $lang en de;"
+ "try_files /$lang/$uri $uri =404;")))
(nginx-location-configuration ;certbot
(uri "/.well-known")
@@ -758,5 +769,11 @@ PUBLISH-URL."
(define %nginx-configuration
(nginx-configuration
(server-blocks %berlin-servers)
+ (load-modules
+ (list
+ ;; We need this module for redirecting users to the localized
+ ;; website of their choice.
+ (file-append nginx-mod-accept-language "\
+/etc/nginx/modules/ngx_http_accept_language_module.so")))
(extra-content
(string-join %extra-content "\n"))))
--
2.23.0
L
L
Ludovic Courtès wrote on 22 Oct 2019 14:10
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87a79t56b0.fsf@gnu.org
Hello Florian and all!

(Cc: sirgazil + Julien.)

Ludovic Courtès <ludo@gnu.org> skribis:

Toggle quote (8 lines)
> I think you can go ahead and push this series to a branch, say
> ‘wip-i18n’ (the ‘wip-’ prefix meaning that you reserve the right to
> rebase the branch as you will.)
>
> We can then maybe set up a ‘static-web-site’ service on berlin, with
> appropriate nginx rules, to build and publish the manual at a separate
> URL so we can all test it. See hydra/berlin.scm in maintenance.git.

Sorry that it’s taken this long, but I’m happy to say that the
‘wip-i18n’ branch of the manual is now visible at:


Whenever you push to that branch, the web site should be automatically
updated within an hour.

In IceCat the navigation bar at the top with “radio buttons” gets
incorrectly displayed for some reason.

We’ll need the nginx magic to honor ‘Accept-Language’ and such; I think
you submitted something that I may have overlooked, don’t hesitate to
refresh my mind. :-)

Anyway, we have a good starting point, and perhaps we’ll be able to
switch quickly; what else do we need?


For the record, the changes to the config of berlin.guix.gnu.org to make
it possible were:


Thanks,
Ludo’.
P
P
pelzflorian (Florian Pelz) wrote on 22 Oct 2019 14:28
(name . Ludovic Courtès)(address . ludo@gnu.org)
20191022122840.xwrrfvqm6t7uby6s@pelzflorian.localdomain
On Tue, Oct 22, 2019 at 02:10:59PM +0200, Ludovic Courtès wrote:
Toggle quote (7 lines)
> Sorry that it’s taken this long, but I’m happy to say that the
> ‘wip-i18n’ branch of the manual is now visible at:
>
> https://guix.gnu.org/.i18n/de/
> https://guix.gnu.org/.i18n/en/
>

Thank you. :)


Toggle quote (4 lines)
> Whenever you push to that branch, the web site should be automatically
> updated within an hour.
>

I will rebase wip-i18n later this week and when the documentation
videos are decided.



Toggle quote (4 lines)
> In IceCat the navigation bar at the top with “radio buttons” gets
> incorrectly displayed for some reason.
>

The CSS is not loaded from the .i18n subdirectory, it seems.


Toggle quote (10 lines)
> We’ll need the nginx magic to honor ‘Accept-Language’ and such; I think
> you submitted something that I may have overlooked, don’t hesitate to
> refresh my mind. :-)
>
> Anyway, we have a good starting point, and perhaps we’ll be able to
> switch quickly; what else do we need?
>
>


I would be happy if you could review my Guix patches at


After that I also sent maintenance patches, but redirection only works
for URLs ending in .html right now…


Regards,
Florian
P
P
pelzflorian (Florian Pelz) wrote on 22 Oct 2019 14:41
(name . Ludovic Courtès)(address . ludo@gnu.org)
20191022124128.zi4siz76kdluxr5u@pelzflorian.localdomain
On Tue, Oct 22, 2019 at 02:28:40PM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (3 lines)
> The CSS is not loaded from the .i18n subdirectory, it seems.
>

P
P
pelzflorian (Florian Pelz) wrote on 22 Oct 2019 15:01
(name . Ludovic Courtès)(address . ludo@gnu.org)
20191022130116.avmtflgnlcoxryt2@pelzflorian.localdomain
On Tue, Oct 22, 2019 at 02:28:40PM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (8 lines)
> > Whenever you push to that branch, the web site should be automatically
> > updated within an hour.
> >
>
> I will rebase wip-i18n later this week and when the documentation
> videos are decided.
>

Also it appears I broke URLs to the manual.
L
L
Ludovic Courtès wrote on 23 Oct 2019 16:16
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87imoftum9.fsf@gnu.org
Hi,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (10 lines)
> On Tue, Oct 22, 2019 at 02:28:40PM +0200, pelzflorian (Florian Pelz) wrote:
>> The CSS is not loaded from the .i18n subdirectory, it seems.
>>
>
> I suppose your fix at
>
> https://git.savannah.gnu.org/cgit/guix/guix-artwork.git/commit/?id=0d627303680ef21efd63fba0728e39afc08d67eb
>
> would address it had I rebased.

I rebased some time ago and I think this fix is included (I added it
specifically for this purpose).

Toggle quote (2 lines)
> Also it appears I broke URLs to the manual.

Which URLs specifically?

BTW, feel free to rebase ‘wip-i18n’ and to fix issues you stumble upon
in that branch. With this setup we should be able to see the changes
on-line automatically, so it’s a great way to get the ball rolling!

Thanks,
Ludo’.
P
P
pelzflorian (Florian Pelz) wrote on 23 Oct 2019 16:41
(name . Ludovic Courtès)(address . ludo@gnu.org)
20191023144147.u4tnqbtrsbe5mfg4@pelzflorian.localdomain
On Wed, Oct 23, 2019 at 04:16:30PM +0200, Ludovic Courtès wrote:
Toggle quote (5 lines)
> > Also it appears I broke URLs to the manual.
>
> Which URLs specifically?
>

Only the hyperlinks to the manual in .i18n. Sorry for being
imprecise. Nothing outside is broken.

Toggle quote (5 lines)
> BTW, feel free to rebase ‘wip-i18n’ and to fix issues you stumble upon
> in that branch. With this setup we should be able to see the changes
> on-line automatically, so it’s a great way to get the ball rolling!
>

Will do tomorrow. Then I will check why the stylesheet URLs are
wrong. Thank you for this setup.

Regards,
Florian
P
P
pelzflorian (Florian Pelz) wrote on 31 Oct 2019 21:19
(name . Ludovic Courtès)(address . ludo@gnu.org)
20191031201931.pj2uma6tc57u2tjc@pelzflorian.localdomain
On Tue, Oct 22, 2019 at 02:10:59PM +0200, Ludovic Courtès wrote:
Toggle quote (7 lines)
> Sorry that it’s taken this long, but I’m happy to say that the
> ‘wip-i18n’ branch of the manual is now visible at:
>
> https://guix.gnu.org/.i18n/de/
> https://guix.gnu.org/.i18n/en/
>

I have finally rebased wip-i18n, so these URLs display properly now.
I would like to squash some of my further commits there though.


On Tue, Oct 22, 2019 at 02:28:40PM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (19 lines)
> On Tue, Oct 22, 2019 at 02:10:59PM +0200, Ludovic Courtès wrote:
> > We’ll need the nginx magic to honor ‘Accept-Language’ and such; I think
> > you submitted something that I may have overlooked, don’t hesitate to
> > refresh my mind. :-)
> >
> > Anyway, we have a good starting point, and perhaps we’ll be able to
> > switch quickly; what else do we need?
> >
> >
>
>
> I would be happy if you could review my Guix patches at
>
> https://lists.gnu.org/archive/html/bug-guix/2019-10/msg00068.html
>
> After that I also sent maintenance patches, but redirection only works
> for URLs ending in .html right now…
>

IMHO the next step could be my above patch which packages
ngx_http_accept_language_module. I do not yet know how to redirect
index files in nginx though. Long-term, nginx modules should get
their own build system though, I suppose.

Regards,
Florian
L
L
Ludovic Courtès wrote on 1 Nov 2019 15:54
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
874kznbqa5.fsf@gnu.org
Hi Florian

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (8 lines)
>>From 9ec69c888b978cb870a5873af8e327541fe4ef7a Mon Sep 17 00:00:00 2001
> From: Florian Pelz <pelzflorian@pelzflorian.de>
> Date: Sun, 6 Oct 2019 20:45:34 +0200
> Subject: [PATCH 1/2] [wip] gnu: Add ngx_http_accept_language_module.
>
> * gnu/packages/web-xyz.scm: New file.
> * gnu/local.mk (GNU_SYSTEM_MODULES): Add package.

[...]

Toggle quote (8 lines)
> +++ b/gnu/packages/web-xyz.scm
> @@ -0,0 +1,175 @@
> +;;; GNU Guix --- Functional package management for GNU
> +;;;; TODO should I really add copyright lines for people I copied from??
> +;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
> +;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
> +;;; Copyright © 2017, 2018 Marius Bakke <mbakke@fastmail.com>

I don’t think you need to add these 3 lines here; the package definition
is yours.

Toggle quote (4 lines)
> +(define-public nginx-mod-accept-language
> + (let ((commit "2f69842f83dac77f7d98b41a2b31b13b87aeaba7")
> + (revision "1"))

Is there no upstream version? If that’s the case, that’s fine, but
please add a comment explaining it.

Toggle quote (3 lines)
> + (package
> + (name "nginx-mod-accept-language")

Perhaps “nginx-accept-language-module”, to match the name of the
upstream repo?

Toggle quote (18 lines)
> + (modules '((guix build utils)
> + (ice-9 popen)))
> + (snippet
> + #~(begin
> + ;; the nginx source code is part of the module’s source
> + (format #t "decompressing nginx source code~%")
> + (call-with-output-file "nginx.tar"
> + (lambda (out)
> + (let ((pipe (open-pipe* OPEN_READ
> + #+(file-append gzip "/bin/gzip") "-cd"
> + #$(package-source nginx))))
> + (dump-port pipe out)
> + (unless (= (status:exit-val (close-pipe pipe)) 0)
> + (error "gzip decompress failed")))))
> + (invoke #+(file-append tar "/bin/tar") "xvf" "nginx.tar"
> + "--strip-components=1")
> + (delete-file "nginx.tar")

I’d suggest doing it in a phase.

Toggle quote (4 lines)
> + (license (delete-duplicates
> + (cons license:bsd-2 ;license of nginx-mod-accept-language
> + (package-license nginx))))))) ;the module’s code is linked

To avoid circular dependencies in top-level references, I suggest
copying the license of ‘nginx’ instead of writing (package-license
nginx).

Toggle quote (10 lines)
> + nginx-configuration-load-modules
> nginx-configuration-extra-content
> nginx-configuration-file
>
> @@ -522,6 +524,7 @@
> (default #f))
> (server-names-hash-bucket-max-size nginx-configuration-server-names-hash-bucket-max-size
> (default #f))
> + (load-modules nginx-configuration-load-modules (default '()))

What about “loaded-modules”, “loadable-modules”, or simply “modules”?
“load-modules” sounds imperative whereas the rest of the config is
declarative.

Apart from that it LGTM.

Toggle quote (9 lines)
>>From ea5edd15586722b3557912e81171e69f7be339fa Mon Sep 17 00:00:00 2001
> From: Florian Pelz <pelzflorian@pelzflorian.de>
> Date: Mon, 7 Oct 2019 07:58:30 +0200
> Subject: [PATCH] berlin: Redirect to localized website depending on
> Accept-Language header.
>
> * hydra/nginx/berlin.scm (guix.gnu.org-locations): Redirect html URLs.
> (%nginx-configuration): Load required nginx dynamic module.

LGTM, but I guess we’ll commit it when we’re ready to switch to the new
web site.

Thanks!

Ludo’.
L
L
Ludovic Courtès wrote on 1 Nov 2019 15:58
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
871rurbq3g.fsf@gnu.org
Hi,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (11 lines)
> On Tue, Oct 22, 2019 at 02:10:59PM +0200, Ludovic Courtès wrote:
>> Sorry that it’s taken this long, but I’m happy to say that the
>> ‘wip-i18n’ branch of the manual is now visible at:
>>
>> https://guix.gnu.org/.i18n/de/
>> https://guix.gnu.org/.i18n/en/
>>
>
> I have finally rebased wip-i18n, so these URLs display properly now.
> I would like to squash some of my further commits there though.

Neat!

Toggle quote (5 lines)
> IMHO the next step could be my above patch which packages
> ngx_http_accept_language_module. I do not yet know how to redirect
> index files in nginx though. Long-term, nginx modules should get
> their own build system though, I suppose.

Reviewed! Regarding the build system of nginx modules, we’ll see when
we have more than one module packaged. :-)

Thanks,
Ludo’.
P
P
pelzflorian (Florian Pelz) wrote on 2 Nov 2019 14:15
(name . Ludovic Courtès)(address . ludo@gnu.org)
20191102131515.sq6mlvwsfybagsd2@pelzflorian.localdomain
Thank you for your review! I have attached updated patches.

I have some questions. I’d like to answer but not in order. First of
all,

On Fri, Nov 01, 2019 at 03:54:42PM +0100, Ludovic Courtès wrote:
Toggle quote (20 lines)
> > + (modules '((guix build utils)
> > + (ice-9 popen)))
> > + (snippet
> > + #~(begin
> > + ;; the nginx source code is part of the module’s source
> > + (format #t "decompressing nginx source code~%")
> > + (call-with-output-file "nginx.tar"
> > + (lambda (out)
> > + (let ((pipe (open-pipe* OPEN_READ
> > + #+(file-append gzip "/bin/gzip") "-cd"
> > + #$(package-source nginx))))
> > + (dump-port pipe out)
> > + (unless (= (status:exit-val (close-pipe pipe)) 0)
> > + (error "gzip decompress failed")))))
> > + (invoke #+(file-append tar "/bin/tar") "xvf" "nginx.tar"
> > + "--strip-components=1")
> > + (delete-file "nginx.tar")
>
> I’d suggest doing it in a phase.

This changes many things. :)

With a phase, `guix build -S` would only return the source files of
nginx-accept-language-module directly but not of statically linked
nginx. I have added a further patch to doc/guix.texi warning of `guix
build -S` not always returning complete and corresponding sources, see
attachment.

The good thing is that with a phase I no longer get an import cycle
because I no longer need a reference to the tar package. So I put
nginx-accept-language-module inside web.scm now and there is no need
for a separate module.


Toggle quote (9 lines)
> > + (license (delete-duplicates
> > + (cons license:bsd-2 ;license of nginx-mod-accept-language
> > + (package-license nginx))))))) ;the module’s code is linked
>
> To avoid circular dependencies in top-level references, I suggest
> copying the license of ‘nginx’ instead of writing (package-license
> nginx).
>

I believe this is no longer an issue now that
nginx-accept-language-module is in the same Guile module as nginx, is
it?


Toggle quote (12 lines)
> > +++ b/gnu/packages/web-xyz.scm
> > @@ -0,0 +1,175 @@
> > +;;; GNU Guix --- Functional package management for GNU
> > +;;;; TODO should I really add copyright lines for people I copied from??
> > +;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
> > +;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
> > +;;; Copyright © 2017, 2018 Marius Bakke <mbakke@fastmail.com>
>
> I don’t think you need to add these 3 lines here; the package definition
> is yours.
>

This does not matter anymore after putting
nginx-accept-language-module in the same Guile module file as nginx.

In general though: IANAL but I have largely copied nginx’ configure
phase, so at least Mark would surely have copyright on parts of it.
However I believe copyright lines have limited legal significance
anyway and adding these authorship lines in a file not added by Mark
seems unreasonable.


Toggle quote (5 lines)
> […]
> Perhaps “nginx-accept-language-module”, to match the name of the
> upstream repo?
>

I agree. Arch (who have no package for nginx-accept-language-module)
change their various nginx module package names to be more consistent,
I think, but this is not necessary in Guix, I think.


On Fri, Nov 01, 2019 at 03:58:43PM +0100, Ludovic Courtès wrote:
Toggle quote (4 lines)
> Regarding the build system of nginx modules, we’ll see when
> we have more than one module packaged. :-)
>

Good. This module is not typical and writing a build system would be
difficult now.

Regards,
Florian
From b6da504736866bae655e2b4025729345e1ea19b7 Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Sat, 2 Nov 2019 13:13:01 +0100
Subject: [PATCH 1/3] doc: Add warning on the '--source' build option when
linking statically.

* doc/guix.texi (Additional Build Options): Add warning.
---
doc/guix.texi | 6 ++++++
1 file changed, 6 insertions(+)

Toggle diff (19 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index da2423b422..30b69d8869 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8328,6 +8328,12 @@ The returned source tarball is the result of applying any patches and
code snippets specified in the package @code{origin} (@pxref{Defining
Packages}).
+Note that for statically linked packages, @command{guix build -S} will
+@emph{not} return the complete and corresponding sources since these
+would include the sources of statically linked dependencies. In this
+case, when distributing sources for license compliance, you may want to
+play it safe and use the following @code{--sources} option instead.
+
@item --sources
Fetch and return the source of @var{package-or-derivation} and all their
dependencies, recursively. This is a handy way to obtain a local copy
--
2.23.0
From 250ae2011ac1c976508136e9f50cb04e6ab5f23c Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Sat, 2 Nov 2019 14:05:30 +0100
Subject: [PATCH 3/3] services: Make it possible to include dynamic modules in
nginx.

* gnu/services/web.scm (<nginx-configuration>): Add modules field.
(nginx-configuration-modules): New field accessor.
(emit-load-module): New procedure.
(default-nginx-config): Add support for the modules field.
* doc/guix.texi (NGINX): Document it.
---
doc/guix.texi | 4 ++++
gnu/services/web.scm | 8 ++++++++
2 files changed, 12 insertions(+)

Toggle diff (70 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 30b69d8869..898123da2b 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19770,6 +19770,10 @@ use the size of the processors cache line.
@item @code{server-names-hash-bucket-max-size} (default: @code{#f})
Maximum bucket size for the server names hash tables.
+@item @code{modules} (default: @code{'()})
+List of nginx dynamic modules to load. Should be a list of strings or
+string valued G-expressions.
+
@item @code{extra-content} (default: @code{""})
Extra content for the @code{http} block. Should be string or a string
valued G-expression.
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 899be1c168..896d06eb18 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -9,6 +9,7 @@
;;; Copyright � 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
;;; Copyright � 2017, 2018, 2019 Christopher Baines <mail@cbaines.net>
;;; Copyright � 2018 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright � 2019 Florian Pelz <pelzflorian@pelzflorian.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -95,6 +96,7 @@
nginx-configuration-upstream-blocks
nginx-configuration-server-names-hash-bucket-size
nginx-configuration-server-names-hash-bucket-max-size
+ nginx-configuration-modules
nginx-configuration-extra-content
nginx-configuration-file
@@ -522,6 +524,7 @@
(default #f))
(server-names-hash-bucket-max-size nginx-configuration-server-names-hash-bucket-max-size
(default #f))
+ (modules nginx-configuration-modules (default '()))
(extra-content nginx-configuration-extra-content
(default ""))
(file nginx-configuration-file ;#f | string | file-like
@@ -542,6 +545,9 @@ of index files."
((? string? str) (list str " ")))
names))
+(define (emit-load-module module)
+ (list "load_module " module ";\n"))
+
(define emit-nginx-location-config
(match-lambda
(($ <nginx-location-configuration> uri body)
@@ -615,12 +621,14 @@ of index files."
server-blocks upstream-blocks
server-names-hash-bucket-size
server-names-hash-bucket-max-size
+ modules
extra-content)
(apply mixed-text-file "nginx.conf"
(flatten
"user nginx nginx;\n"
"pid " run-directory "/pid;\n"
"error_log " log-directory "/error.log info;\n"
+ (map emit-load-module modules)
"http {\n"
" client_body_temp_path " run-directory "/client_body_temp;\n"
" proxy_temp_path " run-directory "/proxy_temp;\n"
--
2.23.0
L
L
Ludovic Courtès wrote on 4 Nov 2019 18:19
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87ftj38spn.fsf@gnu.org
Hi,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (34 lines)
> On Fri, Nov 01, 2019 at 03:54:42PM +0100, Ludovic Courtès wrote:
>> > + (modules '((guix build utils)
>> > + (ice-9 popen)))
>> > + (snippet
>> > + #~(begin
>> > + ;; the nginx source code is part of the module’s source
>> > + (format #t "decompressing nginx source code~%")
>> > + (call-with-output-file "nginx.tar"
>> > + (lambda (out)
>> > + (let ((pipe (open-pipe* OPEN_READ
>> > + #+(file-append gzip "/bin/gzip") "-cd"
>> > + #$(package-source nginx))))
>> > + (dump-port pipe out)
>> > + (unless (= (status:exit-val (close-pipe pipe)) 0)
>> > + (error "gzip decompress failed")))))
>> > + (invoke #+(file-append tar "/bin/tar") "xvf" "nginx.tar"
>> > + "--strip-components=1")
>> > + (delete-file "nginx.tar")
>>
>> I’d suggest doing it in a phase.
>
> This changes many things. :)
>
> With a phase, `guix build -S` would only return the source files of
> nginx-accept-language-module directly but not of statically linked
> nginx. I have added a further patch to doc/guix.texi warning of `guix
> build -S` not always returning complete and corresponding sources, see
> attachment.
>
> The good thing is that with a phase I no longer get an import cycle
> because I no longer need a reference to the tar package. So I put
> nginx-accept-language-module inside web.scm now and there is no need
> for a separate module.

Good!

Toggle quote (13 lines)
>> > + (license (delete-duplicates
>> > + (cons license:bsd-2 ;license of nginx-mod-accept-language
>> > + (package-license nginx))))))) ;the module’s code is linked
>>
>> To avoid circular dependencies in top-level references, I suggest
>> copying the license of ‘nginx’ instead of writing (package-license
>> nginx).
>>
>
> I believe this is no longer an issue now that
> nginx-accept-language-module is in the same Guile module as nginx, is
> it?

You’re right: it’s no longer an issue.

Toggle quote (21 lines)
>> > +++ b/gnu/packages/web-xyz.scm
>> > @@ -0,0 +1,175 @@
>> > +;;; GNU Guix --- Functional package management for GNU
>> > +;;;; TODO should I really add copyright lines for people I copied from??
>> > +;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
>> > +;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
>> > +;;; Copyright © 2017, 2018 Marius Bakke <mbakke@fastmail.com>
>>
>> I don’t think you need to add these 3 lines here; the package definition
>> is yours.
>>
>
> This does not matter anymore after putting
> nginx-accept-language-module in the same Guile module file as nginx.
>
> In general though: IANAL but I have largely copied nginx’ configure
> phase, so at least Mark would surely have copyright on parts of it.
> However I believe copyright lines have limited legal significance
> anyway and adding these authorship lines in a file not added by Mark
> seems unreasonable.

Agreed.

Toggle quote (9 lines)
>> […]
>> Perhaps “nginx-accept-language-module”, to match the name of the
>> upstream repo?
>>
>
> I agree. Arch (who have no package for nginx-accept-language-module)
> change their various nginx module package names to be more consistent,
> I think, but this is not necessary in Guix, I think.

For Guix the general rule is to follow upstream (info "(guix) Package
Naming").

Toggle quote (25 lines)
> From b6da504736866bae655e2b4025729345e1ea19b7 Mon Sep 17 00:00:00 2001
> From: Florian Pelz <pelzflorian@pelzflorian.de>
> Date: Sat, 2 Nov 2019 13:13:01 +0100
> Subject: [PATCH 1/3] doc: Add warning on the '--source' build option when
> linking statically.
>
> * doc/guix.texi (Additional Build Options): Add warning.
> ---
> doc/guix.texi | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index da2423b422..30b69d8869 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -8328,6 +8328,12 @@ The returned source tarball is the result of applying any patches and
> code snippets specified in the package @code{origin} (@pxref{Defining
> Packages}).
>
> +Note that for statically linked packages, @command{guix build -S} will
> +@emph{not} return the complete and corresponding sources since these
> +would include the sources of statically linked dependencies. In this
> +case, when distributing sources for license compliance, you may want to
> +play it safe and use the following @code{--sources} option instead.

I don’t think this bit is necessary: ‘-S’ is documented to return “the
source of the package” and that’s exactly what it does; static
vs. dynamic linking is not a concern at this level, as I see it.

WDYT?

Toggle quote (7 lines)
> From 21e6064f42defad1e2d35bbf95a4825fec9e4615 Mon Sep 17 00:00:00 2001
> From: Florian Pelz <pelzflorian@pelzflorian.de>
> Date: Sat, 2 Nov 2019 12:43:47 +0100
> Subject: [PATCH 2/3] gnu: Add Nginx Accept Language module.
>
> * gnu/packages/web.scm (nginx-accept-language-module): New public variable.

LGTM!

Thanks for taking the time to rewrite the snippet as a build phase.

Toggle quote (28 lines)
> From 250ae2011ac1c976508136e9f50cb04e6ab5f23c Mon Sep 17 00:00:00 2001
> From: Florian Pelz <pelzflorian@pelzflorian.de>
> Date: Sat, 2 Nov 2019 14:05:30 +0100
> Subject: [PATCH 3/3] services: Make it possible to include dynamic modules in
> nginx.
>
> * gnu/services/web.scm (<nginx-configuration>): Add modules field.
> (nginx-configuration-modules): New field accessor.
> (emit-load-module): New procedure.
> (default-nginx-config): Add support for the modules field.
> * doc/guix.texi (NGINX): Document it.
> ---
> doc/guix.texi | 4 ++++
> gnu/services/web.scm | 8 ++++++++
> 2 files changed, 12 insertions(+)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index 30b69d8869..898123da2b 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -19770,6 +19770,10 @@ use the size of the processors cache line.
> @item @code{server-names-hash-bucket-max-size} (default: @code{#f})
> Maximum bucket size for the server names hash tables.
>
> +@item @code{modules} (default: @code{'()})
> +List of nginx dynamic modules to load. Should be a list of strings or
> +string valued G-expressions.

Then… how does nginx find the module in question, specifically the
‘nginx-accept-language-module’ package? One has to specify
‘nginx-accept-language-module’ as the nginx package to use, is that
right? (I had overlooked that before.)

What about adding an example with the ‘accept-language’ module?

Thank you!

Ludo’.
P
P
pelzflorian (Florian Pelz) wrote on 5 Nov 2019 08:31
(name . Ludovic Courtès)(address . ludo@gnu.org)
20191105073130.j5eft6jgqhkcnqf3@pelzflorian.localdomain
On Mon, Nov 04, 2019 at 06:19:32PM +0100, Ludovic Courtès wrote:
Toggle quote (15 lines)
> "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
> > On Fri, Nov 01, 2019 at 03:54:42PM +0100, Ludovic Courtès wrote:
> >> […]
> >> Perhaps “nginx-accept-language-module”, to match the name of the
> >> upstream repo?
> >>
> >
> > I agree. Arch (who have no package for nginx-accept-language-module)
> > change their various nginx module package names to be more consistent,
> > I think, but this is not necessary in Guix, I think.
>
> For Guix the general rule is to follow upstream (info "(guix) Package
> Naming").
>

Makes sense. I agree the general rule is appropriate here.



Toggle quote (20 lines)
> > From: Florian Pelz <pelzflorian@pelzflorian.de>
> > Date: Sat, 2 Nov 2019 13:13:01 +0100
> > Subject: [PATCH 1/3] doc: Add warning on the '--source' build option when
> > linking statically.
> >
> > * doc/guix.texi (Additional Build Options): Add warning.
> > […]
> > +Note that for statically linked packages, @command{guix build -S} will
> > +@emph{not} return the complete and corresponding sources since these
> > +would include the sources of statically linked dependencies. In this
> > +case, when distributing sources for license compliance, you may want to
> > +play it safe and use the following @code{--sources} option instead.
>
> I don’t think this bit is necessary: ‘-S’ is documented to return “the
> source of the package” and that’s exactly what it does; static
> vs. dynamic linking is not a concern at this level, as I see it.
>
> WDYT?
>

I guess the meaning of `guix build -S` is not clear enough. Let me
make an alternative proposal (attached).



Toggle quote (23 lines)
> > From: Florian Pelz <pelzflorian@pelzflorian.de>
> > Date: Sat, 2 Nov 2019 14:05:30 +0100
> > Subject: [PATCH 3/3] services: Make it possible to include dynamic modules in
> > nginx.
> >
> > * gnu/services/web.scm (<nginx-configuration>): Add modules field.
> > (nginx-configuration-modules): New field accessor.
> > (emit-load-module): New procedure.
> > (default-nginx-config): Add support for the modules field.
> > * doc/guix.texi (NGINX): Document it.
> > […]
> > +@item @code{modules} (default: @code{'()})
> > +List of nginx dynamic modules to load. Should be a list of strings or
> > +string valued G-expressions.
>
> Then… how does nginx find the module in question, specifically the
> ‘nginx-accept-language-module’ package? One has to specify
> ‘nginx-accept-language-module’ as the nginx package to use, is that
> right? (I had overlooked that before.)
>
> What about adding an example with the ‘accept-language’ module?
>

Of course you are right. I attach a patch with only a changed
doc/guix.texi. I do not attach again the
nginx-accept-language-module.

Are these proposals OK? Shall I push the three patches?

Regards,
Florian
From 3bbdd2dc4c983ca8bbf31cd348b64f1d60a51ee5 Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Tue, 5 Nov 2019 08:22:04 +0100
Subject: [PATCH 01/13] doc: Explain more licensing aspects of the '--source'
build option.

* doc/guix.texi (Additional Build Options): Explain more.
---
doc/guix.texi | 7 +++++++
1 file changed, 7 insertions(+)

Toggle diff (20 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index da2423b422..b4ad9d846a 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8328,6 +8328,13 @@ The returned source tarball is the result of applying any patches and
code snippets specified in the package @code{origin} (@pxref{Defining
Packages}).
+Note that @command{guix build -S} compiles the sources only of the
+specified package. They do not include the sources of statically linked
+dependencies, dynamically linked dependencies, or any other
+dependencies. When distributing complete corresponding sources for
+license compliance, you may want to play it safe and use the following
+@code{--sources} option instead.
+
@item --sources
Fetch and return the source of @var{package-or-derivation} and all their
dependencies, recursively. This is a handy way to obtain a local copy
--
2.23.0
From 04df1e5ee3fd542776b13eb3a59872e1647eb5f8 Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Tue, 5 Nov 2019 08:08:20 +0100
Subject: [PATCH 03/13] services: Make it possible to include dynamic modules
in nginx.

* gnu/services/web.scm (<nginx-configuration>): Add modules field.
(nginx-configuration-modules): New field accessor.
(emit-load-module): New procedure.
(default-nginx-config): Add support for the modules field.
* doc/guix.texi (NGINX): Document it.
---
doc/guix.texi | 11 +++++++++++
gnu/services/web.scm | 8 ++++++++
2 files changed, 19 insertions(+)

Toggle diff (77 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index b4ad9d846a..11cdc1ae83 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -19771,6 +19771,17 @@ use the size of the processors cache line.
@item @code{server-names-hash-bucket-max-size} (default: @code{#f})
Maximum bucket size for the server names hash tables.
+@item @code{modules} (default: @code{'()})
+List of nginx dynamic modules to load. Should be a list of strings or
+string valued G-expressions. For example:
+
+@lisp
+(modules
+ (list
+ (file-append nginx-accept-language-module "\
+/etc/nginx/modules/ngx_http_accept_language_module.so")))
+@end lisp
+
@item @code{extra-content} (default: @code{""})
Extra content for the @code{http} block. Should be string or a string
valued G-expression.
diff --git a/gnu/services/web.scm b/gnu/services/web.scm
index 899be1c168..896d06eb18 100644
--- a/gnu/services/web.scm
+++ b/gnu/services/web.scm
@@ -9,6 +9,7 @@
;;; Copyright � 2018 Pierre-Antoine Rouby <pierre-antoine.rouby@inria.fr>
;;; Copyright � 2017, 2018, 2019 Christopher Baines <mail@cbaines.net>
;;; Copyright � 2018 Marius Bakke <mbakke@fastmail.com>
+;;; Copyright � 2019 Florian Pelz <pelzflorian@pelzflorian.de>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -95,6 +96,7 @@
nginx-configuration-upstream-blocks
nginx-configuration-server-names-hash-bucket-size
nginx-configuration-server-names-hash-bucket-max-size
+ nginx-configuration-modules
nginx-configuration-extra-content
nginx-configuration-file
@@ -522,6 +524,7 @@
(default #f))
(server-names-hash-bucket-max-size nginx-configuration-server-names-hash-bucket-max-size
(default #f))
+ (modules nginx-configuration-modules (default '()))
(extra-content nginx-configuration-extra-content
(default ""))
(file nginx-configuration-file ;#f | string | file-like
@@ -542,6 +545,9 @@ of index files."
((? string? str) (list str " ")))
names))
+(define (emit-load-module module)
+ (list "load_module " module ";\n"))
+
(define emit-nginx-location-config
(match-lambda
(($ <nginx-location-configuration> uri body)
@@ -615,12 +621,14 @@ of index files."
server-blocks upstream-blocks
server-names-hash-bucket-size
server-names-hash-bucket-max-size
+ modules
extra-content)
(apply mixed-text-file "nginx.conf"
(flatten
"user nginx nginx;\n"
"pid " run-directory "/pid;\n"
"error_log " log-directory "/error.log info;\n"
+ (map emit-load-module modules)
"http {\n"
" client_body_temp_path " run-directory "/client_body_temp;\n"
" proxy_temp_path " run-directory "/proxy_temp;\n"
--
2.23.0
P
P
pelzflorian (Florian Pelz) wrote on 5 Nov 2019 12:11
(name . Ludovic Courtès)(address . ludo@gnu.org)
20191105111112.xfryncx6ut3ggqaj@pelzflorian.localdomain
On Tue, Nov 05, 2019 at 08:31:30AM +0100, pelzflorian (Florian Pelz) wrote:
Toggle quote (3 lines)
> +Note that @command{guix build -S} compiles the sources only of the
> +specified package.

Another try, I changed s/package/packages/ (attached).

Regards,
Florian
From a5d9180d960d244053bea0d59d6092060fe4c6dd Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Tue, 5 Nov 2019 12:08:54 +0100
Subject: [PATCH 01/13] doc: Explain more licensing aspects of the '--source'
build option.

* doc/guix.texi (Additional Build Options): Explain more.
---
doc/guix.texi | 7 +++++++
1 file changed, 7 insertions(+)

Toggle diff (20 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index da2423b422..d8886fa494 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8328,6 +8328,13 @@ The returned source tarball is the result of applying any patches and
code snippets specified in the package @code{origin} (@pxref{Defining
Packages}).
+Note that @command{guix build -S} compiles the sources only of the
+specified packages. They do not include the sources of statically
+linked dependencies, dynamically linked dependencies, or any other
+dependencies. When distributing complete corresponding sources for
+license compliance, you may want to play it safe and use the following
+@code{--sources} option instead.
+
@item --sources
Fetch and return the source of @var{package-or-derivation} and all their
dependencies, recursively. This is a handy way to obtain a local copy
--
2.23.0
L
L
Ludovic Courtès wrote on 6 Nov 2019 15:49
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
878sot2h6d.fsf@gnu.org
Hi!

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (12 lines)
> From 04df1e5ee3fd542776b13eb3a59872e1647eb5f8 Mon Sep 17 00:00:00 2001
> From: Florian Pelz <pelzflorian@pelzflorian.de>
> Date: Tue, 5 Nov 2019 08:08:20 +0100
> Subject: [PATCH 03/13] services: Make it possible to include dynamic modules
> in nginx.
>
> * gnu/services/web.scm (<nginx-configuration>): Add modules field.
> (nginx-configuration-modules): New field accessor.
> (emit-load-module): New procedure.
> (default-nginx-config): Add support for the modules field.
> * doc/guix.texi (NGINX): Document it.

[…]

Toggle quote (4 lines)
> +@item @code{modules} (default: @code{'()})
> +List of nginx dynamic modules to load. Should be a list of strings or
> +string valued G-expressions. For example:

Nitpick: I’d replace “Should be […] For example:” by “This should be a
list of file names of loadable modules, as in this example:”.

Otherwise LGTM!

Ludo’.
L
L
Ludovic Courtès wrote on 6 Nov 2019 15:56
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87k18d12a7.fsf@gnu.org
Hi,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (26 lines)
> From a5d9180d960d244053bea0d59d6092060fe4c6dd Mon Sep 17 00:00:00 2001
> From: Florian Pelz <pelzflorian@pelzflorian.de>
> Date: Tue, 5 Nov 2019 12:08:54 +0100
> Subject: [PATCH 01/13] doc: Explain more licensing aspects of the '--source'
> build option.
>
> * doc/guix.texi (Additional Build Options): Explain more.
> ---
> doc/guix.texi | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/doc/guix.texi b/doc/guix.texi
> index da2423b422..d8886fa494 100644
> --- a/doc/guix.texi
> +++ b/doc/guix.texi
> @@ -8328,6 +8328,13 @@ The returned source tarball is the result of applying any patches and
> code snippets specified in the package @code{origin} (@pxref{Defining
> Packages}).
>
> +Note that @command{guix build -S} compiles the sources only of the
> +specified packages. They do not include the sources of statically
> +linked dependencies, dynamically linked dependencies, or any other
> +dependencies. When distributing complete corresponding sources for
> +license compliance, you may want to play it safe and use the following
> +@code{--sources} option instead.

I don’t feel strongly about it, but to me, this is a discussion and thus
not quite in line with the style of this section as a reference of ‘guix
build’ options.

As far as the discussion goes :-), I’d argue that the Corresponding
Source in the spirit of the GPL is the derivation rather than what
‘--sources’ returns, since the Corresponding Source should include
“build scripts”. I would argue that only functional package managers
are able to support such a strong notion of Corresponding Source.

Long story short: the discussion is not clear-cut and I’m not sure it
belongs here. :-)

Thoughts?

Thanks,
Ludo’.
P
P
pelzflorian (Florian Pelz) wrote on 6 Nov 2019 19:21
(name . Ludovic Courtès)(address . ludo@gnu.org)
20191106182149.sf77445jeflgqgca@pelzflorian.localdomain
On Wed, Nov 06, 2019 at 03:49:46PM +0100, Ludovic Courtès wrote:
Toggle quote (7 lines)
> Nitpick: I’d replace “Should be […] For example:” by “This should be a
> list of file names of loadable modules, as in this example:”.
>
> Otherwise LGTM!
>
> Ludo’.

I agree. Thank you! I copied your wording verbatim and will push
the nginx patches tomorrow.

Regards,
Florian
P
P
pelzflorian (Florian Pelz) wrote on 6 Nov 2019 19:30
(name . Ludovic Courtès)(address . ludo@gnu.org)
20191106183015.uivozksjlxx4krw5@pelzflorian.localdomain
On Wed, Nov 06, 2019 at 03:56:48PM +0100, Ludovic Courtès wrote:
Toggle quote (18 lines)
> I don’t feel strongly about it, but to me, this is a discussion and thus
> not quite in line with the style of this section as a reference of ‘guix
> build’ options.
>
> As far as the discussion goes :-), I’d argue that the Corresponding
> Source in the spirit of the GPL is the derivation rather than what
> ‘--sources’ returns, since the Corresponding Source should include
> “build scripts”. I would argue that only functional package managers
> are able to support such a strong notion of Corresponding Source.
>
> Long story short: the discussion is not clear-cut and I’m not sure it
> belongs here. :-)
>
> Thoughts?
>
> Thanks,
> Ludo’.

Well said. You convinced me not to make a recommendation. Thank you.
I still was surprised about `guix build -S` so I attach a new
proposal.

Regards,
Florian
From c9f7b2739392e0d8cf2afa6b2179b2e138c49bc7 Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Wed, 6 Nov 2019 19:28:57 +0100
Subject: [PATCH] doc: Add clarification on the '--source' build option.

Emphasize that what the '--source' build option downloads is insufficient for
reproducing the packages.

* doc/guix.texi (Additional Build Options): Explain more.
---
doc/guix.texi | 5 +++++
1 file changed, 5 insertions(+)

Toggle diff (18 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index 30706d9ddd..58b8e41ab4 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8336,6 +8336,11 @@ The returned source tarball is the result of applying any patches and
code snippets specified in the package @code{origin} (@pxref{Defining
Packages}).
+Note that @command{guix build -S} compiles the sources only of the
+specified packages. They do not include the sources of statically
+linked dependencies and by themselves are insufficient for reproducing
+the packages.
+
@item --sources
Fetch and return the source of @var{package-or-derivation} and all their
dependencies, recursively. This is a handy way to obtain a local copy
--
2.23.0
L
L
Ludovic Courtès wrote on 7 Nov 2019 21:24
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87lfsrph98.fsf@gnu.org
Hello Florian,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (10 lines)
> From c9f7b2739392e0d8cf2afa6b2179b2e138c49bc7 Mon Sep 17 00:00:00 2001
> From: Florian Pelz <pelzflorian@pelzflorian.de>
> Date: Wed, 6 Nov 2019 19:28:57 +0100
> Subject: [PATCH] doc: Add clarification on the '--source' build option.
>
> Emphasize that what the '--source' build option downloads is insufficient for
> reproducing the packages.
>
> * doc/guix.texi (Additional Build Options): Explain more.

Alrighty, LGTM!

Thank you,
Ludo’.
P
P
pelzflorian (Florian Pelz) wrote on 8 Nov 2019 10:02
(name . 26302)(address . 26302@debbugs.gnu.org)
20191108090216.koews3r74rdeszzy@pelzflorian.localdomain
After Ludo’s reviews I’ve pushed and rebased everything again. What
is missing is making nginx redirect accesses only to html files to
their localized version if one exists. This would mean the
non-localized URLs remain valid and their use could be continued.

I would prefer if someone familiar with nginx could help here.

I have not researched enough to know how to redirect index files in
nginx, i.e. https://guix.gnu.org/contribute/should serve
de/contribute/index.html.

The nginx accept language module can determine if it should redirect
to de or en like this:

Toggle diff (40 lines)
diff --git a/hydra/nginx/berlin.scm b/hydra/nginx/berlin.scm
index 2947759..8b83d1e 100644
--- a/hydra/nginx/berlin.scm
+++ b/hydra/nginx/berlin.scm
@@ -468,6 +468,13 @@ PUBLISH-URL."
(uri "/guix")
(body (list "root /var/www;")))
+ (nginx-location-configuration
+ (uri "~ (.html|.htm)$")
+ (body (list
+ ;; put en first so it is the default:
+ "set_from_accept_language $lang en de;"
+ "try_files /$lang/$uri $uri =404;")))
+
(nginx-location-configuration ;certbot
(uri "/.well-known")
(body (list "root /var/www;")))))
@@ -767,5 +774,11 @@ PUBLISH-URL."
(define %nginx-configuration
(nginx-configuration
(server-blocks %berlin-servers)
+ (load-modules
+ (list
+ ;; We need this module for redirecting users to the localized
+ ;; website of their choice.
+ (file-append nginx-mod-accept-language "\
+/etc/nginx/modules/ngx_http_accept_language_module.so")))
(extra-content
(string-join %extra-content "\n"))))


Another thing is that perhaps the CSS margin of the .menu-item:link
elements in the navbar should be reduced. What do you think:

https://guix.gnu.org/.i18n/de/
https://guix.gnu.org/.i18n/en/

Regards,
Florian
S
S
sirgazil wrote on 8 Nov 2019 15:01
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
16e4b51b930.ad730bc54001.4023639419427743172@zoho.com
Hi, Florian :)

---- On Fri, 08 Nov 2019 04:02:16 -0500 pelzflorian (Florian Pelz) <pelzflorian@pelzflorian.de> wrote ----

> Another thing is that perhaps the CSS margin of the .menu-item:link
> elements in the navbar should be reduced. What do you think:
>

Yes. For now, I think "margin: 0px 2px" would be ok.

However, I noticed that the items with dropdown menus in https://guix.gnu.org/.i18n/de/don't seem to have horizontal margin, while the rest of the items do. So the space between items is different, which also results in the items with subitems not aligning well with the other menu items in the narrow screen presentation.

But now that the width of the menu will vary depending on each language, the whole menu bar will probably have to be redesigned.
P
P
pelzflorian (Florian Pelz) wrote on 8 Nov 2019 17:18
(name . sirgazil)(address . sirgazil@zoho.com)
20191108161828.t5g6zua3r7y56n7y@pelzflorian.localdomain
On Fri, Nov 08, 2019 at 09:01:17AM -0500, sirgazil wrote:
Toggle quote (13 lines)
> Hi, Florian :)
>
> ---- On Fri, 08 Nov 2019 04:02:16 -0500 pelzflorian (Florian Pelz) <pelzflorian@pelzflorian.de> wrote ----
>
> > Another thing is that perhaps the CSS margin of the .menu-item:link
> > elements in the navbar should be reduced. What do you think:
> >
> > https://guix.gnu.org/.i18n/de/
> > https://guix.gnu.org/.i18n/en/
>
> Yes. For now, I think "margin: 0px 2px" would be ok.
> […]

I changed it now, also for the dropdowns. The change is online now
that the website was rebuilt.


Toggle quote (4 lines)
> But now that the width of the menu will vary depending on each
> language, the whole menu bar will probably have to be redesigned.
>

German is slightly wider than English and Chinese will be slightly
smaller. Hopefully it won’t matter, otherwise the navbar could be put
in a div container with display: flex; or something for spacing
between elements.

Regards,
Florian
P
P
pelzflorian (Florian Pelz) wrote on 8 Nov 2019 17:20
(name . sirgazil)(address . sirgazil@zoho.com)
20191108162023.3ylapo5qufzm52yi@pelzflorian.localdomain
On Fri, Nov 08, 2019 at 05:18:29PM +0100, pelzflorian (Florian Pelz) wrote:
Toggle quote (2 lines)
> I changed it now, also for the dropdowns.

Oops, dropdowns are not quite right yet.
P
P
pelzflorian (Florian Pelz) wrote on 8 Nov 2019 18:13
(name . sirgazil)(address . sirgazil@zoho.com)(name . 26302)(address . 26302@debbugs.gnu.org)
20191108171356.ewbc2navzgmxmedy@pelzflorian.localdomain
On Fri, Nov 08, 2019 at 05:18:28PM +0100, pelzflorian (Florian Pelz) wrote:
Toggle quote (5 lines)
> I changed it now, also for the dropdowns. The change is online now
> that the website was rebuilt.
>
>

Dropdowns are fixed for real now.


Toggle quote (10 lines)
> > But now that the width of the menu will vary depending on each
> > language, the whole menu bar will probably have to be redesigned.
> >
>
> German is slightly wider than English and Chinese will be slightly
> smaller. Hopefully it won’t matter, otherwise the navbar could be put
> in a div container with display: flex; or something for spacing
> between elements.
>

For example, the navbar could be given a width

<nav class="menu" style="width: 100%;">

and the ul inside could be given display:flex and justify-content

<ul style="display: flex;justify-content: space-between;">

Or not. Maybe it is good as it is.

Regards,
Florian
S
S
sirgazil wrote on 8 Nov 2019 19:39
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)(name . 26302)(address . 26302@debbugs.gnu.org)
16e4c50dfd1.d8cdd5c68419.2294583614489230958@zoho.com
---- On Fri, 08 Nov 2019 12:13:56 -0500 pelzflorian (Florian Pelz) <pelzflorian@pelzflorian.de> wrote ----

> > German is slightly wider than English and Chinese will be slightly
> > smaller. Hopefully it won’t matter, otherwise the navbar could be put
> > in a div container with display: flex; or something for spacing
> > between elements.
> >
>
> For example, the navbar could be given a width
>
> <nav class="menu" style="width: 100%;">
>
> and the ul inside could be given display:flex and justify-content
>
> <ul style="display: flex;justify-content: space-between;">
>
> Or not. Maybe it is good as it is.


Or we could wait until there is a visible problem :)

Eventually, it would be good to update the layout-related CSS of the website to use flex and grid when appropriate. Maybe for another iteration :)
P
P
pelzflorian (Florian Pelz) wrote on 17 Nov 2019 17:17
(name . 26302)(address . 26302@debbugs.gnu.org)
20191117161702.bfmuiukhyacbukqf@pelzflorian.localdomain
First on serving the internationalized website:

The following changes to maintenance:berlin redirect requests for old
URLs properly *only for non-HTTPS* in local testing on a vm-image. I
assume the same will work when added for the HTTPS location, though
perhaps the line "set_from_accept_language $lang en de;" cannot or
need not be duplicated for both non-HTTPS and HTTPS. I hope the
changes are compatible with the manual and cookbook URLs. The changes
would better be tested more but I do not know how.


Toggle diff (65 lines)
diff --git a/hydra/nginx/berlin.scm b/hydra/nginx/berlin.scm
index 2947759..8b66ba7 100644
--- a/hydra/nginx/berlin.scm
+++ b/hydra/nginx/berlin.scm
@@ -468,6 +468,10 @@ PUBLISH-URL."
(uri "/guix")
(body (list "root /var/www;")))
+ (nginx-location-configuration
+ (uri "~ (.html|.htm)$")
+ (body (list "try_files /$lang/$uri $uri =404;")))
+
(nginx-location-configuration ;certbot
(uri "/.well-known")
(body (list "root /var/www;")))))
@@ -505,6 +509,9 @@ PUBLISH-URL."
(root "/home/rekado/bootstrappable.org")
(raw-content
(list
+ "rewrite (.*)/$ $1/index.html;"
+ ;; put en first so it is the default:
+ "set_from_accept_language $lang en de;"
"access_log /var/log/nginx/bootstrappable.access.log;")))
(nginx-server-configuration
@@ -767,5 +774,11 @@ PUBLISH-URL."
(define %nginx-configuration
(nginx-configuration
(server-blocks %berlin-servers)
+ (modules
+ (list
+ ;; We need this module for redirecting users to the localized
+ ;; website of their choice.
+ (file-append nginx-accept-language-module "\
+/etc/nginx/modules/ngx_http_accept_language_module.so")))
(extra-content
(string-join %extra-content "\n"))))



I attach a complete patch that can only be used for testing on a local
VM. For testing, I perform the following steps:

cd ~/git/maintenance/hydra/
GUILE_LOAD_PATH=$(readlink -f ~/git/maintenance/hydra/modules):$GUILE_LOAD_PATH guix system vm-image --image-size=14G berlin.scm --fallback
cp /gnu/store/mm000wdzkzrvalg09jxk0y6nhi9c4iai-qemu-image berlin1.img
guix gc -D /gnu/store/mm000wdzkzrvalg09jxk0y6nhi9c4iai-qemu-image
chmod +w berlin1.img
qemu-system-x86_64 -enable-kvm berlin1.img -m 2048 -nic tap,ifname=tap0,script=no,downscript=no

Note that I use NetworkManager with dnsmasq for a tap0 host-to-guest
network connection as specified in the Guix manual.

---

Second, unrelated to serving the website:

I also noticed that Microsoft Internet Explorer 11 cannot display the
new accessible dropdowns on https://guix.gnu.org/.i18n/en. Do we
care? Perhaps the use of CSS z-index causes the problems. The
previous dropdowns used display: none; which made the dropdowns
not-keyboard navigable.

Regards,
Florian
P
P
pelzflorian (Florian Pelz) wrote on 2 Dec 2019 09:57
(name . 26302)(address . 26302@debbugs.gnu.org)
20191202085745.o3yh3uqwdbi4fuji@pelzflorian.localdomain
On Sun, Nov 17, 2019 at 05:17:02PM +0100, pelzflorian (Florian Pelz) wrote:
Toggle quote (3 lines)
> I also noticed that Microsoft Internet Explorer 11 cannot display the
> new accessible dropdowns on https://guix.gnu.org/.i18n/en.

The issue was IE11 does not support the CSS value “initial”. I pushed
a new version. I tested IE11 and it works now.

I believe doing the changes I described in my past email (which I am
responding to) both for the HTTP and HTTPS location will give us a
working translatable website and preserve all URLs. The
set_from_accept_language line probably need not and cannot be
specified for both locations though, once is enough, I think (perhaps
in extra-content).

Regards,
Florian
L
L
Ludovic Courtès wrote on 25 Mar 2020 18:33
Deploying the i18n’d web site
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87d090ibk5.fsf_-_@gnu.org
Hi Florian,

We dropped the ball on this, but it looks like we were close to the
finish line.

What would it take to complete the i18n’d web site deployment? It would
be great to get that done by the time of the next release.

Thanks!

Ludo’.

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (76 lines)
> First on serving the internationalized website:
>
> The following changes to maintenance:berlin redirect requests for old
> URLs properly *only for non-HTTPS* in local testing on a vm-image. I
> assume the same will work when added for the HTTPS location, though
> perhaps the line "set_from_accept_language $lang en de;" cannot or
> need not be duplicated for both non-HTTPS and HTTPS. I hope the
> changes are compatible with the manual and cookbook URLs. The changes
> would better be tested more but I do not know how.
>
>
> diff --git a/hydra/nginx/berlin.scm b/hydra/nginx/berlin.scm
> index 2947759..8b66ba7 100644
> --- a/hydra/nginx/berlin.scm
> +++ b/hydra/nginx/berlin.scm
> @@ -468,6 +468,10 @@ PUBLISH-URL."
> (uri "/guix")
> (body (list "root /var/www;")))
>
> + (nginx-location-configuration
> + (uri "~ (.html|.htm)$")
> + (body (list "try_files /$lang/$uri $uri =404;")))
> +
> (nginx-location-configuration ;certbot
> (uri "/.well-known")
> (body (list "root /var/www;")))))
> @@ -505,6 +509,9 @@ PUBLISH-URL."
> (root "/home/rekado/bootstrappable.org")
> (raw-content
> (list
> + "rewrite (.*)/$ $1/index.html;"
> + ;; put en first so it is the default:
> + "set_from_accept_language $lang en de;"
> "access_log /var/log/nginx/bootstrappable.access.log;")))
>
> (nginx-server-configuration
> @@ -767,5 +774,11 @@ PUBLISH-URL."
> (define %nginx-configuration
> (nginx-configuration
> (server-blocks %berlin-servers)
> + (modules
> + (list
> + ;; We need this module for redirecting users to the localized
> + ;; website of their choice.
> + (file-append nginx-accept-language-module "\
> +/etc/nginx/modules/ngx_http_accept_language_module.so")))
> (extra-content
> (string-join %extra-content "\n"))))
>
>
>
> I attach a complete patch that can only be used for testing on a local
> VM. For testing, I perform the following steps:
>
> cd ~/git/maintenance/hydra/
> GUILE_LOAD_PATH=$(readlink -f ~/git/maintenance/hydra/modules):$GUILE_LOAD_PATH guix system vm-image --image-size=14G berlin.scm --fallback
> cp /gnu/store/mm000wdzkzrvalg09jxk0y6nhi9c4iai-qemu-image berlin1.img
> guix gc -D /gnu/store/mm000wdzkzrvalg09jxk0y6nhi9c4iai-qemu-image
> chmod +w berlin1.img
> qemu-system-x86_64 -enable-kvm berlin1.img -m 2048 -nic tap,ifname=tap0,script=no,downscript=no
>
> Note that I use NetworkManager with dnsmasq for a tap0 host-to-guest
> network connection as specified in the Guix manual.
>
> ---
>
> Second, unrelated to serving the website:
>
> I also noticed that Microsoft Internet Explorer 11 cannot display the
> new accessible dropdowns on https://guix.gnu.org/.i18n/en. Do we
> care? Perhaps the use of CSS z-index causes the problems. The
> previous dropdowns used display: none; which made the dropdowns
> not-keyboard navigable.
>
> Regards,
> Florian
P
P
pelzflorian (Florian Pelz) wrote on 26 Mar 2020 00:21
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200325232100.ynsy7xog4vt6nq5q@pelzflorian.localdomain
On Wed, Mar 25, 2020 at 06:33:46PM +0100, Ludovic Courtès wrote:
Toggle quote (9 lines)
> Hi Florian,
>
> We dropped the ball on this, but it looks like we were close to the
> finish line.
>
> What would it take to complete the i18n’d web site deployment? It would
> be great to get that done by the time of the next release.
>

set_from_accept_language $lang en de;

would better be a global directive. en comes first so it is the
default.

Otherwise it’s the changes you quoted. Testing is difficult though.
I tested without https and with some modifications to make berlin.scm
work in a virtual machine.

I will try rebasing wip-i18n to current master now.

Regards,
Florian
P
P
pelzflorian (Florian Pelz) wrote on 26 Mar 2020 02:24
Re: bug#26302: Deploying the i18n’d web site
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200326012459.7npj2vuidyvn2dwb@pelzflorian.localdomain
On Thu, Mar 26, 2020 at 12:21:00AM +0100, pelzflorian (Florian Pelz) wrote:
Toggle quote (2 lines)
> I will try rebasing wip-i18n to current master now.

Done.
L
L
Ludovic Courtès wrote on 7 Apr 2020 23:18
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87sghf6lkv.fsf@gnu.org
Hi Florian,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (13 lines)
>> What would it take to complete the i18n’d web site deployment? It would
>> be great to get that done by the time of the next release.
>>
>
> set_from_accept_language $lang en de;
>
> would better be a global directive. en comes first so it is the
> default.
>
> Otherwise it’s the changes you quoted. Testing is difficult though.
> I tested without https and with some modifications to make berlin.scm
> work in a virtual machine.

I had to slightly adjust your changes, leading to the patch below.

I haven’t tested it though. I’m a bit concerned about the rewrite rule,
because there are bits that should not be rewritten, like:

/manual (must not be: /LANG/manual, at least for now)
/guix-refcard.pdf

Will there be rewritten with the config below?

I know you’re already busy with the installer, Florian, so maybe we can
postpone that after the release, unless someone else champions to test it!

Thanks,
Ludo’.
Toggle diff (63 lines)
diff --git a/hydra/nginx/berlin.scm b/hydra/nginx/berlin.scm
index 303fd35..7e329fc 100644
--- a/hydra/nginx/berlin.scm
+++ b/hydra/nginx/berlin.scm
@@ -468,6 +468,10 @@ PUBLISH-URL."
(uri "/guix")
(body (list "root /var/www;")))
+ (nginx-location-configuration
+ (uri "~ (.html|.htm)$")
+ (body (list "try_files /$lang/$uri $uri =404;")))
+
(nginx-location-configuration ;certbot
(uri "/.well-known")
(body (list "root /var/www;")))))
@@ -514,6 +518,8 @@ PUBLISH-URL."
(locations guix.gnu.org-locations)
(raw-content
(list
+ "rewrite (.*)/$ $1/index.html;"
+ "set_from_accept_language $lang en de;"
"access_log /var/log/nginx/guix-info.access.log;")))
(nginx-server-configuration
@@ -525,6 +531,8 @@ PUBLISH-URL."
(append
%tls-settings
(list
+ "rewrite (.*)/$ $1/index.html;"
+ "set_from_accept_language $lang en de;"
"access_log /var/log/nginx/guix-info.https.access.log;"))))
(nginx-server-configuration
@@ -621,6 +629,8 @@ PUBLISH-URL."
(append
%tls-settings
(list
+ "rewrite (.*)/$ $1/index.html;"
+ "set_from_accept_language $lang en de;"
"access_log /var/log/nginx/guix-info.https.access.log;"))))
(nginx-server-configuration
@@ -634,6 +644,8 @@ PUBLISH-URL."
(append
%tls-settings
(list
+ "rewrite (.*)/$ $1/index.html;"
+ "set_from_accept_language $lang en de;"
"access_log /var/log/nginx/guix-gnu-org.https.access.log;"))))
(nginx-server-configuration
@@ -775,6 +787,11 @@ PUBLISH-URL."
(define %nginx-configuration
(nginx-configuration
(server-blocks %berlin-servers)
+ (modules
+ (list
+ ;; Module to redirect users to the localized pages of their choice.
+ (file-append nginx-accept-language-module
+ "/etc/nginx/modules/ngx_http_accept_language_module.so")))
(global-directives
;; This is a 72-core machine, but let's not use all of them for nginx.
'((worker_processes . 16)
P
P
pelzflorian (Florian Pelz) wrote on 8 Apr 2020 00:02
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200407220225.zlw64sywakcajvkt@pelzflorian.localdomain
On Tue, Apr 07, 2020 at 11:18:56PM +0200, Ludovic Courtès wrote:
Toggle quote (9 lines)
> I haven’t tested it though. I’m a bit concerned about the rewrite rule,
> because there are bits that should not be rewritten, like:
>
> /manual (must not be: /LANG/manual, at least for now)
> /guix-refcard.pdf
> …
>
> Will there be rewritten with the config below?

These should be OK. Because it uses try_files, both /en/manual and
/manual should be checked. guix-refcard.pdf does not end in .html and
therefore is not rewritten.

set_from_accept_language should better be a global directive I think.


Toggle quote (7 lines)
> I know you’re already busy with the installer, Florian, so maybe we can
> postpone that after the release, unless someone else champions to test it!
>
> Thanks,
> Ludo’.
>

I will test, but I cannot test if certbot and tls work. But of course
the translated website can wait.

Regards,
Florian
P
P
pelzflorian (Florian Pelz) wrote on 9 Apr 2020 05:21
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200409032146.tm76qkrwwydfadye@pelzflorian.localdomain
On Wed, Apr 08, 2020 at 12:02:25AM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (3 lines)
> set_from_accept_language should better be a global directive I think.
>

No, I was wrong. set_from_accept_language must only appear once, but
not in a global directive. I put it in %extra-content for the
nginx-configuration now. It seems the attached patch works (after
removing the rottlog service), but I could not yet test building the
website i.e. if the redirects really work correctly. It is so slow.

Then again, better break the website before the release than after (if
it does not work). I cannot test tls and certbot anyway.

Regards,
Florian
Toggle diff (148 lines)
diff --git a/hydra/nginx/berlin.scm b/hydra/nginx/berlin.scm
index 303fd35..a57640e 100644
--- a/hydra/nginx/berlin.scm
+++ b/hydra/nginx/berlin.scm
@@ -461,20 +461,24 @@ PUBLISH-URL."
(body (list "alias /srv/guix.gnu.org-i18n;")))
(git-http-nginx-location-configuration
(git-http-configuration))
;; For Hurd bootstrap binaries.
(nginx-location-configuration
(uri "/guix")
(body (list "root /var/www;")))
+ (nginx-location-configuration
+ (uri "~ (.html|.htm)$")
+ (body (list "try_files /$lang/$uri $uri =404;")))
+
(nginx-location-configuration ;certbot
(uri "/.well-known")
(body (list "root /var/www;")))))
(define guix.info-locations
(list (nginx-location-configuration ;certbot
(uri "~ ^/\\.well-known")
(body (list "root /var/www;")))
(nginx-location-configuration
(uri "~ /(.*)")
@@ -507,31 +511,33 @@ PUBLISH-URL."
(list
"access_log /var/log/nginx/bootstrappable.access.log;")))
(nginx-server-configuration
(listen '("80"))
(server-name '("guix.gnu.org"))
(root "/srv/guix.gnu.org")
(locations guix.gnu.org-locations)
(raw-content
(list
+ "rewrite (.*)/$ $1/index.html;"
"access_log /var/log/nginx/guix-info.access.log;")))
(nginx-server-configuration
(listen '("80"))
(server-name '("guix.info"
"www.guix.info"))
(locations guix.info-locations)
(raw-content
(append
%tls-settings
(list
+ "rewrite (.*)/$ $1/index.html;"
"access_log /var/log/nginx/guix-info.https.access.log;"))))
(nginx-server-configuration
(listen '("80"))
(server-name '("issues.guix.info"
"issues.guix.gnu.org"))
(root "/home/rekado/mumi/")
(locations
(list (nginx-location-configuration ;certbot
(uri "/.well-known")
@@ -614,33 +620,35 @@ PUBLISH-URL."
(listen '("443 ssl"))
(server-name '("guix.info"
"www.guix.info"))
(ssl-certificate (le "guix.info"))
(ssl-certificate-key (le "guix.info" 'key))
(locations guix.info-locations)
(raw-content
(append
%tls-settings
(list
+ "rewrite (.*)/$ $1/index.html;"
"access_log /var/log/nginx/guix-info.https.access.log;"))))
(nginx-server-configuration
(listen '("443 ssl"))
(server-name '("guix.gnu.org"))
(ssl-certificate (le "guix.gnu.org"))
(ssl-certificate-key (le "guix.gnu.org" 'key))
(root "/srv/guix.gnu.org")
(locations guix.gnu.org-locations)
(raw-content
(append
%tls-settings
(list
+ "rewrite (.*)/$ $1/index.html;"
"access_log /var/log/nginx/guix-gnu-org.https.access.log;"))))
(nginx-server-configuration
(listen '("443 ssl"))
(server-name '("issues.guix.info"))
(ssl-certificate (le "issues.guix.info"))
(ssl-certificate-key (le "issues.guix.info" 'key))
(root "/home/rekado/mumi/")
(locations
(list (nginx-location-configuration
@@ -710,20 +718,22 @@ PUBLISH-URL."
"proxy_send_timeout 600;"
"proxy_read_timeout 600;"
"send_timeout 600;"
"access_log /var/log/nginx/workflows-guix-info.https.access.log;"))))))
(define %extra-content
(list
"default_type application/octet-stream;"
"sendfile on;"
+ "set_from_accept_language $lang en de;"
+
;; Maximum chunk size to send. Partly this is a workaround for
;; <http://bugs.gnu.org/19939>, but also the nginx docs mention that
;; "Without the limit, one fast connection may seize the worker
;; process entirely."
;; <http://nginx.org/en/docs/http/ngx_http_core_module#sendfile_max_chunk>
"sendfile_max_chunk 1m;"
"keepalive_timeout 65;"
;; Use HTTP 1.1 to talk to the backend so we benefit from keep-alive
@@ -768,20 +778,25 @@ PUBLISH-URL."
"proxy_connect_timeout 7s;"
"proxy_read_timeout 10s;"
"proxy_send_timeout 10s;"
;; Cache timeouts for a little while to avoid increasing pressure.
"proxy_cache_valid 504 30s;"))
(define %nginx-configuration
(nginx-configuration
(server-blocks %berlin-servers)
+ (modules
+ (list
+ ;; Module to redirect users to the localized pages of their choice.
+ (file-append nginx-accept-language-module
+ "/etc/nginx/modules/ngx_http_accept_language_module.so")))
(global-directives
;; This is a 72-core machine, but let's not use all of them for nginx.
'((worker_processes . 16)
(pcre_jit . on)
(events . ((worker_connections . 1024)))))
(extra-content
(string-join %extra-content "\n"))))
(define %zabbix-nginx-server
(nginx-server-configuration
P
P
pelzflorian (Florian Pelz) wrote on 9 Apr 2020 09:45
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200409074550.ecq4ltzvu27o3js3@pelzflorian.localdomain
On Thu, Apr 09, 2020 at 05:21:46AM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (3 lines)
> but I could not yet test building the
> website i.e. if the redirects really work correctly.

It seems redirects broke like


on my test VM. :/
P
P
pelzflorian (Florian Pelz) wrote on 9 Apr 2020 16:57
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200409145730.qd2nqg4gxrf4ofzw@pelzflorian.localdomain
On Thu, Apr 09, 2020 at 09:45:50AM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (6 lines)
> It seems redirects broke like
>
> http://guix.gnu.org/news/gnu-dmd-01-released.html
>
> on my test VM. :/

This seems to be fixed by using the attached patch instead.

I have not recreated the berlin test VM yet though, only edited
nginx.conf.

Regards,
Florian
L
L
Ludovic Courtès wrote on 9 Apr 2020 17:27
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
878sj43cja.fsf@gnu.org
Hi Florian,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (2 lines)
> + (redirect "/news/porting-guix-and-guixsd.html" "/$lang/blog/2015/porting-guix-and-guixsd")

Does that mean that /blog/2015/porting-guix-and-guixsd (without /LANG)
will _not_ redirect to /LANG/blog/2015/porting-guix-and-guixsd?

It’s important that all the current URL, without /LANG, remain valid.

Ludo’.
P
P
pelzflorian (Florian Pelz) wrote on 9 Apr 2020 19:31
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200409173102.gaheruhtp7fg6cgg@pelzflorian.localdomain
On Thu, Apr 09, 2020 at 05:27:05PM +0200, Ludovic Courtès wrote:
Toggle quote (11 lines)
> Hi Florian,
>
> "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
>
> > + (redirect "/news/porting-guix-and-guixsd.html" "/$lang/blog/2015/porting-guix-and-guixsd")
>
> Does that mean that /blog/2015/porting-guix-and-guixsd (without /LANG)
> will _not_ redirect to /LANG/blog/2015/porting-guix-and-guixsd?
>
> It’s important that all the current URL, without /LANG, remain valid.

With the new test VM, not all is working.

/news/porting-guix-and-guixsd.html fails (code 404).

/blog/2015/porting-guix-and-guixsd fails (code 404).

/blog/2015/porting-guix-and-guixsd fails (404).

But /blog/2015/porting-guix-and-guixsd/ works fine.

Well this is difficult to figure out.

Regards,
Florian
B
B
Bengt Richter wrote on 9 Apr 2020 20:58
Re: bug#26302: Deploying the i18 n’d web site
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
20200409185814.GA12183@LionPure
Hi Florian,

On +2020-04-09 19:31:02 +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (25 lines)
> On Thu, Apr 09, 2020 at 05:27:05PM +0200, Ludovic Courtès wrote:
> > Hi Florian,
> >
> > "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
> >
> > > + (redirect "/news/porting-guix-and-guixsd.html" "/$lang/blog/2015/porting-guix-and-guixsd")
> >
> > Does that mean that /blog/2015/porting-guix-and-guixsd (without /LANG)
> > will _not_ redirect to /LANG/blog/2015/porting-guix-and-guixsd?
> >
> > It’s important that all the current URL, without /LANG, remain valid.
>
> With the new test VM, not all is working.
>
> /news/porting-guix-and-guixsd.html fails (code 404).
>
> /blog/2015/porting-guix-and-guixsd fails (code 404).
>
> /blog/2015/porting-guix-and-guixsd fails (404).
>
> But /blog/2015/porting-guix-and-guixsd/ works fine.
>
> Well this is difficult to figure out.
>

Wondering, could dnsmasq help?

Toggle quote (6 lines)
> Regards,
> Florian
>
>
>

--
Regards,
Bengt Richter
P
P
pelzflorian (Florian Pelz) wrote on 9 Apr 2020 21:17
Re: bug#26302: Deploying the i18n’d web site
(name . Bengt Richter)(address . bokr@bokr.com)
20200409191744.aajfv4hg6toc5mnk@pelzflorian.localdomain
On Thu, Apr 09, 2020 at 08:58:14PM +0200, Bengt Richter wrote:
Toggle quote (2 lines)
> Wondering, could dnsmasq help?

I am already using dnsmasq to access a virtual machine of the machine
hosting the Guix website so <guix.gnu.org/.i18n/de/> can replace the
Guix website while old URLs keep working.


I configured dnsmasq with NetworkManager.

(network-manager-service-type config =>
(network-manager-configuration
(inherit config)
(dns "dnsmasq")
(vpn-plugins (list network-manager-openconnect)))))))

Also I made the network manager configuration as described in the Guix
manual.

I made the attached modifications to berlin.scm so I can test without
the VM starting to build the world.

Then I changed my /etc/hosts

127.0.0.1 localhost florianmacbook
::1 localhost florianmacbook
172.28.112.244 guix.gnu.org guix.gnu.org

Then I made the changes from my previous patch, except those
nginx-server-configuration that I removed because I cannot test TLS.

I compile the VM using

~/git/maintenance$ GUILE_LOAD_PATH=$GUILE_LOAD_PATH:$(pwd)/modules guix system vm-image --image-size=5G --fallback /home/florian/git/maintenance/hydra/berlin.scm

(More than --image-size=5G to be safe.) I copy the resulting image
and name it berlin1.img, make it writable and run it via

qemu-system-x86_64 -enable-kvm berlin1.img -m 2048 -nic tap,ifname=tap0,script=no,downscript=no

When running the virtual machine, I log in as root and do “herd stop
mcron” so the VM does not get overloaded building all kinds of things
I do not need. I run the command from “herd schedule mcron” to build
the guix.gnu.org website manually once.

I am confused by all the ways to rewrite, redirect and try_files in
nginx. I would be happy if others with more knowledge could help.

Regards,
Florian
From 8b8f7a404b29ab3341b7dd19dcd1c5415723c1a0 Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Wed, 8 Apr 2020 21:08:57 +0200
Subject: [PATCH 2/2] remove rottlog

---
hydra/modules/sysadmin/services.scm | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)

Toggle diff (16 lines)
diff --git a/hydra/modules/sysadmin/services.scm b/hydra/modules/sysadmin/services.scm
index 22765cf..fe023ad 100644
--- a/hydra/modules/sysadmin/services.scm
+++ b/hydra/modules/sysadmin/services.scm
@@ -260,8 +260,7 @@
(nar-ttl (* 90 24 3600))
(publish-workers 6))
"Return the list of services for the build farm frontend."
- (cons* (service rottlog-service-type (rottlog-configuration))
- (service mcron-service-type
+ (cons* (service mcron-service-type
(mcron-configuration
(jobs (list))))
--
2.26.0
C
C
Christopher Baines wrote on 1 Jul 2020 22:11
87a70j2dyh.fsf@cbaines.net
pelzflorian (Florian Pelz) <pelzflorian@pelzflorian.de> writes:

Toggle quote (7 lines)
> On Thu, Apr 09, 2020 at 08:58:14PM +0200, Bengt Richter wrote:
>> Wondering, could dnsmasq help?
>
> I am already using dnsmasq to access a virtual machine of the machine
> hosting the Guix website so <guix.gnu.org/.i18n/de/> can replace the
> Guix website while old URLs keep working.

...

Toggle quote (3 lines)
> I am confused by all the ways to rewrite, redirect and try_files in
> nginx. I would be happy if others with more knowledge could help.

Hey Florian,

I'm wondering what the current state of the Guix website translation
work is?

I can see the translated website is available at [1], but maybe not with
the full NGinx configuration needed. I also managed to use haunt
locally, but I noticed there were some merge conflicts between the
wip-i18n and master branch.


I can try and help with the NGinx stuff, I've muddled through
configuring NGinx in the past. I think it might be useful to test
without the /.i18n prefix, maybe berlin can be changed to serve the site
at wip-i18n.guix.gnu.org. I also have a server where I might try
deploying the translated website for testing.

Thanks,

Chris
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl787dZfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XdU3w/8C8y7w8YtJL2ZNBeQWWsDcbkzsLSz4kiRaJdaebZ1T5W4cxCQ19GhBCnM
9lTS1g8fHFuAiOOIgDc6FQh0Tt+nX2DZstb910eWnZl/BbjaqY8p3CSWOm9GYSvr
NSEH2EoG60G+goACvAeVXHgwAfGxZ5RFSr9lZwn7nt+Ku9VN0HJtwjkn/o2zEm7k
i4jsLsx3FpRujzCdq7EQ3dLxIfEgT/W3+fQ3CihS64gkIczTVkpCPM4/bzh9XgY3
hLrZwAK9M1c0/W1C3WcXvk2glrXw1R80uENM5oyrBmXmyzcb1dxleq2YKwq6TejX
D9QjALiQAIgLiryjHKjNuy2l7cv69zr8ErkZb+iJrjacnwhXq+6zJrtmhohrRbb6
LBcuKzZBkyBShcMNzVfRMmlIBo/AMTqLCVXBxdjWH2fvU/YT6Y0JIgAG+48dhjRy
t2kg7Qzj3+nRNjEcwpIQzcvGjbdjLI1kmetaYkf9TQTaz75WwmohZlvivjV8iCLb
/2Loe6TFQIzNppw0gn0K4d6Kh044Tq1hbRlAWFg0RDg+hYidQYXdSkOc5CEIzAxn
PHHZ/1QRFsowyE7h6zqzoevhZPBMmjPlQOhquHHwFLSvq4Oi6W08yBqD228gY0fj
GFA/2A64z1Lhw5MmpCBrIpeRWwX/5YZ4uDOEAo54szmB87i2Flk=
=vUAl
-----END PGP SIGNATURE-----

P
P
pelzflorian (Florian Pelz) wrote on 5 Jul 2020 11:08
(name . 26302)(address . 26302@debbugs.gnu.org)
20200705090808.7c7ihjnymo6hv7ch@pelzflorian.localdomain
Sorry, I forgot to address the patch tracker. I wrote some hours ago:

On Thu, Apr 09, 2020 at 07:31:04PM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (27 lines)
> On Thu, Apr 09, 2020 at 05:27:05PM +0200, Ludovic Courtès wrote:
> > Hi Florian,
> >
> > "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
> >
> > > + (redirect "/news/porting-guix-and-guixsd.html" "/$lang/blog/2015/porting-guix-and-guixsd")
> >
> > Does that mean that /blog/2015/porting-guix-and-guixsd (without /LANG)
> > will _not_ redirect to /LANG/blog/2015/porting-guix-and-guixsd?
> >
> > It’s important that all the current URL, without /LANG, remain valid.
>
> With the new test VM, not all is working.
>
> /news/porting-guix-and-guixsd.html fails (code 404).
>
> /blog/2015/porting-guix-and-guixsd fails (code 404).
>
> /blog/2015/porting-guix-and-guixsd fails (404).
>
> But /blog/2015/porting-guix-and-guixsd/ works fine.
>
> Well this is difficult to figure out.
>
> Regards,
> Florian

An update:

The attached patch for berlin serves more but not all URLs
properly when testing on a VM.

I found one problem; the nginx locations for redirecting old URLs can
be given a higher priority via specifying = before the location path.

I am sorry for neglecting this for so long until
Christopher Baines offered to help a few days ago. Now I too started
investigating myself again.

I cleared the browser cache, restarted nscd and tested these URLs
(with a changed /etc/hosts file pointing guix.gnu.org to the VM):

Still failing:



worked before wip-i18n but stopped working. Hrm.

These seem to fail but I could not properly build the manual yet:




The rest looks good:






works.



never worked, so it’s OK that these URLs don’t work.


This redirect now works but did not work before wip-i18n (??).


I will continue to investigate.

Regards,
Florian
L
L
Ludovic Courtès wrote on 9 Jul 2020 15:09
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87d054bzru.fsf@gnu.org
Hi Florian,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (6 lines)
> The attached patch for berlin serves more but not all URLs
> properly when testing on a VM.
>
> I found one problem; the nginx locations for redirecting old URLs can
> be given a higher priority via specifying = before the location path.

One thing that bit me in the past is that regex locations have higher
precedence that other locations, IIRC.

Toggle quote (7 lines)
> I am sorry for neglecting this for so long until
> Christopher Baines offered to help a few days ago. Now I too started
> investigating myself again.
>
> I cleared the browser cache, restarted nscd and tested these URLs
> (with a changed /etc/hosts file pointing guix.gnu.org to the VM):

I guess you could check with “wget -v -O /dev/null” or similar, so you
can be sure there’s no client cache interfering.

Toggle quote (8 lines)
> Still failing:
>
> http://guix.gnu.org/graphics
>
> http://guix.gnu.org/blog/2013/back-from-the-european-lisp-symposium
>
> worked before wip-i18n but stopped working. Hrm.

What does nginx’s error.log file say?

Toggle quote (6 lines)
> These seem to fail but I could not properly build the manual yet:
>
> http://guix.gnu.org/manual/en/html_node/Miscellaneous-Services.html
>
> http://guix.gnu.org/manual/html_node/Power-management-Services.html

If you don’t have the manual at hand, you can just make sure you’re
getting the expected redirect, even if the end result is 404.

Toggle quote (20 lines)
> The rest looks good:
>
> http://guix.gnu.org/news/timely-delivery-of-security-updates.html
>
> http://guix.gnu.org/security/
>
> http://guix.gnu.org/blog/2016/back-from-the-gnu-hackers-meeting-2016/
>
> http://guix.gnu.org/en/blog/2017/back-from-fosdem-2017
>
> http://guix.gnu.org/de/blog/2016/back-from-gbcuw-2016/
>
> works.
>
> http://guix.gnu.org/news/coming-events
>
> http://guix.gnu.org/news
>
> never worked, so it’s OK that these URLs don’t work.

Sounds good.

Toggle quote (4 lines)
>
> This redirect now works but did not work before wip-i18n (??).

Nice.

I’d be happy to go ahead and deploy this so maybe let’s see and hammer
down those remaining issues and then we can profit! Let us know how we
can help!

Thanks,
Ludo’.
P
P
pelzflorian (Florian Pelz) wrote on 9 Jul 2020 16:48
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200709144524.fjri2znqer2dzn7a@pelzflorian.localdomain
The trouble is that I do not have an understanding in what order nginx
tries which redirections/rewrites. An understanding is needed instead
of investigating dead ends and 3rd party nginx modules.

What I have done a while ago (the berlin patch for guix-maintenance
from my last e-mail contains this):

To redirect accesses only to HTML files I had added

(nginx-location-configuration
(uri "~ (.html|.htm)$")
(body (list "try_files $uri /$lang/$uri /$lang/$uri/index.html =404;")))

However, this does not match when nginx redirects URLs like


to the index file



For this reason I had added

rewrite (.*)/$ $1/index.html;

Then it matched. But:

Toggle quote (8 lines)
> > Still failing:
> >
> > http://guix.gnu.org/graphics
> >
> > http://guix.gnu.org/blog/2013/back-from-the-european-lisp-symposium
> >
> > worked before wip-i18n but stopped working. Hrm.

Previously when visiting


then nginx too looked up the index file


This broke. “rewrite (.*)/$ $1/index.html;” had not fixed it.

!! I do not know what to do about it.



My last change addressed this:

On Thu, Jul 09, 2020 at 03:09:57PM +0200, Ludovic Courtès wrote:
Toggle quote (7 lines)
> "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
> > I found one problem; the nginx locations for redirecting old URLs can
> > be given a higher priority via specifying = before the location path.
>
> One thing that bit me in the past is that regex locations have higher
> precedence that other locations, IIRC.

Yes, I think this is what happened, the

(nginx-location-configuration
(uri "~ (.html|.htm)$")
(body (list "try_files $uri /$lang/$uri /$lang/$uri/index.html =404;")))

was run before the

location /news/gnu-dmd-01-released.html {
return 301 /blog/2013/gnu-dmd-01-released;
}

and therefore no return was performed.


Changing it to

location = /news/gnu-dmd-01-released.html {
return 301 /$lang/blog/2013/gnu-dmd-01-released;
}

with = in my last described attempt fixed this. Because the location
uri does not end in a slash, using = does not make a difference when
matching, but gives higher priority.


Toggle quote (6 lines)
> > I cleared the browser cache, restarted nscd and tested these URLs
> > (with a changed /etc/hosts file pointing guix.gnu.org to the VM):
>
> I guess you could check with “wget -v -O /dev/null” or similar, so you
> can be sure there’s no client cache interfering.

This is a good idea. In the past I had thought things work when in
reality all was broken and it was just cached.



Toggle quote (3 lines)
> If you don’t have the manual at hand, you can just make sure you’re
> getting the expected redirect, even if the end result is 404.

You are right, trying to build the manual was pointless.

Toggle quote (9 lines)
> > Still failing:
> >
> > http://guix.gnu.org/graphics
> >
> > http://guix.gnu.org/blog/2013/back-from-the-european-lisp-symposium
> >
> > worked before wip-i18n but stopped working. Hrm.
> What does nginx’s error.log file say?

I can only check later, I have deleted my VM because texinfo for
building the manual consumed too much disk space.




Toggle quote (3 lines)
>

The URL should have been


with capital M. But the old config has the wrong URL as well I think.


I have made some wrong changes since my last mail. Will go back and
rebuild the VM from my last mail now. With what I currently have
redirection explodes


!! I think this happened too back then. I have not investigated this yet.




Toggle quote (7 lines)
> I’d be happy to go ahead and deploy this so maybe let’s see and hammer
> down those remaining issues and then we can profit! Let us know how we
> can help!
>
> Thanks,
> Ludo’.

A solution for the two problems I marked with !! might be important.

Other than that, I would be very happy if first the berlin patch to
guix-maintenance and then after that the wip-i18n branch finally would
go to master.

Regards,
Florian
C
C
Christopher Baines wrote on 9 Jul 2020 18:56
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87wo3ck4ok.fsf@cbaines.net
pelzflorian (Florian Pelz) <pelzflorian@pelzflorian.de> writes:

Toggle quote (42 lines)
> Sorry, I forgot to address the patch tracker. I wrote some hours ago:
>
> On Thu, Apr 09, 2020 at 07:31:04PM +0200, pelzflorian (Florian Pelz) wrote:
>> On Thu, Apr 09, 2020 at 05:27:05PM +0200, Ludovic Courtès wrote:
>> > Hi Florian,
>> >
>> > "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
>> >
>> > > + (redirect "/news/porting-guix-and-guixsd.html" "/$lang/blog/2015/porting-guix-and-guixsd")
>> >
>> > Does that mean that /blog/2015/porting-guix-and-guixsd (without /LANG)
>> > will _not_ redirect to /LANG/blog/2015/porting-guix-and-guixsd?
>> >
>> > It’s important that all the current URL, without /LANG, remain valid.
>>
>> With the new test VM, not all is working.
>>
>> /news/porting-guix-and-guixsd.html fails (code 404).
>>
>> /blog/2015/porting-guix-and-guixsd fails (code 404).
>>
>> /blog/2015/porting-guix-and-guixsd fails (404).
>>
>> But /blog/2015/porting-guix-and-guixsd/ works fine.
>>
>> Well this is difficult to figure out.
>>
>> Regards,
>> Florian
>
> An update:
>
> The attached patch for berlin serves more but not all URLs
> properly when testing on a VM.
>
> I found one problem; the nginx locations for redirecting old URLs can
> be given a higher priority via specifying = before the location path.
>
> I am sorry for neglecting this for so long until Christopher Baines
> offered to help a few days ago. Now I too started investigating
> myself again.

Thanks for your continued time working on this Florian. I've made a
little bit of progress now, I've taken the wip-i18n branch, applied the
patch attached to this email and deployed that at [1].


This isn't a close test of the configuration for berlin, but might come
in useful when testing the NGinx configuration.

Thanks,

Chris
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAl8HTEtfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9Xdcgw//csS+Vx91Vr9g1SRoLXKWNagCOh99d9xm8xwjmAUxohjwn576cza6GSb8
sCugVPdg4mdc5Xz4NBZ9vS4am0C4/aGuB1geEX+9ZXQsDO5ELOwaByOLDcd2BvFI
GsqWLhVgpfLfEp96vjSGTo//7NCUIQkBrLrWoXK9RRB25vuW9HKHYTOBRCtN1AEh
MFcopCuoAEzrgeUmSBpSRDY2PJ8fXE1iWbnAEZy4S8dWHUiQmY6SYGgUI242qPFg
qIrVE8onZBUd54k42Md+IenEaLuTojGZ5gzDzuuo+SPFMgA24I7cI5no/0upd20B
YdyXiWdHSNnkGivMN2kpR/Bcwaze7HlxQ7atdXV/958WAvi1RI2NIQdYV63g3vxa
TMlAw3hvMxGJhkTKSRDUoRJzQ20QGhRFt32qSrqFkWZacXdH4LgnMSHBr7ef+FO8
RZNM0Fa1qnaBml1XlYC26MmCGXerJ4VAlSyFq6WcLRK47NB2vfgZsxnBkjuy07fa
I6P+aN1GmoCpvl1w2q1dCFkdG4+aV80YxT5t/zCzYL1JqGHkGHxHz0ZcJ8KXjqgm
tqUA9YeMa5DSGh8vAgdKVVGFzu2sJ//QXa+HQ7kOr+gMXJyRJF95h32Vq7qXjYmj
eLWuWwdwL/Cc/et11ycdQtRXa6d4O1Tr9kNLL9+MJsuts7Z8NEs=
=qpIF
-----END PGP SIGNATURE-----

P
P
pelzflorian (Florian Pelz) wrote on 10 Jul 2020 19:28
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200710172732.7a2tm7hcqt4mmhlo@pelzflorian.localdomain
Find attached a desperate patch for guix-maintenance that works around
all listed issues, perhaps not in a nice way.

On Thu, Jul 09, 2020 at 04:48:43PM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (8 lines)
> With what I currently have
> redirection explodes
>
> http://guix.gnu.org/manual/html_node/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/html_node
>
> !! I think this happened too back then. I have not investigated this yet.
>

This is fixed by redirecting not to relative paths,

(redirect "/manual/html_node/Substitutes.html" "../en/html_node/Substitutes.html")

but to absolute paths

(redirect "/manual/html_node/Substitutes.html" "/manual/en/html_node/Substitutes.html")

I think this issue existed before any of my i18n changes.


Toggle quote (13 lines)
> Previously when visiting
>
> http://guix.gnu.org/graphics
>
> then nginx too looked up the index file
>
> http://guix.gnu.org/graphics/index.html
>
> This broke. “rewrite (.*)/$ $1/index.html;” had not fixed it.
>
> !! I do not know what to do about it.


The patch introduces a long list of explicit redirects for all URLs
not ending in a slash (except for http://guix.gnu.org/packages/…
URLs, they are too many). This is an unmaintainable solution if we
want to keep using URLs not ending in a slash. If we don’t want that,
then if you agree all is ready, please deploy the i18n’d site by
applying this patch to guix-maintenance and shortly thereafter
merge/rebase the guix-artworks wip-i18n branch (shortly because
redirects won’t work in the meantime).

Regards,
Florian
P
P
pelzflorian (Florian Pelz) wrote on 10 Jul 2020 19:31
(name . Christopher Baines)(address . mail@cbaines.net)
20200710173131.qyko4wsvssipwuqc@pelzflorian.localdomain
On Thu, Jul 09, 2020 at 05:56:43PM +0100, Christopher Baines wrote:
Toggle quote (13 lines)
> Thanks for your continued time working on this Florian. I've made a
> little bit of progress now, I've taken the wip-i18n branch, applied the
> patch attached to this email and deployed that at [1].
>
> 1: http://guix-website-test.cbaines.net/
>
> This isn't a close test of the configuration for berlin, but might come
> in useful when testing the NGinx configuration.
>
> Thanks,
>
> Chris

This is a nice replica but with all the same issues. Have you made
improvements that should be added to my last patch for
guix-maintenance before it is deployed?

Regards,
Florian
P
P
pelzflorian (Florian Pelz) wrote on 12 Jul 2020 08:26
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200712061927.uoubuabreji4dw54@pelzflorian.localdomain
On Thu, Jul 09, 2020 at 03:09:57PM +0200, Ludovic Courtès wrote:
Toggle quote (11 lines)
> "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
> > Still failing:
> >
> > http://guix.gnu.org/graphics
> >
> > http://guix.gnu.org/blog/2013/back-from-the-european-lisp-symposium
> >
> > worked before wip-i18n but stopped working. Hrm.
>
> What does nginx’s error.log file say?

I forgot to try. error.log contains a 404 message:

2020/07/12 08:09:14 [error] 321#0: *1 open() "/srv/guix.gnu.org/graphics" failed (2: No such file or directory), client: 172.28.112.1, server: guix.gnu.org, request: "GET /graphics HTTP/1.1", host: "guix.gnu.org"
2020/07/12 08:09:14 [error] 321#0: *1 open() "/srv/guix.gnu.org/favicon.ico" failed (2: No such file or directory), client: 172.28.112.1, server: guix.gnu.org, request: "GET /favicon.ico HTTP/1.1", host: "guix.gnu.org"

Note that only directories /srv/guix.gnu.org/de/graphics and
/srv/guix.gnu.org/en/graphics exist and no longer
/srv/guix.gnu.org/graphics.

I don’t have ideas for rewriting, because URLs like
http://guix.gnu.org/index.html/. One could make /en/ go to the
/srv/guix.gnu.org directory, but then http://guix.gnu.org/graphics
would always be in English. Or for old URLs use my last proposed patch:

On Fri, Jul 10, 2020 at 07:28:08PM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (4 lines)
> The patch introduces a long list of explicit redirects for all URLs
> not ending in a slash (except for <http://guix.gnu.org/packages/…>
> URLs, they are too many).

And for new URLs never use http://guix.gnu.org/new without a slash
at the end but only http://guix.gnu.org/new/.

Regards,
Florian
L
L
Ludovic Courtès wrote on 13 Jul 2020 15:22
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87d04zsg6b.fsf@gnu.org
Hey!

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (18 lines)
> On Thu, Jul 09, 2020 at 05:56:43PM +0100, Christopher Baines wrote:
>> Thanks for your continued time working on this Florian. I've made a
>> little bit of progress now, I've taken the wip-i18n branch, applied the
>> patch attached to this email and deployed that at [1].
>>
>> 1: http://guix-website-test.cbaines.net/
>>
>> This isn't a close test of the configuration for berlin, but might come
>> in useful when testing the NGinx configuration.
>>
>> Thanks,
>>
>> Chris
>
> This is a nice replica but with all the same issues. Have you made
> improvements that should be added to my last patch for
> guix-maintenance before it is deployed?

Looks like we’re pretty much ready, no?

I’m happy to press the red button on berlin when we feel ready. Perhaps
we can synchronize on IRC in case things go wrong.

Thanks,
Ludo’.
P
P
pelzflorian (Florian Pelz) wrote on 13 Jul 2020 16:48
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200713144752.zlmn64pk6vjk5e2k@pelzflorian.localdomain
On Mon, Jul 13, 2020 at 03:22:36PM +0200, Ludovic Courtès wrote:
Toggle quote (2 lines)
> Looks like we’re pretty much ready, no?

I think we are.

Toggle quote (6 lines)
> I’m happy to press the red button on berlin when we feel ready. Perhaps
> we can synchronize on IRC in case things go wrong.
>
> Thanks,
> Ludo’.

I am currently at my grandma’s and unable to be on IRC most of the time.
I will try to watch IRC now.
I believe the berlin last patch works and suggest reverting otherwise.

Regards,
Florian
P
P
pelzflorian (Florian Pelz) wrote on 13 Jul 2020 18:32
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200713163248.hrwefxifq2s2fn65@pelzflorian.localdomain
On Mon, Jul 13, 2020 at 04:48:00PM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (14 lines)
> On Mon, Jul 13, 2020 at 03:22:36PM +0200, Ludovic Courtès wrote:
> > I’m happy to press the red button on berlin when we feel ready. Perhaps
> > we can synchronize on IRC in case things go wrong.
> >
> > Thanks,
> > Ludo’.
>
> I am currently at my grandma’s and unable to be on IRC most of the time.
> I will try to watch IRC now.
> I believe the berlin last patch works and suggest reverting otherwise.
>
> Regards,
> Florian

No sorry, I would prefer not to do synchronous communication in the near future.

I am confident in my latest patch with explicit redirects though.

Regards,
Florian
L
L
Ludovic Courtès wrote on 26 Jul 2020 19:46
Multilingual web site is on-line!
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87d04i2mpc.fsf_-_@gnu.org
Hi Florian & all!

I’m happy to say that I’ve finally taken the time to apply your
maintenance.git patch, reconfigure berlin, merge your ‘wip-i18n’ branch
in guix-artwork.git, and… tadaam!


At first sight, everything seems to be working fine, but please do take
a look and report any issues!

Thank you for all the work, Florian, you rock! … and sorry it took so
long; I guess hitting the red button felt too frightening. :-)

Should we publicize a process to contribute translations? It could be a
page on the web site linked from the bottom of each page or something.
Thoughts?

It would also be nice to have a blog post mentioning this, perhaps
explaining the tools behind it, and why we think it matters. I could
contribute a paragraph on linguistic diversity. :-)

Thanks!

Ludo’.
V
V
Vagrant Cascadian wrote on 26 Jul 2020 19:52
[website] translations
(address . 26302@debbugs.gnu.org)
875zaa6u5x.fsf@ponder
Congrats on the translated website!

I noticed one minor issue, and that is it displays the
language-selection drop-down with the current language's name for
itself.

But if someone can't read the currently selected language, it's not
obvious what they would click on to find a language they might
understand. in other words:

10:43 < vagrantc> civodul: the language-switching drop-down assumes you know what the current language describes itself ...
10:43 < vagrantc> e.g. not immediately obvious to someone who doesn't
know german to click on "deutsch" to switch language


This is a difficult user-interface challenge to solve well, not sure
what to do better... the flag method is commonly used, but has many
tricky political problems, though it can convey a dense amount of
information in a small space.


live well,
vagrant
-----BEGIN PGP SIGNATURE-----

iHUEARYKAB0WIQRlgHNhO/zFx+LkXUXcUY/If5cWqgUCXx3CywAKCRDcUY/If5cW
qhf1AP9hqWtiHt1Wkz5u4HkA0TDxW4K892xXFVa0/W/eNxYdIgD+PY37FAcy4t1q
uYgxq6YAD9GecR/HR+gRPBGVgB3wZgM=
=qLgh
-----END PGP SIGNATURE-----

P
P
pelzflorian (Florian Pelz) wrote on 26 Jul 2020 20:57
Re: Multilingual web site is on-line!
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200726185740.p2cobbqpyevywpkl@pelzflorian.localdomain
On Sun, Jul 26, 2020 at 07:46:55PM +0200, Ludovic Courtès wrote:
Toggle quote (8 lines)
> Hi Florian & all!
>
> I’m happy to say that I’ve finally taken the time to apply your
> maintenance.git patch, reconfigure berlin, merge your ‘wip-i18n’ branch
> in guix-artwork.git, and… tadaam!
>
> https://guix.gnu.org/

Thank you! I am so happy. Although …


Toggle quote (4 lines)
>
> At first sight, everything seems to be working fine, but please do take
> a look and report any issues!

Ohh sorry, the manual disappeared. I suppose it is built in /srv/…/manual/?

:(


Toggle quote (4 lines)
> Should we publicize a process to contribute translations? It could be a
> page on the web site linked from the bottom of each page or something.
> Thoughts?

One way would be to tar up the website and send it to the Translation
Project. I don’t know about the status of the Weblate plans.


Toggle quote (8 lines)
> It would also be nice to have a blog post mentioning this, perhaps
> explaining the tools behind it, and why we think it matters. I could
> contribute a paragraph on linguistic diversity. :-)
>
> Thanks!
>
> Ludo’.

So far I think Guix always needs more users and translations help.
Also Scheme’s homoiconicity makes it easy to write translation macros.
I will think some more what I could say about this tomorrow.

Regards,
Florian
D
D
Dmitry Alexandrov wrote on 27 Jul 2020 03:54
Re: bug#26302: Multilingual web site is on-line!
(name . Ludovic Courtès)(address . ludo@gnu.org)
1rkxpvrk.dag@gnui.org
Ludovic Courtès <ludo@gnu.org> wrote:
Toggle quote (4 lines)
>
> report any issues!

The obvious:

| <!DOCTYPE html><html lang="lang-tag">
^~~~~~~~

;-)
-----BEGIN PGP SIGNATURE-----

iIMEARYIACsWIQRSX35grYEsI2F1K7TIsPhUjufz5wUCXx4z7w0cZGFnQGdudWku
b3JnAAoJEMiw+FSO5/PnoG4BALCq+cztiPqoOjaOerM44fq0GAl0+pBBCArRqlSk
ZsXoAP0a3W6lR8zqNnA9wR0TR+X+jjL1atcgwnq0ewRCWvDKAw==
=fDlL
-----END PGP SIGNATURE-----

P
P
pelzflorian (Florian Pelz) wrote on 27 Jul 2020 13:20
Re: bug#26302: [website] translations
(name . Vagrant Cascadian)(address . vagrant@debian.org)(address . 26302@debbugs.gnu.org)
20200727112056.k7apinkxwbdjyxqy@pelzflorian.localdomain
On Sun, Jul 26, 2020 at 10:52:10AM -0700, Vagrant Cascadian wrote:
Toggle quote (2 lines)
> Congrats on the translated website!

:)


Toggle quote (22 lines)
> I noticed one minor issue, and that is it displays the
> language-selection drop-down with the current language's name for
> itself.
>
> But if someone can't read the currently selected language, it's not
> obvious what they would click on to find a language they might
> understand. in other words:
>
> 10:43 < vagrantc> civodul: the language-switching drop-down assumes you know what the current language describes itself ...
> 10:43 < vagrantc> e.g. not immediately obvious to someone who doesn't
> know german to click on "deutsch" to switch language
>
>
> This is a difficult user-interface challenge to solve well, not sure
> what to do better... the flag method is commonly used, but has many
> tricky political problems, though it can convey a dense amount of
> information in a small space.
>
>
> live well,
> vagrant

Perhaps there should be a stylized image of characters from various
languages. I cannot draw well though. sirgazil, WDYT?

Regards,
Florian
P
P
pelzflorian (Florian Pelz) wrote on 27 Jul 2020 13:28
Re: bug#26302: Multilingual web site is on-line!
(name . Dmitry Alexandrov)(address . dag@gnui.org)
20200727112833.5usk6c7l2adfwf6x@pelzflorian.localdomain
On Mon, Jul 27, 2020 at 04:54:55AM +0300, Dmitry Alexandrov wrote:
Toggle quote (12 lines)
> Ludovic Court�s <ludo@gnu.org> wrote:
> > https://guix.gnu.org/
> >
> > report any issues!
>
> The obvious:
>
> | <!DOCTYPE html><html lang="lang-tag">
> ^~~~~~~~
>
> ;-)

Thank you! Clearly testing is necessary.

I will push the attached patch this evening.

Regards,
Florian
From 2e5c8ad4fda96f1eec635fb3e21a9ef3dc1951e7 Mon Sep 17 00:00:00 2001
From: Florian Pelz <pelzflorian@pelzflorian.de>
Date: Mon, 27 Jul 2020 12:36:39 +0200
Subject: [PATCH] Fix value of html lang attribute.

Reported by Dmitry Alexandrov <dag@gnui.org>.

* website/apps/base/templates/theme.scm (theme): Add missing unquote.
---
website/apps/base/templates/theme.scm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Toggle diff (15 lines)
diff --git a/website/apps/base/templates/theme.scm b/website/apps/base/templates/theme.scm
index f77d341..4734ee5 100644
--- a/website/apps/base/templates/theme.scm
+++ b/website/apps/base/templates/theme.scm
@@ -67,7 +67,7 @@
`((doctype "html")
(html
- (@ (lang lang-tag))
+ (@ (lang ,lang-tag))
(head
,(if (null? title)
--
2.27.0
P
P
pelzflorian (Florian Pelz) wrote on 27 Jul 2020 18:01
Re: Multilingual web site is on-line!
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200727160101.nsznenkv75wcsuoe@pelzflorian.localdomain
On Sun, Jul 26, 2020 at 08:58:11PM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (2 lines)
> Ohh sorry, the manual disappeared. I suppose it is built in /srv/…/manual/?

Thank you Ludo for fixing this!

Toggle quote (7 lines)
> > Should we publicize a process to contribute translations? It could be a
> > page on the web site linked from the bottom of each page or something.
> > Thoughts?
>
> One way would be to tar up the website and send it to the Translation
> Project. I don’t know about the status of the Weblate plans.

I would suggest sending a tar archive with the website directory of
guix-artwork to the TP once more (ideally along with a current tarball
of Guix proper). Also I think even if once we use different
technology like Weblate instead of the TP, the TP should remain the
go-to place for our translators, because it is where many other
projects’ translators gather.


Toggle quote (12 lines)
> > It would also be nice to have a blog post mentioning this, perhaps
> > explaining the tools behind it, and why we think it matters. I could
> > contribute a paragraph on linguistic diversity. :-)
> >
> > Thanks!
> >
> > Ludo’.
>
> So far I think Guix always needs more users and translations help.
> Also Scheme’s homoiconicity makes it easy to write translation macros.
> I will think some more what I could say about this tomorrow.

Please find attached a first draft blog post.

Regards,
Florian
title: Adding translations to Guix’ website
date: 2020-07-28 15:00
author: Florian Pelz
tags: Community
---
As part of [GNU](https://www.gnu.org/),Guix aims to bring freedom to
computer users all over the world, no matter the languages they
(prefer to) speak. For example, Guix users asking for [help](/help)
can expect an answer even if they do so in languages other than
English.

We also offer software translations for people more comfortable with a
language other than English. Thanks to many people who contribute
translations, GNU Guix and the packages it distributes can be used in
various languages. Guix uses GNU Gettext for its translations, with
which translatable strings are extracted from the source code to
so-called PO files. Translators can use any of various free-software
tools, such as [GNU Emacs](https://www.gnu.org/software/emacs/)or
[Poedit](https://poedit.net/),for filling in translations. With
[Po4a](https://po4a.org/),we can also use Gettext’s tooling to
translate Guix’ [manual](/manual) and [cookbook](/cookbook).

But this was not true of its web presence. That’s why after a
[lengthy process,](https://issues.guix.info/issue/26302)the website
of GNU Guix has undergone an update. It now supports translation into
other languages. Such support is known as internationalization
(“i18n”).

Guix’ website is written in
a variant of HTML (in which web pages are usually written) that
integrates well with the [Scheme programming
language](https://schemers.org/). This allows web authors to mix code
and text. It looks like this:

```scheme
`(section
(h2 "On packaging")
(p
"Packages are "
(a (@ (href ,(manual-url "Defining-Packages.html"))) "defined")
" as native "
(a (@ (href ,(gnu-url "software/guile"))) "Guile")
" modules."))
```

However, this mixing makes it more difficult to extract the strings to
be translated. We therefore cannot take the same approach as
[gnu.org](https://www.gnu.org/),which uses a software called
[GNUnited Nations](https://www.gnu.org/software/gnun/)to extract from
pure HTML mark-up. Translators are not always coders and we would
prefer to show them only the textual part, like this:

```
msgid "Packages are <1>defined</1> as native <2>Guile</2> modules."
```

Our new, custom i18n system does this. The website authors need to
mark translatable strings [the way it is usually done in Guile Scheme

```scheme
`(section
,(G_ `(h2 "On packaging"))
;; TRANSLATORS: Defining Packages is a section name
;; in the English (en) manual.
,(G_ `(p
"Packages are "
,(G_ (manual-href "defined" (G_ "en") (G_ "Defining-Packages.html")))
" as native "
,(G_ `(a (@ (href ,(gnu-url "software/guile"))) "Guile"))
" modules.")))
```

Translators can arbitrarily change the ordering:

```
#. TRANSLATORS: Defining Packages is a section name
#. in the English (en) manual.
#: apps/base/templates/about.scm:64
msgid "Packages are <1>defineddefined<1.1>en</1.1><1.2>Defining-Packages.html</1.2></1> as native <2>Guile</2> modules."
msgstr "Pakete werden als reine <2>Guile</2>-Module <1>definiert<1.1>de</1.1><1.2>Pakete-definieren.html</1.2></1>."
```

Details are [documented
We hope it strikes the right balance between simplicity for the
website’s developers and translator comfort. Still missing is a way
to translate blog posts like the one you are reading here.

With ideas for and by a more diverse community, we can look forward to
a bright multi-lingual future. Please get in touch with [the
Translation Project](https://translationproject.org/team/)or [us Guix
developers](/contact) if you want to help make Guix’ website available
in your language as well!
P
P
pelzflorian (Florian Pelz) wrote on 27 Jul 2020 22:20
Re: bug#26302: Multilingual web site is on-line!
(name . Dmitry Alexandrov)(address . dag@gnui.org)(name . 26302)(address . 26302@debbugs.gnu.org)
20200727202018.lwmerdmsa4ohajwp@pelzflorian.localdomain
On Mon, Jul 27, 2020 at 01:28:48PM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (7 lines)
> Subject: [PATCH] Fix value of html lang attribute.
>
> Reported by Dmitry Alexandrov <dag@gnui.org>.
>
> * website/apps/base/templates/theme.scm (theme): Add missing unquote.
> ---

Pushed as 4ab8ab5c2f04dbb584a76d842a7864454013bba1. Good catch.
P
P
pelzflorian (Florian Pelz) wrote on 28 Jul 2020 11:44
Fwd: website translation English (US)?
(name . 26302)(address . 26302@debbugs.gnu.org)(name . zimoun)(address . zimon.toutoune@gmail.com)
20200728094425.q7bmtjxqc26fu22c@pelzflorian.localdomain
I just noticed simon and I forgot to reply to the bug.
Here is our conversation on the English (US) display name.

----- Forwarded message from zimoun <zimon.toutoune@gmail.com> -----

Date: Mon, 27 Jul 2020 21:25:06 +0200
From: zimoun <zimon.toutoune@gmail.com>
To: "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de>
Subject: website translation English (US)?

Hi Florian,

Thank you for the work! Really nice.

Aside, why is it "English (US)" and not simply "English". Well, I am
not sure that the translation to "English (UK)" would be really
different.

Back to holidays (on September) I will try to do the French one if
roptat does not beat me. ;-)

All the best,
simon

----- End forwarded message -----

----- Forwarded message from zimoun <zimon.toutoune@gmail.com> -----

Date: Tue, 28 Jul 2020 00:40:43 +0200
From: zimoun <zimon.toutoune@gmail.com>
To: "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de>
Subject: Re: website translation English (US)?

On Mon, 27 Jul 2020 at 22:49, "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> wrote:

Toggle quote (10 lines)
> The differences would be few and far between (some
> “have”s might become “have got”s, publicized becomes publicised) and
> there currently is no UK English translation.
>
> Hmm. I am hesitant to remove the (US) from English (US). I agree
> that if we do not have a separate English (UK) translation (Guix
> proper does not), then it would look better without the country code.
> However if we ever do get a separate UK/AU/… variant, then a rename to
> English (US) would break all older PO files.

Well, I have never checked but I do not know if the manual fully
respects US English. I understand the PO files issue but currently the
trasnlationproject.org has en_GB and en_ZA registered, only.

From my point of view, it looks weird to have French (FR), French (CA),
French (BE), etc.. And even it is not exactly the same French, as
French native, I can read and understand all kind of French (which is
not the case about listen) even if some sentence or vocabulary could
sound awkward. Whatever!

I have not checked in the code (just pulled now :-)), but is it not
possible to add a comment in guix-website.pot about the variant and in
the same time having just “English” as msgid i.e. change to (G_
"English") in utils.scm. Or something like that.

The English variant would be still possible and it would require an
update by all the translator – which appears to me fine.

WDYT?

All the best,
simon

ps:
Thank you again for all this tough work.

----- End forwarded message -----

----- Forwarded message from "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> -----

Date: Tue, 28 Jul 2020 11:23:56 +0200
From: "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de>
To: zimoun <zimon.toutoune@gmail.com>
Subject: Re: website translation English (US)?

Since the only reason I have for wanting to keep English (US) is a
minor, technical one, you are of course right, simon. Better now
than later.

On Tue, Jul 28, 2020 at 12:40:43AM +0200, zimoun wrote:
Toggle quote (3 lines)
> Well, I have never checked but I do not know if the manual fully
> respects US English.

I think it only contains U.S. English.

Toggle quote (3 lines)
> I understand the PO files issue but currently the
> trasnlationproject.org has en_GB and en_ZA registered, only.

AFAIK most variants of English are similar to en_GB, so IIRC some
projects have an en.po for en_GB and an en_US.po for U.S. English.
This makes en.po the default for other Englishes, which is usually
enough.


Toggle quote (6 lines)
> From my point of view, it looks weird to have French (FR), French (CA),
> French (BE), etc.. And even it is not exactly the same French, as
> French native, I can read and understand all kind of French (which is
> not the case about listen) even if some sentence or vocabulary could
> sound awkward. Whatever!

Yes, I concur.

Toggle quote (8 lines)
> I have not checked in the code (just pulled now :-)), but is it not
> possible to add a comment in guix-website.pot about the variant and in
> the same time having just “English” as msgid i.e. change to (G_
> "English") in utils.scm. Or something like that.
>
> The English variant would be still possible and it would require an
> update by all the translator – which appears to me fine.

In the attached patch I added a comment *maybe* not to change the
(G_ "English"). I do not know how many out-of-date translations will exist,

Regards,
Florian

----- End forwarded message -----

I will push the patch this evening.

Regards,
Florian
Z
Z
zimoun wrote on 28 Jul 2020 12:03
861rkwyn12.fsf@gmail.com
Hi Florian,

Toggle quote (2 lines)
> I will push the patch this evening.

Cool! Thank you.

All the best,
simon
P
P
pelzflorian (Florian Pelz) wrote on 28 Jul 2020 18:02
Re: bug#26302: Fwd: website translation English (US)?
(name . 26302)(address . 26302@debbugs.gnu.org)(name . zimoun)(address . zimon.toutoune@gmail.com)
20200728160141.delqzffweykiahkc@pelzflorian.localdomain
On Tue, Jul 28, 2020 at 11:44:25AM +0200, pelzflorian (Florian Pelz) wrote:
Toggle quote (2 lines)
> I will push the patch this evening.

Pushed as 68410f28e374c6b322fa69e1fbc5775e1bb0c8a4 (with minor changes
to the commit message and a smaller diff of the PO file).
L
L
Ludovic Courtès wrote on 28 Jul 2020 23:50
Re: Multilingual web site is on-line!
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87k0yns416.fsf@gnu.org
Hello Florian,

(+Cc: Julien.)

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (5 lines)
> On Sun, Jul 26, 2020 at 08:58:11PM +0200, pelzflorian (Florian Pelz) wrote:
>> Ohh sorry, the manual disappeared. I suppose it is built in /srv/…/manual/?
>
> Thank you Ludo for fixing this!

That’s my modest contribution. :-)

Toggle quote (14 lines)
>> > Should we publicize a process to contribute translations? It could be a
>> > page on the web site linked from the bottom of each page or something.
>> > Thoughts?
>>
>> One way would be to tar up the website and send it to the Translation
>> Project. I don’t know about the status of the Weblate plans.
>
> I would suggest sending a tar archive with the website directory of
> guix-artwork to the TP once more (ideally along with a current tarball
> of Guix proper). Also I think even if once we use different
> technology like Weblate instead of the TP, the TP should remain the
> go-to place for our translators, because it is where many other
> projects’ translators gather.

I’m not as enthusiastic as you are about the TP but why not.
Julien, what are your thoughts?

Toggle quote (14 lines)
>> > It would also be nice to have a blog post mentioning this, perhaps
>> > explaining the tools behind it, and why we think it matters. I could
>> > contribute a paragraph on linguistic diversity. :-)
>> >
>> > Thanks!
>> >
>> > Ludo’.
>>
>> So far I think Guix always needs more users and translations help.
>> Also Scheme’s homoiconicity makes it easy to write translation macros.
>> I will think some more what I could say about this tomorrow.
>
> Please find attached a first draft blog post.

Woow, that was fast!

Toggle quote (8 lines)
> title: Adding translations to Guix’ website
> date: 2020-07-28 15:00
> author: Florian Pelz
> tags: Community
> ---
> As part of [GNU](https://www.gnu.org/), Guix aims to bring freedom to
> computer users all over the world, no matter the languages they
> (prefer to) speak. For example, Guix users asking for [help](/help)
^
You should use absolute URLs to get valid links on, say,

Toggle quote (4 lines)
> Guix’ website is written in
> [SHTML](https://www.nongnu.org/guile-lib/doc/ref/htmlprag/), which is
> a variant of HTML (in which web pages are usually written) that

Toggle quote (4 lines)
> However, this mixing makes it more difficult to extract the strings to
> be translated. We therefore cannot take the same approach as
> [gnu.org](https://www.gnu.org/), which uses a software called

s/a software/a software package/

Toggle quote (6 lines)
> With ideas for and by a more diverse community, we can look forward to
> a bright multi-lingual future. Please get in touch with [the
> Translation Project](https://translationproject.org/team/) or [us Guix
> developers](/contact) if you want to help make Guix’ website available
> in your language as well!

I wonder if we should link to more practical step-by-step instructions
on how to get started translating, to lower the barrier for those who
want to get started without engaging in possibly open-ended discussions
with the fabulous Guix team. :-)

Anyway the post looks great to me! Perhaps you should publish it once
the TP (or Weblate?) is set up? When you publish, make sure to adjust
the date at the top and add the “About” footer at the bottom (which you
can take from the latest post).

I’ll be mostly away from keyboard in the coming weeks so you don’t need
to wait for me.

Thank you!

Ludo’.
J
J
Julien Lepiller wrote on 29 Jul 2020 03:21
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200729032053.27c8ad4b@tachikoma.lepiller.eu
Le Tue, 28 Jul 2020 23:50:13 +0200,
Ludovic Courtès <ludo@gnu.org> a écrit :
Toggle quote (4 lines)
>
> I’m not as enthusiastic as you are about the TP but why not.
> Julien, what are your thoughts?

Not sure we're going to do the switch soon, so we can send it to the TP.
P
P
pelzflorian (Florian Pelz) wrote on 29 Jul 2020 15:56
(name . Julien Lepiller)(address . julien@lepiller.eu)
20200729135338.nqtpk3tugxlsjlu2@pelzflorian.localdomain
On Wed, Jul 29, 2020 at 03:21:09AM +0200, Julien Lepiller wrote:
Toggle quote (8 lines)
> Le Tue, 28 Jul 2020 23:50:13 +0200,
> Ludovic Courtès <ludo@gnu.org> a écrit :
> >
> > I’m not as enthusiastic as you are about the TP but why not.
> > Julien, what are your thoughts?
>
> Not sure we're going to do the switch soon, so we can send it to the TP.

Since there is no Makefile, I suppose it is enough to put the website
directory of the guix-artwork repo in a tar file.

What version number should we give it? That of Guix, or a YYYYMMDD?
I suppose the version number should be part of the POT file’s
Project-Id-Version field and the tar filename, but I don’t know.

Should we at the same time send a tarball of Guix’ prospective new
release?

Could you Julien or someone else send the tarball(s) off to the TP
coordinator?

Regards,
Florian
P
P
pelzflorian (Florian Pelz) wrote on 29 Jul 2020 21:21
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200729192103.2fug7t6to2tuiwew@pelzflorian.localdomain
On Tue, Jul 28, 2020 at 11:50:13PM +0200, Ludovic Courtès wrote:
Toggle quote (8 lines)
> "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
> > Guix’ website is written in
> > [SHTML](https://www.nongnu.org/guile-lib/doc/ref/htmlprag/), which is
> > a variant of HTML (in which web pages are usually written) that
>
> I think it’s technically SXHTML, no?
> https://www.gnu.org/software/guile/manual/html_node/SXML.html

The result is not valid XHTML. I will just call it SXML now, which is
what the Haunt info manual calls it.


Toggle quote (5 lines)
> I wonder if we should link to more practical step-by-step instructions
> on how to get started translating, to lower the barrier for those who
> want to get started without engaging in possibly open-ended discussions
> with the fabulous Guix team. :-)

I don’t know how best to integrate step-by-step instructions. While
the TP has instructions
intimidating to me than, as a first step, talking to the helpful
people at the TP. A few steps also describe how to disclaim
copyright, which Guix does not ask for anyway.

I propose the attached blog post draft if noone objects, taking into
account Ludo’s helpful suggestions. Is it missing anything
interesting about the i18n system?

Should I add it to the website as a draft? I suppose no, I suppose I
should just publish it as-is once guix-website.pot is at the TP.

Regards,
Florian
L
L
Ludovic Courtès wrote on 31 Jul 2020 16:45
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
874kpnu4j8.fsf@gnu.org
Hi!

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (12 lines)
> On Tue, Jul 28, 2020 at 11:50:13PM +0200, Ludovic Courtès wrote:
>> "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
>> > Guix’ website is written in
>> > [SHTML](https://www.nongnu.org/guile-lib/doc/ref/htmlprag/), which is
>> > a variant of HTML (in which web pages are usually written) that
>>
>> I think it’s technically SXHTML, no?
>> https://www.gnu.org/software/guile/manual/html_node/SXML.html
>
> The result is not valid XHTML. I will just call it SXML now, which is
> what the Haunt info manual calls it.

OK.

Toggle quote (12 lines)
>> I wonder if we should link to more practical step-by-step instructions
>> on how to get started translating, to lower the barrier for those who
>> want to get started without engaging in possibly open-ended discussions
>> with the fabulous Guix team. :-)
>
> I don’t know how best to integrate step-by-step instructions. While
> the TP has instructions
> <https://translationproject.org/html/translators.html>, they seem more
> intimidating to me than, as a first step, talking to the helpful
> people at the TP. A few steps also describe how to disclaim
> copyright, which Guix does not ask for anyway.

Yeah, dunno. In the post you could duplicate/filter those steps just so
it’s more directly understandable what it takes to translate pages.
Your call!

Toggle quote (7 lines)
> I propose the attached blog post draft if noone objects, taking into
> account Ludo’s helpful suggestions. Is it missing anything
> interesting about the i18n system?
>
> Should I add it to the website as a draft? I suppose no, I suppose I
> should just publish it as-is once guix-website.pot is at the TP.

Yes.

Toggle quote (5 lines)
> title: Adding translations to Guix’ website
> date: 2020-07-29 15:00
> author: Florian Pelz
> tags: Community

LGTM! :-)

Ludo’.
L
L
Ludovic Courtès wrote on 3 Aug 2020 16:53
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87ft93srur.fsf@gnu.org
Hi,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (3 lines)
> Since there is no Makefile, I suppose it is enough to put the website
> directory of the guix-artwork repo in a tar file.

Sounds good to me.

Toggle quote (4 lines)
> What version number should we give it? That of Guix, or a YYYYMMDD?
> I suppose the version number should be part of the POT file’s
> Project-Id-Version field and the tar filename, but I don’t know.

I’d say YYYYMMDD. The coordinator might have suggestions.

Toggle quote (3 lines)
> Should we at the same time send a tarball of Guix’ prospective new
> release?

It can happen separately but it’d be nice!

Toggle quote (3 lines)
> Could you Julien or someone else send the tarball(s) off to the TP
> coordinator?

That’d be great. Julien, let us know if you’d rather hand over this
responsibility.

Cheers,
Ludo’.
P
P
pelzflorian (Florian Pelz) wrote on 4 Aug 2020 17:37
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200804153554.6vosez3tn3fa3tlk@pelzflorian.localdomain
On Fri, Jul 31, 2020 at 04:45:31PM +0200, Ludovic Courtès wrote:
Toggle quote (16 lines)
> "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
> > On Tue, Jul 28, 2020 at 11:50:13PM +0200, Ludovic Courtès wrote:
> >> I wonder if we should link to more practical step-by-step instructions
> >> on how to get started translating, to lower the barrier for those who
> >> want to get started without engaging in possibly open-ended discussions
> >> with the fabulous Guix team. :-)
> > I don’t know how best to integrate step-by-step instructions. While
> > the TP has instructions
> > <https://translationproject.org/html/translators.html>, they seem more
> > intimidating to me than, as a first step, talking to the helpful
> > people at the TP. A few steps also describe how to disclaim
> > copyright, which Guix does not ask for anyway.
> Yeah, dunno. In the post you could duplicate/filter those steps just so
> it’s more directly understandable what it takes to translate pages.
> Your call!

I rewrote the part for translators that comes before the first source
code in the post and changed it again and again while a
not-yet-Guix-using friend gave helpful feedback. I attach the current
draft blog post, but currently you can also read it at:


Regards,
Florian
P
P
pelzflorian (Florian Pelz) wrote on 21 Aug 2020 02:14
(name . Julien Lepiller)(address . julien@lepiller.eu)
20200821001420.xjdk3s22q6ynjd3c@pelzflorian.localdomain
On Mon, Aug 03, 2020 at 04:53:48PM +0200, Ludovic Courtès wrote:
Toggle quote (7 lines)
> "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
> > What version number should we give it? That of Guix, or a YYYYMMDD?
> > I suppose the version number should be part of the POT file’s
> > Project-Id-Version field and the tar filename, but I don’t know.
>
> I’d say YYYYMMDD. The coordinator might have suggestions.

I will push the attached patch if there are no objections.

Toggle quote (6 lines)
> > Could you Julien or someone else send the tarball(s) off to the TP
> > coordinator?
>
> That’d be great. Julien, let us know if you’d rather hand over this
> responsibility.

Is it OK if you send it when you have time after the patch is in?

Regards,
Florian
J
J
Julien Lepiller wrote on 21 Aug 2020 02:41
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
4B72BBF4-3E63-4731-ACB0-62209776476C@lepiller.eu
Sure, let me know when the patcg is pushed and I'll send a tarball to the TP.

On 2020?8?20? 20:14:20 GMT-04:00, "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> wrote:
Toggle quote (21 lines)
>On Mon, Aug 03, 2020 at 04:53:48PM +0200, Ludovic Courtès wrote:
>> "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
>> > What version number should we give it? That of Guix, or a
>YYYYMMDD?
>> > I suppose the version number should be part of the POT file’s
>> > Project-Id-Version field and the tar filename, but I don’t know.
>>
>> I’d say YYYYMMDD. The coordinator might have suggestions.
>
>I will push the attached patch if there are no objections.
>
>> > Could you Julien or someone else send the tarball(s) off to the TP
>> > coordinator?
>>
>> That’d be great. Julien, let us know if you’d rather hand over this
>> responsibility.
>
>Is it OK if you send it when you have time after the patch is in?
>
>Regards,
>Florian
Attachment: file
P
P
pelzflorian (Florian Pelz) wrote on 21 Aug 2020 09:51
(name . Julien Lepiller)(address . julien@lepiller.eu)
20200821075111.aerqnrhpcr4wyuna@pelzflorian.localdomain
On Thu, Aug 20, 2020 at 08:41:33PM -0400, Julien Lepiller wrote:
Toggle quote (2 lines)
> Sure, let me know when the patcg is pushed and I'll send a tarball to the TP.

I have pushed now. I hope and believe the TP robot and coordinator
will have no complaints. Thank you for sending.

Regards,
Florian
L
L
Ludovic Courtès wrote on 23 Aug 2020 17:55
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
874kotcq6u.fsf@gnu.org
Hi Florian,

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (32 lines)
> On Fri, Jul 31, 2020 at 04:45:31PM +0200, Ludovic Courtès wrote:
>> "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:
>> > On Tue, Jul 28, 2020 at 11:50:13PM +0200, Ludovic Courtès wrote:
>> >> I wonder if we should link to more practical step-by-step instructions
>> >> on how to get started translating, to lower the barrier for those who
>> >> want to get started without engaging in possibly open-ended discussions
>> >> with the fabulous Guix team. :-)
>> > I don’t know how best to integrate step-by-step instructions. While
>> > the TP has instructions
>> > <https://translationproject.org/html/translators.html>, they seem more
>> > intimidating to me than, as a first step, talking to the helpful
>> > people at the TP. A few steps also describe how to disclaim
>> > copyright, which Guix does not ask for anyway.
>> Yeah, dunno. In the post you could duplicate/filter those steps just so
>> it’s more directly understandable what it takes to translate pages.
>> Your call!
>
> I rewrote the part for translators that comes before the first source
> code in the post and changed it again and again while a
> not-yet-Guix-using friend gave helpful feedback. I attach the current
> draft blog post, but currently you can also read it at:
>
> https://pelzflorian.de/adding-translations-to-guix-website/index.html
>
> Regards,
> Florian
>
> title: Adding translations to Guix’ website
> date: 2020-08-01 15:00
> author: Florian Pelz
> tags: Community

Sorry for the long delay—vacations… so sweet. ;-)

This version also LGTM. Perhaps you can commit it tomorrow around noon,
when it’s more likely to be noticed than on a sunny (?) Sunday.

Thanks again!

Ludo’.
P
P
pelzflorian (Florian Pelz) wrote on 24 Aug 2020 14:47
(name . Ludovic Courtès)(address . ludo@gnu.org)
20200824124557.wuhmf44r567z7z7j@pelzflorian.localdomain
On Sun, Aug 23, 2020 at 05:55:21PM +0200, Ludovic Courtès wrote:
Toggle quote (2 lines)
> Sorry for the long delay—vacations… so sweet. ;-)

Sounds nice. I wasn’t home either and the guix-website.pot is not
online yet, but I believe the wheels are in motion already.


Toggle quote (3 lines)
> This version also LGTM. Perhaps you can commit it tomorrow around noon,
> when it’s more likely to be noticed than on a sunny (?) Sunday.

I will wait for around noon on the day the TP publishes
guix-website.pot.

Regards,
Florian
L
L
Ludovic Courtès wrote on 24 Aug 2020 16:05
(name . pelzflorian (Florian Pelz))(address . pelzflorian@pelzflorian.de)
87y2m43zqw.fsf@gnu.org
Hallo!

"pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de> skribis:

Toggle quote (13 lines)
> On Sun, Aug 23, 2020 at 05:55:21PM +0200, Ludovic Courtès wrote:
>> Sorry for the long delay—vacations… so sweet. ;-)
>
> Sounds nice. I wasn’t home either and the guix-website.pot is not
> online yet, but I believe the wheels are in motion already.
>
>
>> This version also LGTM. Perhaps you can commit it tomorrow around noon,
>> when it’s more likely to be noticed than on a sunny (?) Sunday.
>
> I will wait for around noon on the day the TP publishes
> guix-website.pot.

Alright, makes sense!

Ludo’.
T
T
Tobias Geerinckx-Rice wrote on 30 Sep 2020 11:30
(no subject)
(address . control@debbugs.gnu.org)
871rij1ujo.fsf@nckx
close 26302
-----BEGIN PGP SIGNATURE-----

iIMEARYKACsWIQT12iAyS4c9C3o4dnINsP+IT1VteQUCX3RQGw0cbWVAdG9iaWFz
LmdyAAoJEA2w/4hPVW152JsBAPF8fNqH5CkLVElm7gEoHPkx9WQis+FFcjCTgODn
bDTdAQD+JwqXNgFROuGD5UeEl3iFAvS6KN9vccgzTesqiMqpDg==
=Rdtc
-----END PGP SIGNATURE-----

?