From mboxrd@z Thu Jan 1 00:00:00 1970 From: "pelzflorian (Florian Pelz)" Subject: bug#26302: [website] translations Date: Fri, 8 Nov 2019 10:02:16 +0100 Message-ID: <20191108090216.koews3r74rdeszzy@pelzflorian.localdomain> References: <20170329154040.ddscahwp2agknihb@abyayala> <16d07cb5a1d.ca69255821627.8144164908931126811@zoho.com> <20190908171638.cna67eearj4rbn2k@pelzflorian.localdomain> <16d18a5a9e8.12ab66c8254154.2756956535677606704@zoho.com> <20190915201819.3yxm25fayvbxwdpl@pelzflorian.localdomain> <20191007081502.wog4q4wjptvhmejf@pelzflorian.localdomain> <20191008093719.duvx26l2ods3fg75@pelzflorian.localdomain> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:60561) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iT0Ad-0003r9-Tj for bug-guix@gnu.org; Fri, 08 Nov 2019 04:03:09 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iT0AY-0004x9-QI for bug-guix@gnu.org; Fri, 08 Nov 2019 04:03:07 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:35766) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iT0AY-0004x3-Mf for bug-guix@gnu.org; Fri, 08 Nov 2019 04:03:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iT0AY-00059v-Gd for bug-guix@gnu.org; Fri, 08 Nov 2019 04:03:02 -0500 Sender: "Debbugs-submit" Resent-Message-ID: Content-Disposition: inline In-Reply-To: <20191008093719.duvx26l2ods3fg75@pelzflorian.localdomain> List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: sirgazil , Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 26302 <26302@debbugs.gnu.org> 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: 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