GNU bug report logs - #26302
[website] translations

Previous Next

Package: guix;

Reported by: ng0 <contact.ng0 <at> cryptolab.net>

Date: Wed, 29 Mar 2017 15:41:01 UTC

Severity: normal

Done: Tobias Geerinckx-Rice <me <at> tobias.gr>

Bug is archived. No further changes may be made.

Full log


Message #158 received at 26302 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: "pelzflorian \(Florian Pelz\)" <pelzflorian <at> pelzflorian.de>
Cc: sirgazil <sirgazil <at> zoho.com>, 26302 <26302 <at> debbugs.gnu.org>
Subject: Re: bug#26302: Deploying the i18n’d web site
Date: Tue, 07 Apr 2020 23:18:56 +0200
[Message part 1 (text/plain, inline)]
Hi Florian,

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

>> 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’.

[Message part 2 (text/x-patch, inline)]
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)

This bug report was last modified 4 years and 290 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.