fixthestatusquo / proca

Widget to transform your website into a cutting-edge campaign in 10 min. multi-lingual, privacy first.
https://proca.app
GNU Affero General Public License v3.0
36 stars 12 forks source link

Extracting default email strings should be improved #1221

Open 1v4n4 opened 1 year ago

1v4n4 commented 1 year ago
  1. Campaign flag (--campaign) in bin/template.js extract strings from the default email template to campaign configuration. At the moment it extracts whatever is in the default template, and not what is generated.

Example: We have EN text in the default template and we are generating DE email. Strings in the campaign config will be from the default template (in EN) which is inconsistent with what we actually have in the generated email.

To do: extract strings from generated email, not from the default template.

  1. Strings in EN locales are not created if the widget language is different than EN.

Problem: If we extract DE strings, they will not be displayed in the dashboard/translations.

To do: add empty strings in EN locales

  1. Subject is not extracted
tttp commented 1 year ago

Hi,

in normal use, any text in a template that has a i18n key is ignored and replaced to the text as set in src/locales/xx/server.json

the aim of the --campaign was to allow a specific campaign to overwrite these xx/server.json messages, the same way you can overwrite the common.json texts in a specific campaign.

so I think it's more logical to use the texts in src/locales/xx/server.json as the default for the campaign texts, as opposed to the texts in the templates, that are never used.

however, the improvement should be IMO: