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

  • 7 replies
  1. In reply toKajMagnus:
    Rafał Łożyński @Ralphocean2021-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. 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

      1. Rafał Łożyński @Ralphocean2021-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 @Ralphocean2021-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. 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.