WPML Support

Since version 1.4.0

ASA 2 is compatible with WPML. WPML is a powerful WordPress plugin to build multilingual websites. You can use WPML to translate ASA 2’s Amazon product templates.

Note

You need the WPML extension “String Translation” installed, to use ASA 2‘s WPML features.

Screencast



Activate

Before you can use ASA 2‘s WPML features, you have to activate the WPML support in the options section “i18n”:

Activate WPML support

Manage translations

After activation, ASA 2 will transfer all template translation strings to WPML. You can manage those string with the WPML extension “String Translation”. Switch to section section “WPML / String Translation” and you will see some new strings with domain “ASA 2”.

WPML String Translation

Click the link “translations” on every string to enter the translations for all the languages configured in your WPML settings. Remember to check “Translation is complete” before you save. Otherwise the translation will not be used.

WPML enter translation

Adding a new string for custom product templates

If you create your own ASA 2 templates and need new language strings, head over to section ASA 2 / Templates / Translation.

translation tab

Create as many new translations as you need and use the shown placeholder in your templates, e.g.:

{{ translate("my_sting") }}

Learn more about template translations in chapter Translation.

Every template translation string you create, will automatically be registered for WPML unless you did not activate option “WPML: Disable auto transfer”.

Switch back to “WPML / String Translation” to find it there and enter the missing translations.

Synchronize translations

You can manually synchronize all your ASA 2 template translations with WPML by clicking the button “Sync with WPML” on the template translations admin page. It will transfer all ASA 2 translations to WPML’s String Translation extension if they do not exist there already.

WPML sync button

Result

Translate a post or page with embedded ASA 2 shortcodes. Then use the WPML language switcher on the front-end and switch to another language. You will see that the template strings will be shown in the chosen language if you have maintained its translations in WPML’s “String Translation” extension.

translated page

See a live demo here: http://asa2-demo.de/wpml-support/

Known issues

Translations could not be synchronized

WPML sync failed

If you receive the message “Translations could not be synchronized with WPML.” after you clicked the button “Sync with WPML” on the template translations admin page, please make sure that WPML and the extension “String Translations” is activated. Otherwise ASA 2 is not able to interact with WPML.