duncanmcclean / simple-commerce

A simple, yet powerful e-commerce addon for Statamic.
https://statamic.com/addons/duncanmcclean/simple-commerce
Other
147 stars 41 forks source link

Allow for translating order emails #769

Closed duncanmcclean closed 1 year ago

duncanmcclean commented 1 year ago

This pull request makes it possible to translate the order emails that are sent automatically by Simple Commerce.

All of the 'strings' in the order emails are wrapped in Laravel's __() helper - allowing for the individual strings to be overridden in a lang/{locale}.json file like this:

{
    "This email is to confirm that your order (**#:orderNumber**) has been marked as paid. An overview of your order is shown below:": "Diese E-Mail dient dazu, zu bestätigen, dass Ihre Bestellung (**#:orderNumber**) als bezahlt markiert wurde.",
    "Customer Details": "Kunde",
    "If you have any questions about your order, please get in touch.": "Wenn Sie Fragen zu Ihrer Bestellung haben, wenden Sie sich bitte an uns."
}

^ example above in German (lang/de_de.json)

Any notifications triggered by Simple Commerce will be sent in the locale of the site the order was created in. So, if an order is created in your German variation of a site, the emails will use the associated locale.

Fixes #768

github-actions[bot] commented 1 year ago

Released as part of v4.2.4.