Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n support in Emails and Messages app #726

Open
1 task
krzysztofwolski opened this issue Jul 6, 2023 · 1 comment
Open
1 task

i18n support in Emails and Messages app #726

krzysztofwolski opened this issue Jul 6, 2023 · 1 comment

Comments

@krzysztofwolski
Copy link
Member

krzysztofwolski commented Jul 6, 2023

Problem I would like to solve

Send fully translated emails to customers.

Intro

API

Saleor API provides translation models that the App could use. To choose a language, we can:

Currently, the API does not provide a way to automatically detect language and add a proper translation to the subscription. It means additional API calls after receiving the webhook.

Templates

Sendgrid and SMTP providers lack dedicated i18n support and require conditional rendering with Handlebars to localize text. Sendgrid documentation with examples for reference.

For initial i18n implementation in the EAM, it would be recommended approach. As a potential improvement in the future, we could make configuration variants depending on the language:

  • user creates a base configuration, it will be used as a fallback if there's no variant related to the email language
  • user creates a dedicated variant for the language. A variant would provide an interface to choose a different sender, message subject and template.

When a webhook arrives, the App checks for any configuration variant of the event language. If none is found, the base configuration is used.

The proposed solution increases the app's complexity (both for implementation and for the user).

Impact

  • modify webhook subscriptions to add customer/event language code
  • add queries for model translations
  • add translations to template payload

Tasks

  1. 0 of 2
    App: Emails & Messages
@krzysztofwolski
Copy link
Member Author

The #816 PR added translated fields for the product and variant names. Other fields, like attribute names, are not translated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant