Documentation > Send emails in user’s preferred language

Send emails in user’s preferred language

Browse Docs
Search Documentation

TranslatePress displays front-end content in the preferred language of the user. If any emails are triggered by email action (such as registration, placing an order) then the email will be sent in the user’s language. However, if the email sent to the user is triggered by an admin action (or other users) then it might not arrive in the recipient’s preferred language.

Translating WooCommerce emails in the preferred user’s language is entirely supported by TranslatePress, but if you are looking to provide support for another plugin/theme use the following code.

If your plugin doesn’t use gettext, but a custom templating system like Mustache, strings like “Hello {{name}}” will not be relevant to be translated manually as they would change with every user.

In this case, we suggest you add support for shortcodes in the subject and email body (do_shortcode), so users can use the conditional language shortcode for translating the emails: https://translatepress.com/docs/restrict-by-language/translation-shortcode/

The preferred language of the user is automatically stored and updated when the logged in user visits any page in front-end on its last visit.

It can be viewed and changed in the default WP Edit Profile form. In order to stop the language from being updated automatically, you can check the Always use this language checkbox. The user will still be able to change it’s front-end language preference using the front-end language switcher.

TranslatePress Multilingual

The best website localization service for WordPress websites. Manage everything from a visual interface.