Polylang is a great WordPress plugin for adding multiple languages to your site. This addon will allow you to tell Polylang which languages are in your email.
There are 2 approaches for using this AddOn:
- Multiple languages in a single email
- One language per email
The following examples assume you have installed Polylang and set up both English and Deutsch as the supported languages with English being the default language.
Multiple languages via shortcode
[plpost lang=language_code <title=title>]<post>[/plpost]
There are 2 parameters:
- lang which is the 2 character language code.
- title which is the optional title. Typically the translated version of the title. If no title is provided the email subject line will be used.
Between [plpost] and [/plpost] is the content of the post in the language specified. For best results place these shortcodes on their own line with no formatting.
For example in a single email:
[plpost lang=de title="Erster Beitrag"] Dies ist mein erster Beitrag. [/plpost] [plpost lang=en title="First post"] This is my first post. [/plpost]
Of course you can send a single language this way if you’d like.
One language via subject line
You can send emails that have the subject: “[de] Hier ist ein post” and Postie will automatically update the post to specify Deutsch (German) as the post language.
Please note if specify the full name (Deutsch) rather than the code (de) Postie will try to assign the post to a Polylang custom taxonomy and things won’t work as expected.
3.0.6 released 2021-09-01
- category translations are now applied if available
3.0.5 released 2021-04-29
- fix subject line detection
3.0.4 released 2020-03-04
- switch to postie_register_shortcode_pre
3.0.3 released 2020-02-19
- convert to class
3.0.2 released 2020-02-19
- Associate all translated posts together
3.0.1 released 2020-02-19
- Add plpost shortcode to allow multiple languages in a single post
2.0.2 released 2016-12-30
- Added compatibility with older versions of PHP
2.0.1 released 2016-12-19
- Added support for Polylang 2.0
1.0.1 released 2014-09-23
- Initial release