From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: "pelzflorian (Florian Pelz)" Newsgroups: gmane.lisp.guile.devel,gmane.lisp.guile.user Subject: Re: Website translations with Haunt Date: Fri, 15 Dec 2017 09:34:47 +0100 Message-ID: <20171215083447.xk4xjyf4tw7gqfln@floriannotebook> References: <20171209180619.GA10254@floriannotebook.localdomain> <87y3m4bqhz.fsf@dustycloud.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="akn4rr4r23ux24ff" X-Trace: blaine.gmane.org 1513326895 4559 195.159.176.226 (15 Dec 2017 08:34:55 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Fri, 15 Dec 2017 08:34:55 +0000 (UTC) User-Agent: NeoMutt/20171208 Cc: Guile User , guile-devel To: Christopher Lemmer Webber Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Dec 15 09:34:48 2017 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePlSB-0000hB-95 for guile-devel@m.gmane.org; Fri, 15 Dec 2017 09:34:47 +0100 Original-Received: from localhost ([::1]:45088 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePlSH-0000rF-0O for guile-devel@m.gmane.org; Fri, 15 Dec 2017 03:34:53 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42485) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ePlSB-0000qx-Fh for guile-devel@gnu.org; Fri, 15 Dec 2017 03:34:48 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ePlS8-0001Zk-Ad for guile-devel@gnu.org; Fri, 15 Dec 2017 03:34:47 -0500 Original-Received: from pelzflorian.de ([5.45.111.108]:42264 helo=mail.pelzflorian.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ePlS7-0001Uq-SH; Fri, 15 Dec 2017 03:34:44 -0500 Original-Received: from floriannotebook (ip5b431f77.dynamic.kabel-deutschland.de [91.67.31.119]) by mail.pelzflorian.de (Postfix) with ESMTPSA id 83B3D360026; Fri, 15 Dec 2017 09:34:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=pelzflorian.de; s=mail; t=1513326880; bh=scfRksxA7AVt8KBsW3RWDftWujTGG0/OBzbpnjNygFU=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=v066moiG/24nObjJ4pT8QccsA/ptg+g6xvFdZzqqxiWWxuJlDh9sO2VD4hFVefgmi ro2fzrY6q0BDM1hxaj94zdKXzS7AWnnv2nD/PNIqvK6VlVvs6iJ6GD/ogq8ygXTtBi Dtn5TM8kC/zfMZ3SlXC9eB4/UeCrgrUsBHqfzZlQ= Content-Disposition: inline In-Reply-To: <87y3m4bqhz.fsf@dustycloud.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 5.45.111.108 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: "guile-devel" Xref: news.gmane.org gmane.lisp.guile.devel:19433 gmane.lisp.guile.user:14360 Archived-At: --akn4rr4r23ux24ff Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 14, 2017 at 09:48:40PM -0600, Christopher Lemmer Webber wrote: > At one point Mark Weaver and I were talking about something like a > special quasiquote that could be used for translations with gettext, > since many translations are very tricky in situations like: >=20 > `(p "Download from " > (a (@ (href ,link)) > "this webpage") ".") >=20 > The naive approach would be to have different translations for > "Download from " and "this webpage" and (egads) "." >=20 > However this is called "lego translations" and unfortunately is nowhere > near as elegant as lego... different languages have different > word order so there is no safe way to "break apart" a translation like > this into bits. >=20 > The right way to do it using a special gettext quasiquote would probably > be like: >=20 > #_(p "Download from " > (a (@ (href #_,link)) > "this webpage") ".") >=20 > or some such thing, which could then produce a string for translation > that looks like: >=20 > "(p \"Download from \" > (a (@ (href #_,$1)) > \"this webpage\") \".\")" >=20 > or some such thing. >=20 > What do you think about this direction? It would require some new > tooling, but I think it's the best way forward probably? I currently use (div (@ (id "content")) ,body (footer (div (@ (id "contact")) (h1 (@ (class "contact-heading")) ,(_ "Contact me:")) (div ,(_ "Mail:") " " (a (@ (href "mailto:pelzflorian@pelzflorian.de")) "pelzflorian@pelzflorian.de")) (div "XMPP:" " " (a (@ (href "xmpp:pelzflorian@chat.pelzflorian.de?message")) "pelzflorian@chat.pelzflorian.de")) (div ,@(__ "GnuPG key: ||gnupglink_|| (valid until \ ||gnupgexp_||)" `(("gnupglink_" . ,(a-href "/files/key.asc" "0x4947055B")) ("gnupgexp_" . "01/27/2019"))))) (div (@ (id "source-code-link")) ,@(__ "Find the source code for this website \ ||link_|here||." `(("link_" . ,(lambda (text) `(a (@ (href ,(build-url "git" "pelzfloriande-website"))) ,text)))))) (div (@ (id "powered-by")) ,@(__ "Powered by \ ||link_|https://www.gnu.org/software/guile/|GNU Guile|| and \ ||link_|https://haunt.dthompson.us/|Haunt||." `(("link_" . ,a-href)))))) This works with existing Gettext. Special syntax would perhaps be easier to write, but I don=E2=80=99t know what kind of Gettext string it should produce. "Find the source code for this website \ ||link_|here||." uses the symbols (well, strings) like "link_" specified in the code. (Note that I want a clear separation between Gettext and Scheme code. This is not always desirable, but often is.) Regards, Florian --akn4rr4r23ux24ff Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEwRjGsqAMqXB4uw3y3T6EbElHBVsFAloziScACgkQ3T6EbElH BVvkQw/9FFR0jWY6DoCJ1Ps8+clv4TQcpCGo/2NvsyZlqGo3xDNc86Dqi+VJM0xz 3lDNTak90/ZY7qsdC1rXDb8YZLJSvZLMQB/ZBnmn4ZsO38K7Yc/xWhPThjzsCy8h 5nc0lnQWGzGC12kEDXhFrjVW9lHkIIKbOxpASNZ+O/Ep9UcspDD0ypYowuRq80YK N3UgVFhYW0fngXrQWkr/uXZmp/5UHCSEa9udWEZglr/Qf9hY7UJTp1ycoOn3rtl5 Juhimhhqvs/hGx36O3RXuHqP3iQ2XhoDuRveDQpk3QO9mwn606Ik/H160qkXFmxt CIzSU7L6KVnHTvZ4zkXAZoYOv9oiiFMkjyK/2DqVR9uTE6g2awM/iAOIOTr272iZ HqKOfvBd1hzXaz7HH6YI4VmgimXUseKPXI01Xt0JZ5R5YGq3fTiiKjRcMhobw5kV suFGgogY1yJ2CdU6l4gl0s68QdNWz5N3yRd66e84GSFQJh/9KpNxUQQvf9HYbu5v qfWilkKNCR8mozkdU5EhNH8gMbYrMWg7sZWJRBJEpI7ayuv+XndF1C/qOiph1FgY oWpV5GIHhSPd+C2RIns6p8pGf6QvQjWWy/nxXKuox4HABX5KiJnWrrL8ZBdYIs15 TEnQzBzbwIPGcU7H+2HnzBfd5S309BANOj89kfmU25ixs6PQtzU= =uQzY -----END PGP SIGNATURE----- --akn4rr4r23ux24ff--