No internet connection
  1. Home
  2. Issues

Make it possible to translate emails

By KajMagnus @KajMagnus2021-01-14 19:56:08.140Z

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:

  1. support-chat
  • 15 replies

There are 15 replies. Estimated reading time: 14 minutes

  1. In reply toKajMagnus:
    Rafał Łożyński @Ralphocean
      2021-01-15 13:43:57.046Z

      I will be so nice to have these translations via user interface not in Java files needs compilation

      1. 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

        1. Rafał Łożyński @Ralphocean
            2021-02-19 12:16:33.278Z

            Yes it is. In Polish we have dirrents endings depending on gender but ... you can ignore it on that level ;-)

        2. In reply toKajMagnus:
          Rafał Łożyński @Ralphocean
            2021-03-11 13:03:45.434Z

            I will be so nice to have these translations via user interface not in Java files needs compilation. How did you do that?

            1. 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.)

            2. S
              In reply toKajMagnus:
              Sascha Zelzer @saschazelzer
                2021-08-15 16:07:39.965Z

                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!

                1. 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)

                  1. SSascha Zelzer @saschazelzer
                      2021-08-16 06:47:53.038Z

                      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!

                      1. 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

                        1. 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.

                          1. SSascha Zelzer @saschazelzer
                              2021-08-17 22:41:07.644Z

                              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:

                      @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/resetpassword/resetPasswordEmail.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.html

                      https://github.com/debiki/talkyard/blob/master/appsv/server/views/login/verifyYourEmailAddrEmail.scala.html

                      https://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.html

                      https://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.html

                      https://github.com/debiki/talkyard/blob/master/appsv/server/views/unsubscribe/youHaveBeenUnsubscribed.scala.html

                      What 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 directory de_DE — that'd be here:

                      https://github.com/debiki/ty-translations/tree/master/emails/de_DE (does not yet exist)

                      1. SSascha Zelzer @saschazelzer
                          2021-08-17 20:42:38.526Z

                          @KajMagnus Thanks! I am getting started with that.

                          1. @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)

                            1. SSascha Zelzer @saschazelzer
                                2021-08-29 20:07:34.783Z

                                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.

                          2. Progress
                            with handling this problem
                          3. @KajMagnus marked this topic as Planned 2021-01-14 19:56:15.420Z.
                          4. @KajMagnus marked this topic as Started 2021-03-12 03:42:19.695Z.