[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Website translations with Haunt
From: |
pelzflorian (Florian Pelz) |
Subject: |
Re: Website translations with Haunt |
Date: |
Fri, 15 Dec 2017 09:34:47 +0100 |
User-agent: |
NeoMutt/20171208 |
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:address@hidden"))
"address@hidden"))
(div
"XMPP:"
" "
(a
(@
(href
"xmpp:address@hidden"))
"address@hidden"))
(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
signature.asc
Description: PGP signature
- Re: Website translations with Haunt, (continued)
- Re: Website translations with Haunt, pelzflorian (Florian Pelz), 2017/12/12
- Re: Website translations with Haunt, ng0, 2017/12/12
- Re: Website translations with Haunt, pelzflorian (Florian Pelz), 2017/12/12
- Re: Website translations with Haunt, Matt Wette, 2017/12/12
- Re: Website translations with Haunt, pelzflorian (Florian Pelz), 2017/12/12
- Re: Website translations with Haunt, Matt Wette, 2017/12/10
- Re: Website translations with Haunt, pelzflorian (Florian Pelz), 2017/12/12
Message not available
Re: Website translations with Haunt, Christopher Lemmer Webber, 2017/12/14
Message not available
Re: Website translations with Haunt, sirgazil, 2017/12/17