Subject: bug#26302: Deploying the i18n’d web site

From: Ludovic Courtès <[email-masked]>
Date: Wed, 25 Mar 2020 18:33:46 +0100

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)" <[email-masked]> skribis:

> 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