The loyalty widget in Loyalty Program for WooCommerce renders inside an iframe so its styles stay isolated from your theme. The trade-off is that TranslatePress’s visual editor cannot reach into iframes to detect or click on the strings inside. To solve this, the plugin ships with a built-in TranslatePress integration that registers every admin-entered widget label into TranslatePress’s database server-side. You translate the strings from the WordPress dashboard like any other content, and the widget renders in the visitor’s language automatically.
How the Integration Works
When TranslatePress is active, the plugin automatically hooks into the widget configuration before it is sent to the iframe. Every label you entered in the widget settings (header title, tab names, button labels, descriptions, guest block text, and so on) is passed through TranslatePress’s translation engine for the visitor’s active language. Strings that already have a translation are returned translated. Strings that do not yet have a translation are inserted into TranslatePress’s regular strings table so they appear in the dashboard for you to translate.
The integration activates only when TranslatePress is installed and active. If you do not use TranslatePress, nothing changes: the widget renders in whatever language you entered into the admin fields, exactly as before.
Setup Steps
- Install and activate TranslatePress. The free version on the WordPress plugin repository is enough to translate the widget. Premium addons are not required.
- Configure your languages. Go to Settings → TranslatePress → General. Set your default language and add at least one translation language. Save.
- Enable the loyalty widget. In your WordPress admin, open the Loyalty Program plugin, go to the Widget settings, and make sure the widget is enabled. Fill in the widget text fields (header title, button labels, etc.) in your default language.
- Visit a translated front-end URL. Open your store on a translated language URL (for example,
/en/if English is your secondary language). Make sure the loyalty widget is visible on that page. This first visit is what registers the widget strings into TranslatePress’s database. - Open the String Translation dashboard. In your WordPress admin, go to TranslatePress → String Translation.
- Switch to the Regular tab. This is the most important step. The widget strings are not in the Gettext tab. Click the Regular tab in the top of the String Translation screen.
- Pick the target language from the language dropdown, locate each widget string, enter the translation, and save.
- Reload the translated URL. The widget now renders with your translations.
Why the Strings Are on the Regular Tab
TranslatePress organises translatable content into two main groups:
- Gettext strings are strings that developers wrap in PHP translation functions (such as
__()) inside the plugin code. These are typically built-in labels like error messages or default button text. - Regular strings are strings that come from user input, options tables, or any dynamic source. Anything you typed into the widget settings is a regular string.
Because the widget labels are content you entered (not hard-coded in the plugin), they live on the Regular tab. The Gettext tab is where you would translate the small set of hard-coded labels the widget uses internally, such as “Login Required” or “Free shipping”.
Which Widget Strings Are Translatable
Every admin-entered text field in the widget settings is exposed to TranslatePress. This includes:
- Launcher button text
- Header title and subtitle
- Points program title, description, and tab labels (“Ways to Earn”, “Redeem Points”)
- Points redeem button text and reward success message
- Referral program title, description, and share link section text
- Ranks section title and description
- Rewards (coupons) section title and description
- Earn Points page title and back button
- Redeem Points page title, description, and claim button
- Guest block title, description, and call-to-action button text
If you add a new string to the widget admin settings later, simply visit a translated URL once with the widget enabled. The new string registers on first render and appears in the Regular tab ready for translation.
Troubleshooting
Strings do not appear in the Regular tab
Strings register on first front-end render. If they are missing:
- Confirm the widget is actually visible on the translated language URL. Open
/en/(or whatever your secondary language slug is) in a logged-out browser session and check that the widget launcher appears. - Open the widget so its panel renders fully, not just the launcher.
- Reload the String Translation dashboard.
- If you use page caching, clear the cache for the translated language URL and reload it.
I translated the strings but the widget still shows the original text
- Confirm you saved the translation against the correct target language in the Regular tab.
- Clear any page or object cache that might be holding the previous widget configuration.
- Hard-refresh the front-end (Cmd+Shift+R or Ctrl+F5) to bypass the browser cache on the widget assets.
Translations work on the page URL but not when widget data is fetched in the background
The integration detects the active language from TranslatePress’s runtime context and, for background requests, from the page URL the request came from. This works on standard subdirectory and subdomain TranslatePress configurations. If you use a non-standard URL structure and run into issues, contact support with details about your setup.
Compatibility With Other Multilingual Plugins
The plugin also ships with a separate WPML integration that handles loyalty emails. The TranslatePress and WPML integrations are completely independent: only the one that matches your active plugin will run. You do not need to disable anything when switching multilingual plugins.