WPML
WPML support
When WPML is active, Smart Add-Ons automatically registers every addon group and field string with WPML String Translation, then looks up the translation on the storefront. No manual registration step is required.
What “supports WPML” means here. Both the lookup and the registration are real and wired up — creating or updating a group automatically registers its strings with WPML, and a one-time backfill covers groups that existed before WPML String Translation was active. Plugin UI strings (wp-admin menus, settings labels) are a separate .pot file and are not covered by this guide.
How WPML support works
When WPML is active (ICL_SITEPRESS_VERSION is defined), WpmlIntegration attaches to saue_translate_string and calls apply_filters( 'wpml_translate_single_string', $value, $context, $name ). You do not add that filter yourself.
StringTranslator runs every addon group’s name and description, and every field’s label, description, placeholder, and option labels, through that filter when a group is formatted for output.
Registration works the same way, automatically. Creating or updating a group fires an internal saue_register_string action for every string it collects; WpmlIntegration listens for that action and registers each one with WPML — resolving WPML’s configured default language first, since addon groups are authored in the site’s default language, not necessarily WPML’s.
Context and name values
Registration must use the same context and name values the plugin uses to look translations up. If they do not match, WPML will not apply the translation.
| String | Context | Name |
|---|---|---|
| Group name | saue_group | name_{group_id} |
| Group description | saue_group | description_{group_id} |
| Field label | saue_field | label_{field_id} |
| Field description | saue_field | description_{field_id} |
| Field placeholder | saue_field | placeholder_{field_id} |
| Option label | saue_field_option | option_{field_id}_{value} (or option_{field_id} if the value is empty) |
Registration happens automatically
Every call goes through do_action( ‘wpml_register_single_string’, … ) — the plugin never calls the older icl_register_string() directly. Groups created or edited before WPML String Translation was first active are covered by a one-time backfill that runs on the next admin page load and registers every existing group’s strings exactly once. Deleting a group unregisters its strings the same way.
No setup required
There is nothing to add to your own code. WPML support in Smart Add-Ons works out of the box: once a group has been saved at least once (or after the one-time backfill runs for older groups), its strings already appear in WPML → String Translation, ready to translate.
Translate the registered strings
- Open WPML → String Translation and filter by domain/context
saue_group,saue_field, orsaue_field_option. - Enter translations for each language. On the storefront, the built-in filter returns those translations when the visitor’s language matches.
- Plugin chrome (menus, settings, notices) uses the
sauetext domain and the.potfile in/languages/. That is unrelated to these dynamic addon strings.
Hook signatures: Hooks & Filters. For the underlying API, see WPML’s own wpml_register_single_string documentation (opens in new tab).