Approach to Multi-lingual texts #89

Open
opened 3 years ago by zachmandeville · 2 comments
zachmandeville commented 3 years ago (Migrated from github.com)

Hello!

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!

Hello! 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!
sorawee commented 3 years ago (Migrated from github.com)

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/<lang-code> (e.g., lang/en, 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.

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/<lang-code>` (e.g., `lang/en`, `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.
mbutterick commented 3 years ago (Migrated from github.com)

You can inspect any environment variable from within a tag function using getenv (that’s a Racket thing, not a Pollen thing)

You can inspect any environment variable from within a tag function using `getenv` (that’s a Racket thing, not a Pollen thing)
This repo is archived. You cannot comment on issues.
No Milestone
No project
No Assignees
1 Participants
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: mbutterick/pollen-users#89
Loading…
There is no content yet.