Translate WooCommerce notices safely

WooCommerce notices can contain fixed copy, printf placeholders, or request-specific customer and order data. POM Translate translates only a complete notice that was explicitly registered; it does not auto-register arbitrary rendered messages.

Why notices are restricted

A generated notice may include:

  • a product or coupon name;
  • an email address;
  • an order number;
  • a shipping location;
  • another value specific to the current visitor.

Persisting every rendered notice as a translation source could store private or unbounded data. POM Translate therefore performs a lookup without creating a new registry entry. If no exact registered translation exists, the original message remains.

Translate a stable notice

For a fixed message owned by an integration:

  1. Register the pre-merge source through the supported registered-string helper.
  2. Go to Translations → Other translations.
  3. Choose the target locale.
  4. Find the exact source message.
  5. Preserve every printf placeholder in the translation.
  6. Save and trigger the notice in a safe test flow.

Use positional placeholders such as %1$s when changing word order is necessary. Do not introduce, remove, duplicate, or change the type of a placeholder.

POM Translate compares placeholder tokens before accepting the translated notice at runtime. If they do not match, it returns the original message instead.

Gettext notices

Messages shipped by WooCommerce or an extension often belong to that product's gettext catalog, not the registered-string registry. Install its locale files or translate the text domain under Translations → Software translations.

Verify

Trigger success, error, and informational notices in the target language. Confirm that:

  • placeholders display the correct dynamic values;
  • links and HTML remain valid;
  • no customer-specific rendered notice appears in Other translations;
  • a missing or invalid translation falls back to the original safely.

Never register a notice after inserting customer, product, or order values. Register only its stable template when the integration controls that template.