bug-guix
[Top][All Lists]
Advanced

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

bug#26302: [website] translations


From: pelzflorian (Florian Pelz)
Subject: bug#26302: [website] translations
Date: Sun, 17 Nov 2019 17:17:02 +0100

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

Attachment: 0001-various-changes-for-local-testing.patch
Description: Text document


reply via email to

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