Make it possible to translate emails
Currently Talkyard's user interface can be translated to other languages — need to make email translatable too (incl email subject line I suppose).
Linked from:
- In reply toKajMagnus⬆:Rafał Łożyński @Ralphocean
I will be so nice to have these translations via user interface not in Java files needs compilation
- KajMagnus @KajMagnus2021-01-18 02:19:34.445Z
Ok yes that's how I want this to work too. I guess I'll add a database table with email template texts, and default texts per language. And you can change the default text to something community specific, should you want to (for your own community only).
There'll be placeholders like
TV__FIRST_NAME
so you can write sth like this, in the email template text:Hi ${TV__FIRST_NAME}, Welcome to our community ....
or in Polish (via Google Translate):
Cześć ${TV__FIRST_NAME}, Witamy w naszej społeczności ...
(
TV__
can mean "template variable" and makes it simple for the Ty developers to find all template variables and where they're being used, by searching for "TV__
".)***
But what about genders and different forms of the words? In some languages, words have different endings, depending on the person's gender. Hmm
- Rafał Łożyński @Ralphocean
Yes it is. In Polish we have dirrents endings depending on gender but ... you can ignore it on that level ;-)
- In reply toKajMagnus⬆:Rafał Łożyński @Ralphocean
I will be so nice to have these translations via user interface not in Java files needs compilation. How did you do that?
- KajMagnus @KajMagnus2021-03-12 03:41:07.778Z2021-03-12 04:16:09.375Z
I postponed that. The translated emails are instead in Scala HTML templates, included in the program at compile time.
So, to translate more emails, one would send me those same Scala HTML template files as you did last time.
(Details: Maybe a bit surprisingly, creating an email template translation user interface, was more work than what I thought: Designing database tables, picking a template engine, sanitizing the resulting HTML so there cannot be any bad
<script>
tags, previews of email templates one edits, — none of these things is particularly complicated, but together it adds up and becomes a bit much work to do now, compared with other things.)
- SIn reply toKajMagnus⬆:Sascha Zelzer @saschazelzer
Hi, I am currently testing Talkyard on a German blog. Most of the UI is translated fine, but receiving verification E-Mails in English may be surprising for some of our users. Is creating a pull request for German email templates at https://github.com/debiki/ty-translations the way to go? Thanks!
- KajMagnus @KajMagnus2021-08-16 02:19:55.661Z
Hi Sachsa, yes, a PR for German email templates is the way to go. Actually, there are more emails to translate, than the 3 ones in the
pl_PL
(Polish) directory, but those might be a good start.Could you please also have a look at this Contributing section and the CLA?: https://github.com/debiki/talkyard#contributing (or maybe you already have)
B.t.w. I'm curious about how you first found out about Talkyard (that it exists, I mean)
***
Hmm you mentioned "receiving verification E-Mails in English" — here's the template file for email address verification emails: https://github.com/debiki/talkyard/blob/wkmcur/appsv/server/views/login/verifyYourEmailAddrEmail.scala.html (in case you were interested in that one in particular)
- SSascha Zelzer @saschazelzer
Hi, I would like to translate all email templates available, so I will have a look at the others, thanks. The CLA looks fine. I hope I can do the translation without setting up a full local Talkyard dev version, but I will do so if necessary (I am happy that I don't have to self-host for now).
What is the typically turn-around time for such contributions, until they are deployed for the hosted sites (assuming there are no extensive PR reviews and further updates)?
I am using Jekyll and have been researching a simple (read easy-to-use but still having features like anonymous posts with spam protection / moderation) blog system with a German UI for some time. I also wanted to be able to self-host if I have to (important fixes, the hosting service being taken down, etc.). Also, Talkyard is linked from the Jekyll website. Thanks for making Talkyard and helping out!
- KajMagnus @KajMagnus2021-08-17 04:26:17.275Z
Ok I'll make a list of all email templates :- ) (I'll reply later today or tomorrow morning)
I hope I can do the translation without setting up a full local Talkyard dev version
Yes that'll work fine. (Probably there'll be some typos, and I'll notice and fix (compile time errors).)
What is the typically turn-around time for such contributions, until they are deployed for the hosted sites
For not urgent contributions, it's 2 – 3 weeks. (Because typically there's a new version every 2 – 3 weeks.)
I am using Jekyll and have been researching a simple (read easy-to-use but still having features like ...
Ok, thanks for writing a bit about that
- KajMagnus @KajMagnus2021-08-17 11:17:22.211Z
What is the typically turn-around time for such contributions
@saschazelzer B.t.w. I can do an extra mini releases, with the translations, if it happens to be annoyingly long to the next planned release.
- SSascha Zelzer @saschazelzer
Thanks for this. It's not a deal-breaker for me to wait a couple of weeks. Although I'd be happy to have the translations online rather sooner then later of course. The PR for the German email template translations is now pending to be reviewed.
- In reply toKajMagnus⬆:KajMagnus @KajMagnus2021-08-17 11:10:44.806Z
@saschazelzer Here're all email templates of relevance to ordinary members, and a Welcome HTML page: (there're a few more email templates, for admins only, but the whole admin interface is in English anyway)
https://github.com/debiki/talkyard/blob/master/appsv/server/views/createsite/welcomeEmail.scala.html
https://github.com/debiki/talkyard/blob/master/appsv/server/views/invite/welcomeSetPasswordEmail.scala.html
https://github.com/debiki/talkyard/blob/master/appsv/server/views/invite/inviteEmail.scala.html
https://github.com/debiki/talkyard/blob/master/appsv/server/views/invite/inviteAcceptedEmail.scala.htmlhttps://github.com/debiki/talkyard/blob/master/appsv/server/views/createaccount/createAccountLinkEmail.scala.html
https://github.com/debiki/talkyard/blob/master/appsv/server/views/createaccount/newMemberToApproveEmail.scala.html
https://github.com/debiki/talkyard/blob/master/appsv/server/views/createaccount/accountAlreadyExistsEmail.scala.html
https://github.com/debiki/talkyard/blob/master/appsv/server/views/createaccount/welcomePage.scala.html
https://github.com/debiki/talkyard/blob/master/appsv/server/views/createaccount/accountApprovedEmail.scala.htmlhttps://github.com/debiki/talkyard/blob/master/appsv/server/views/confirmOneMoreEmailAddressEmail.scala.html
https://github.com/debiki/talkyard/blob/master/appsv/server/views/adminlogin/oneTimeLoginLinkEmail.scala.htmlWhat you could do, is to translate them (or as many as you want), and add the resulting files in the
ty-translations
repo, in a new directoryde_DE
— that'd be here:https://github.com/debiki/ty-translations/tree/master/emails/de_DE (does not yet exist)
- SSascha Zelzer @saschazelzer
@KajMagnus Thanks! I am getting started with that.
- KajMagnus @KajMagnus2021-08-26 04:39:02.357Z
@saschazelzer Now the new version with the translations has been deployed to the hosted sites (and the self hosted will follow in a day or two).
(I forgot that there are also email subject lines, not just the email contents — I'll make the subject lines possible to translate too)
- SSascha Zelzer @saschazelzer
Thank you! I tested some of them and it is looking good so far. Being able to translate the subject lines would be great. Please ping me as soon as this is supported and you would like to get the translations.
- Progresswith handling this problem