Approach to Multi-lingual texts
I have a small pollen zine that just got a translation. I wanted to include the translated text into the zine, but wasn't sure the best way to approach it and curious on if any of you have done this, and the approach you took!
I would want to have two different outputted zines: one in English and one in Spanish. I was thinking I could add some logic so that an arg passed to
raco pollen render would render it with the translation. One way would be to maybe have two different .ptree files, one for the english files and one for the spanish, and I just tell render which ptree file to look at? Ideally, though, I think I'd want to have each file be multi-lingual, as it'd make navigating the source a bit easier. So I would have two different sections per language, and then have the render be able to set which one gets picked up?
Hopefully that makes sense, thank you!
I have a defunct personal website that attempts at this problem. I use an environment variable
LANG to control which language I am in, then I simply call
raco pollen render several times on different values of
LANG. In a source file, I can use tags named
lang/th) where the content in the tag will only appear when
LANG is set to
<lang-code>. The output HTML for each
LANG are in completely separated directories, but that works well for me.
You can inspect any environment variable from within a tag function using
getenv (that’s a Racket thing, not a Pollen thing)
Deleting a branch is permanent. It CANNOT be undone. Continue?