Skip to navigation Skip to main content

How to Translate Your Contact Bar With TranslatePress or WPML

mloun whatsapp prefilled message

Floating contact bars are a classic translation trap: the visible label is often drawn by CSS, so the text exists on screen but never in the page’s text nodes. TranslatePress and WPML scan text nodes, so those labels never appear in the translation list.

This article explains which parts translate, which do not, and how to fix the ones that do not.

What translates automatically

  • Channel names and every button label you type in the plugin settings (they are saved as text)
  • The fold / unfold labels
  • Settings screen strings, via the bundled language pack

What does not translate, and why

Anything rendered through content: attr(...) in CSS. The browser paints the text, but there is no text node for a page translator to hook into. In older releases the fold bubble worked exactly this way — visible to humans, invisible to translators.

If a label is missing from TranslatePress

  1. Hover the element so the label is on screen.
  2. Click it in TranslatePress’s translation mode.
  3. If nothing is selectable, the label is CSS-generated. Search the plugin CSS for content: attr( — anything you find there needs the fix below.

The fix: labels as real text

Render the label inside the element as a span, then show and hide that span with CSS instead of generating the string. This is what the plugin does since 1.4.29 (free) and 0.15.10 (PRO):

<span class="mlsc-tip mlsc-tip-closed">Contact Us</span>
<span class="mlsc-tip mlsc-tip-open">Hide</span>

Now both labels exist as text, TranslatePress lists them, and the styling is unchanged because the spans inherit the same bubble styles.

Translating with WPML

The mechanism is the same. WPML’s String Translation will pick up the labels once they are text nodes; values you typed into the widget settings are also strings you can translate per language.

A note on your own copy

The pre-filled WhatsApp template is user text, not a UI string, so it is not translated by the language pack — which is what you want. Write one template per language, and keep the variables ({product_name}, {page_url}) intact in every version.

FAQ

Can I translate the channel names?

Yes. They are saved strings, so both TranslatePress and WPML can translate them per language.

Does translating the bar break the click statistics?

No. Channel slugs are internal identifiers and never translated; only the labels a visitor sees change.

What about RTL languages?

The bubble flips to the opposite side automatically because the layout follows the writing direction of the page.

Where this fits

The real-text labels ship in both editions; PRO adds the Chinese language pack and the per-language display rules.

READY WHEN YOU ARE

Get Your Free Proposal in 24 Hours

Tell us your product and target market — in English, 普通话, or 粤语. Within 24 hours you'll get a concrete plan: scope, timeline, and a fixed price.

Free strategy call · Fixed quote · No obligation

Contact Form