unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: "pelzflorian (Florian Pelz)" <pelzflorian@pelzflorian.de>
To: Christopher Lemmer Webber <cwebber@dustycloud.org>
Cc: Guile User <guile-user@gnu.org>, guile-devel <guile-devel@gnu.org>
Subject: Re: Website translations with Haunt
Date: Fri, 15 Dec 2017 09:34:47 +0100	[thread overview]
Message-ID: <20171215083447.xk4xjyf4tw7gqfln@floriannotebook> (raw)
In-Reply-To: <87y3m4bqhz.fsf@dustycloud.org>

[-- Attachment #1: Type: text/plain, Size: 3307 bytes --]

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:
> 
> `(p "Download from "
>     (a (@ (href ,link))
>        "this webpage") ".")
> 
> The naive approach would be to have different translations for
> "Download from " and "this webpage" and (egads) "."
> 
> 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.
> 
> The right way to do it using a special gettext quasiquote would probably
> be like:
> 
> #_(p "Download from "
>      (a (@ (href #_,link))
>         "this webpage") ".")
> 
> or some such thing, which could then produce a string for translation
> that looks like:
> 
> "(p \"Download from \"
>      (a (@ (href #_,$1))
>         \"this webpage\") \".\")"
> 
> or some such thing.
> 
> 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’t 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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-12-15  8:34 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-09 18:06 Website translations with Haunt pelzflorian (Florian Pelz)
2017-12-09 18:15 ` ng0
2017-12-09 21:08   ` pelzflorian (Florian Pelz)
2017-12-09 22:29     ` ng0
2017-12-13 14:53       ` pelzflorian (Florian Pelz)
2017-12-10 15:22 ` Matt Wette
2017-12-10 19:21   ` pelzflorian (Florian Pelz)
2017-12-10 22:35     ` Matt Wette
2017-12-12  7:51       ` pelzflorian (Florian Pelz)
2017-12-12  8:03         ` ng0
2017-12-12  9:30           ` pelzflorian (Florian Pelz)
2017-12-12 13:45             ` Matt Wette
2017-12-12 18:47               ` pelzflorian (Florian Pelz)
2017-12-10 23:00     ` Matt Wette
2017-12-12  8:17       ` pelzflorian (Florian Pelz)
2017-12-14  9:16 ` Ludovic Courtès
2017-12-14 13:23   ` Thompson, David
2017-12-15 11:39     ` pelzflorian (Florian Pelz)
2017-12-15 14:01   ` pelzflorian (Florian Pelz)
2017-12-15  3:48 ` Christopher Lemmer Webber
2017-12-15  8:34   ` pelzflorian (Florian Pelz) [this message]
2017-12-15 12:06   ` ng0
2017-12-15 14:25     ` pelzflorian (Florian Pelz)
2017-12-16  9:54     ` Ricardo Wurmus
2017-12-16 12:37       ` pelzflorian (Florian Pelz)
2017-12-16 15:26 ` sirgazil
2017-12-16 19:30   ` pelzflorian (Florian Pelz)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171215083447.xk4xjyf4tw7gqfln@floriannotebook \
    --to=pelzflorian@pelzflorian.de \
    --cc=cwebber@dustycloud.org \
    --cc=guile-devel@gnu.org \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).