How to insert text translated by WPML
WPML makes it easy to run a multilingual website with a single WordPress installation. With WPML you can translate pages, posts, custom types, taxonomy, menus and even the theme’s texts. Since Ad Inserter block codes for insertions (including all texts they may contain) are stored encoded in the plugin settings, it is not possible to access them directly. However, you can still make the texts in blocks translatable via WPML shortcode. Use the following WPML shortcode in the code window of Ad Inserter – example for Alternative payment method:
[wpml-string context="ad-inserter" name="alternative-payment-method"]Alternative payment method[/wpml-string]
This shortcode requires WPML String Translation plugin to be active. To translate this string, go to the WPML => String Translation page and search for the shortcode info.
Please note that in order for the strings to be registered and available for translation, you first need to visit the page that inserts the block with that string.
You can easily define WPML languages where you want insertion (white list) or don’t want insertion (black list). Use taxonomy list to whitelist or blacklist WMPL languages. For example:
wpml-current-language:en