How to provide template translations as part of a module

Created on 12 March 2024, about 1 year ago
Updated 1 April 2024, about 1 year ago

Problem/Motivation

This may be a general config management question, but I only came across that requirement in the context of easy_email and thought it's a good starting point for asking the question:

We provide easy_email templates as part of a module. As we also provide that module in a number of pre-defined languages, we'd also like to provide the translated templates as config entities. However, we can't find a way to provide them and wonder what the best practice should be in such a scenario?

Should that translation go into a po file and be provided that way?

πŸ’¬ Support request
Status

Fixed

Version

3.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jurgenhaas
  • πŸ‡ΊπŸ‡ΈUnited States zengenuity

    I don't know if this is the "correct" way to do it, but I tried exporting the config of a template that had a translation and then mimicking the output in a custom module, and it appeared to work.

    If you have a have a template such as: module_name/config/install/easy_email.easy_email_type.test.yml

    The Spanish translation config file would be: module_name/config/install/language/es/easy_email.easy_email_type.test.yml

    I found that it worked when I installed the module. Both the template and its Spanish translation were installed. Note that the translation configuration file is different from the main one. It only includes the translated fields.

  • Status changed to Fixed about 1 year ago
  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    This is interesting, thanks a lot @zengenuity

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024