How to translate your WisePops popups using Weglot
In this article, you will learn how to dynamically translate your WisePops popup with Weglot.
1. I am using Weglot on WordPress
Because of the way these popups are generated, Weglot will need to dynamically translate them.
Once you created the popups with WisePops and they are visible on your website, you can translate them by using the following PHP filter as a snippet (using the Code Snippets plugin, for example) or add it in your functions.php file:
add_filter( 'weglot_translate_dynamics', '__return_true' ); add_filter( 'weglot_dynamics_selectors', 'custom_weglot_dynamics_selectors' ); add_filter( 'weglot_whitelist_selectors', 'custom_weglot_dynamics_selectors' ); add_filter( 'weglot_allowed_urls', function( $urls ) { return 'all'; });
2. I am using another Weglot integration
1. Create your popups with WisePops
Once it's done and your popup(s) is/are active on your website, feel free to go to the 2nd step
2. Dynamically translate the popup(s)
Go into your Weglot dashboard > Settings > App/Shopify Settings:
Click on "add dynamic" and Copy-paste the element below into the dynamic popup
.wisepops-popup
Redo the same steps and Copy-Paste the element below:
.wisepops-tab
3. You're done!
Make sure to clear your browser cache and refresh your website; your popup(s) should now be translated!