chyrp-lite
chyrp-lite copied to clipboard
Blog translation
Hello! I started a small blog with chyrp lite and I love this engine! It's very simple to understand.
I've just wondered: is it currently possible to translate all the posts/pages/... in another language? Currently, I'm writing it in English and I would like to also have it in French if possible.
Hello there,
Thank you for the kind words! I'm very pleased you are enjoying Chyrp Lite. :-) Do you want to add an automatic/machine translation, or do you want to translate the text yourself and present both versions as reading options?
I would like to translate it myself if possible, and have a button or something else to switch between versions.
There's a few different ways you could do this: some involving a module and/or a bit of theme customisation, but the simplest of all is probably to use the summary
HTML element. For example, when editing your blog post/page in the admin console, you would add the following to the bottom (or top, as your prefer):
Text of your English post or page. This can be anything you want, and include HTML/Markdown styling.
<details>
<summary>Version en français</summary>
French translation of the English text goes here. This can be anything you want, and include HTML/Markdown styling.
</details>
The summary element is great because it doesn't require any customisation of a theme or writing any code to handle the behaviour. It just works without any fuss. If you want the text visible by default instead of hidden, just use <details open>
.
Okay I got it, thanks for the help!