From mboxrd@z Thu Jan 1 00:00:00 1970 From: "pelzflorian (Florian Pelz)" Subject: Re: Website translation Date: Fri, 23 Aug 2019 15:54:09 +0200 Message-ID: <20190823135409.cov3k3of57v4upcc@pelzflorian.localdomain> References: <20190718150836.kzf2tmbtng5l42ta@pelzflorian.localdomain> <87h87jffd7.fsf@elephly.net> <20190718202831.4vavgrmogrkpdote@pelzflorian.localdomain> <20190719122952.an6yr6azie4x3xjg@pelzflorian.localdomain> <20190726111155.qospxvrw7rnuwtok@pelzflorian.localdomain> <20190805130827.thp3zzw5ljo6g3h2@pelzflorian.localdomain> <20190807223310.yiwzodu7fwjhvrm6@pelzflorian.localdomain> <874l28lx7y.fsf@gnu.org> <20190823060303.35ew2cie6v24pmmn@pelzflorian.localdomain> <87h868848c.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:44301) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1i1A1B-0007tj-RB for guix-devel@gnu.org; Fri, 23 Aug 2019 09:54:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1i1A1A-00057n-Le for guix-devel@gnu.org; Fri, 23 Aug 2019 09:54:17 -0400 Content-Disposition: inline In-Reply-To: <87h868848c.fsf@gnu.org> List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Ludovic =?utf-8?Q?Court=C3=A8s?= Cc: guix-devel@gnu.org, sirgazil , matias_jose_seco@autoproduzioni.net, julien lepiller On Fri, Aug 23, 2019 at 02:18:27PM +0200, Ludovic Court=C3=A8s wrote: > "pelzflorian (Florian Pelz)" skribis: > > On Thu, Aug 22, 2019 at 11:13:53PM +0200, Ludovic Court=C3=A8s wrote: > >> We should make sure existing URLs are preserved. Do you know if tha= t=E2=80=99s > >> the case? > >>=20 > > > > Preserving URLs requires the above redirects based on the > > Accept-Language HTTP headers. >=20 > So /(.*) should be redirected to /en/\1, right? >=20 > >> Also, I suppose we don=E2=80=99t translate URI paths themselves, rig= ht? That=E2=80=99s > >> probably OK, at least as a first version. > >> > > > > I do not understand. >=20 > I mean =E2=80=9Cguix.gnu.org/en/help=E2=80=9D could map to =E2=80=9Cgui= x.gnu.org/es/ayuda=E2=80=9D, for > instance. That=E2=80=99s not the case, right? >=20 > Thanks, > Ludo=E2=80=99. Now I understand. Currently the code keeps the URLs and appends the lingua, i.e. I want to keep the URLs as before and then make nginx respond with the file help/index.es_ES.html to a request for guix.gnu.org/help if the HTTP request has a header Accept-Language: es. would not need to be changed i= n the translation. We could of course translate the URLs instead, we would then add a procedure url->localized-href that calls gettext to return the localized URL for a given URL and replace each (@ (href "/help")) by (@ ,(url->localized-href "/help")) and add --keyword=3D'url->localized-href' to the call to xgettext. The downside is that the logic for nginx would need to look up the translation instead of looking up the locale, that the logic for Haunt would need to look up the filename in the localized builder for pages, and that the translator would need to translate all of "/help", "../help", "../../help" etc. (There needs to be some mapping from the lingua =E2=80=9Ces=E2=80=9D to t= he locale identifier =E2=80=9Ces_ES.utf8=E2=80=9D in the call to setlocale. Curren= tly the code uses linguas like =E2=80=9Ces_ES=E2=80=9D instead of =E2=80=9Ces=E2=80=9D= , which may or may not complicate the logic for nginx, but this could easily be changed.) Regards, Florian