Next-Level Code. Nexuvibe Style ...

Hrs
Min
Sec
WooCommerce email • gettext safety 2026

WooCommerce Email Templates in Loco:
Translating Receipts Without Breaking Variables

Order confirmation and receipt strings look like prose in Loco until you notice the percent signs. One moved placeholder, one translated variable name, or one “helpful” rewrite of HTML table markup and the email renders like a broken spreadsheet in the inbox. This guide maps how WooCommerce exposes email copy to gettext, how assists should treat placeholders, and how you test before customers see mangled totals on their phones.

10 min read
Updated 2026
WooCommerce i18n
Translating WooCommerce email templates and order receipts in Loco Translate without breaking printf variables and HTML placeholders WordPress 2026

Store owners notice bad email copy faster than bad blog posts because money is involved. A receipt that shows literal %s tokens or missing order numbers erodes trust immediately. Loco gives you the strings; discipline gives you safe translations. Assists accelerate work only when they inherit rules that treat variables as sacred infrastructure, not as optional punctuation.

The goal is not “fluent English rewritten into fluent German.” The goal is a valid sprintf-compatible target string that still renders the same data fields in the same order WooCommerce expects. Anything else is a regression dressed as localization.

Loco AI Auto Translator for WooCommerce gettext assists with prompt rules that protect email placeholders belongs in the same toolkit as staged mail tests and a second pair of eyes on checkout strings.

What this guide covers
Where WooCommerce registers email-related gettext strings.
Printf-style placeholders versus HTML you must preserve.
Prompt and glossary patterns that reduce broken receipts.
Per-string fixes versus risky bulk passes on transactional copy.
A practical test plan before production sends.
Extensions and custom templates that raise the difficulty curve.

Why email strings punish small mistakes harder than storefront labels

Product pages tolerate slightly awkward phrasing. Transactional email does not. A broken placeholder can blank a total, repeat a billing address twice, or show raw markup to a customer who is already anxious after clicking Pay. The defect rate you accept for marketing copy should be lower for receipts, refunds, and failed payment notices.

WooCommerce composes many emails from PHP templates that pass dynamic fragments through translation wrappers. That means your msgid often interleaves human language with machine slots. Translators who think sentence-first will reorder clauses and accidentally reorder data arguments unless someone enforces positional placeholders.

WooCommerce documents email customization and common pitfalls at a high level. Pair that reading with Loco’s row-level view so you see the exact msgid the runtime passes to translators.

Separate mental models for customer-facing receipts and admin notifications. The former appear in inboxes under stress; the latter appear in operations queues where staff may tolerate awkward phrasing but still need accurate SKUs and fee lines. Prioritize customer-facing strings in review queues and allocate senior reviewers to completed-order and refund templates first.

Subject lines deserve the same placeholder discipline as bodies. A truncated subject with a missing order number damages open rates and triggers support tickets. Preview subjects with the longest realistic order IDs and customer names your catalog can produce, not only with tidy seven-character samples.

If your stack sends partial order updates or custom “order note” emails from extensions, map each trigger in a spreadsheet: hook name, template file, language domain, and last test date. Localization debt hides in rarely triggered emails until an edge-case refund embarrasses you in public.

Hard rule
If you cannot name what each placeholder becomes at runtime, stop translating and open the template source. Guessing produces receipts, not localization.

Placeholders: positional versus named, and why order is not “style”

PHP’s sprintf family uses tokens like %s and %d. When multiple values insert into one sentence, positional forms such as %1$s and %2$s exist so translators can reorder clauses without reordering data. If the source msgid uses bare %s twice, the safe target often needs explicit positions when the target language demands a different phrase order.

Assists that “smooth” copy sometimes strip percent sequences or convert them to full-width characters. That is not a cosmetic diff; it is a runtime failure waiting in queue. Your review checklist should include a mechanical scan for placeholder count and shape before any MO ships.

The PHP manual’s sprintf reference is the authoritative reminder that format strings are code, not prose.

🔗Maintaining printf placeholder safety in WooCommerce ensures translated receipts display order totals and product names without corrupting the underlying data structure. →

You see in Loco Typical meaning Review focus
%s String slot Count matches source
%1$s, %2$s Ordered slots Indices preserved
{variable} Some templates Do not translate names

Real incidents often trace to pluralization and gender agreement, not ignorance. A language that needs different sentence shapes for singular versus plural orders may force clause reordering; that is exactly when positional placeholders earn their keep. If your source msgid lacks positions, consider requesting a developer pass to add them before translators invest hours in fragile workarounds.

Currency and number formatting are usually handled by WooCommerce formatters, but strings sometimes embed raw amounts as %s already formatted. Mixing manual currency symbols inside translated text with automated formatting can duplicate symbols or omit ISO codes B2B buyers expect. Align with your commerce lead on whether prices in email should remain formatter-owned only.

Keep a “do not translate” list for short tokens that look like words but are keys: gateway IDs in footers, referral campaign codes in partner templates, or tracking parameters inside URLs. Paste that list beside your glossary so assists and humans share one source of truth.

HTML in emails: tables, inline CSS, and assists that love to “fix” markup

WooCommerce emails often include layout HTML: table rows, inline styles, and anchor tags around dynamic links. A completion that rebalances tags for aesthetic reasons can break nesting. Email clients are less forgiving than browsers; a missing closing td can truncate the rest of the message.

Treat HTML-bearing msgids as higher risk than plain labels. Run them through an HTML-aware reviewer or a diff tool that highlights tag changes. A green check from a fluent speaker is not a substitute for structural validation.

WordPress’s internationalization guidelines explain how translators should approach strings that include markup. The short version: translate around tags, not through them, unless the project explicitly allows inline edits.

Loco Translate editor showing Loco AI Auto Translator action buttons for careful per-string WooCommerce email gettext edits

Per-string Loco AI Auto Translator assists inside Loco for high-risk WooCommerce receipt strings keep fixes surgical when bulk would touch fifty related rows.

When in doubt, translate the smallest surrounding chunk and leave the table skeleton untouched. Incremental progress beats one heroic rewrite that silences order totals.

Some teams mirror email HTML through Litmus or similar services; others rely on raw source view in Gmail. Either path is fine if someone actually looks. “Looks fine in Outlook” is not transferable truth to Apple Mail without a send proof.

Dark mode clients alter background contrasts. If your template relies on hard-coded near-white table cells, translated copy with longer words may wrap differently and expose color seams. That is a design issue, but translators should flag when line breaks shift financial columns visually.

Prompt rules: teach assists that variables are not vocabulary

Your custom instruction layer should state, in boring language, that every substring matching placeholder patterns must appear unchanged in the output unless the target language requires positional indices and those indices are explicitly updated. Boring instructions beat clever ones because reviewers can verify compliance mechanically.

Also forbid translating brand tokens, coupon codes, or SKU fragments that appear as examples inside msgids. Email copy often embeds sample values for designers; those samples still travel through gettext.

Review prompts after major WooCommerce upgrades. Core sometimes rephrases default English email strings; your guardrails should still apply to the new msgids.

🔗While translating WooCommerce emails, developers must also locate block theme strings in Loco to ensure Full Site Editing components remain fully localized without breaking dynamic content. →

When assists propose adding politeness particles or honorifics, verify they did not insert characters inside placeholder tokens. Unicode lookalikes are rare but brutal; a percent sign that visually matches ASCII but is not will fail sprintf parsing. Diff tools that highlight code points help more than eyeballing alone.

If you maintain multiple prompts per client tier, name them in Loco’s surrounding documentation or your ticket system. “Default prompt” and “Enterprise legal prompt” should never be ambiguous strings in a Slack channel.

Glossary entries that help receipts without inventing new placeholders

Consistent translations for “Order,” “Subtotal,” “Tax,” and “Shipping” reduce cognitive load for shoppers reading multiple emails in one purchase journey. A glossary enforces that consistency across strings that assists might otherwise vary for stylistic reasons.

Keep glossary rows short and literal. Avoid glossary entries that try to rewrite entire sentences containing placeholders; those belong to human review or tightly scoped per-string assists.

GNU gettext’s PO file basics help new teammates understand msgid and msgstr boundaries before they touch production MO files.

Bulk assists on email domains: wave sizing and human gates

Bulk completion is attractive when hundreds of WooCommerce strings remain. For email-related domains, shrink wave size and insert a human gate every N rows. The cost of missing one broken receipt exceeds the cost of slower batches.

Filter Loco by file or domain when possible so you translate woocommerce email templates separately from unrelated plugin strings. Context isolation reduces accidental edits to unrelated rows sharing similar English.

When you must run broader batches for timeline reasons, sort output by string length descending before human review. Long rows correlate with HTML and multiple placeholders; reviewing them first catches catastrophic defects early.

Fallback vendor routing can rescue a stuck batch, but only if secondary completions obey the same placeholder contract. Treat model swaps like compiler upgrades: rerun smoke tests on the email set, not only on storefront labels.

Turbo modes belong off for first passes on transactional templates. Speed is a luxury reserved for low-risk domains or second passes after prompts stabilize.

Testing: staged sends, log plugins, and real inboxes

Compile MO, flush caches if your stack caches translations, then trigger each email type: processing, completed, refunded, failed, customer note, password reset if your flow uses it. Use realistic orders with tax, shipping, and discounts so tables populate edge columns.

Mail logging plugins help teams without SMTP access to production inboxes. Treat logs as staging artifacts with retention policies; they contain PII. GDPR-minded clients should sign off on where logs live.

Mobile clients deserve explicit checks. Narrow screens expose table mistakes that desktop webmail hides. Send tests to iOS Mail and a mainstream Android client at minimum.

Build a repeatable order fixture: a known SKU mix, a coupon, a shipping zone with fees, and a tax line if your jurisdiction requires it. Reuse that fixture after every translation deploy so comparisons stay apples-to-apples. Ad hoc random carts hide regressions.

If your team uses HPOS or custom order storage, confirm email triggers still fire the same templates you translated. Storage refactors should not skip regression mail passes even when the storefront looks unchanged.

Document who approves “translation complete” versus “email safe to send.” They can be the same person on small teams; on larger teams, split the roles so velocity does not shortcut verification.

Email regression pass
1.Compile MO; clear opcode caches if applicable.
2.Trigger each core email type from the fixture order.
3.Verify placeholders resolve to live data, not literals.
4.Compare HTML structure to baseline screenshots or source dumps.
5.Archive results in the ticket; link failed rows back to Loco msgids.

✓ Do

Snapshot expected HTML from English baseline; diff translated output against structure, not only wording.

🔗While standard order receipts require careful handling of placeholders, WooCommerce subscription translation risks escalate when recurring billing strings involve trials, proration, or dunning messages. →

✗ Skip

Ship Friday at 4 p.m. because “Loco says 100%” without a single inbox proof.

Custom templates, child themes, and plugins that add their own mail

Child theme overrides can replace WooCommerce email PHP files. Those overrides may introduce new gettext calls or hard-coded English. Sync Loco after theme deploys; treat theme releases as localization events.

Subscriptions, bookings, memberships, and B2B invoicing plugins often register additional emails with their own placeholder conventions. Never assume WooCommerce core rules cover them. Read each plugin’s translation notes if the author provides them.

When multiple plugins contribute strings with similar English, use msgctxt or file paths in Loco to avoid translating the wrong row. Collisions cause silent wrong-string bugs that assists amplify.

Marketing automation tools that wrap WooCommerce events may duplicate email content in their own templates. If those systems pull partially translated strings or bypass gettext, you get bilingual Frankenstein mail. Inventory every integration that sends commerce email and test each path.

For multilingual stores, confirm language negotiation: customer locale selection, user profile language, and order meta should align with the MO you compiled. A correct PO file paired with the wrong runtime locale looks like a broken translation when it is actually a routing bug.

Finally, schedule periodic re-audit. Plugins add strings on update. A quarterly diff of POT exports compared to your last project snapshot surfaces drift before shoppers do.

WooCommerce guidance on template structure and overrides helps developers place custom email files predictably so translators know where strings originate.

Synthesis: receipts are contracts rendered as HTML

Translating WooCommerce emails in Loco is part copywriting and part release engineering. Placeholders, markup, and plugin-specific tokens form the contract between PHP and the inbox. Assists save time only when prompts, glossaries, wave discipline, and inbox tests align. Loco AI Auto Translator as the Loco Translate assist extension for WooCommerce email gettext with glossary, prompts, bulk progress, and per-string repair fits that workflow when humans still own the final send button.

Ship translations the way you ship payment code: small batches, explicit verification, and rollback plans. Customers forgive a quirky blog hero; they do not forgive a receipt that lies about what they paid.

Keep previous MO bundles labeled by release in your artifact store. Rolling back translation should be as boring as rolling back a plugin version: one click, one verified restore, one mail pass to confirm nothing else moved.

Teach client stakeholders that email gettext is never “done” while WooCommerce and extensions keep shipping updates. Budget a small recurring line item for re-sync and re-test, the same way you budget security patches. That modest line item is cheaper than emergency inbox firefighting.

Loco AI Auto Translator product thumbnail for WooCommerce email gettext localization

Loco AI Auto Translator
Localize WooCommerce receipts in Loco without breaking variables.

Get Loco AI Auto Translator

Picture of Mahdi Jabinpour

Mahdi Jabinpour

As a sales-driven developer and the founder of NexuWP, Mahdi focuses on building WordPress solutions that don't just work—they convert. From AI-powered bulk translation engines to high-efficiency media offloading, he helps business owners automate the "grind" so they can focus on global growth. He is a pioneer in integrating advanced LLMs into the WordPress workflow.

RELATED POSTS

RELATED POSTS

3 Reviews
Matthew Thomas 5 months ago

Finally, a guide that actually treats WooCommerce email variables like the critical pieces they are. We wasted hours last year chasing down a refund template where a translator "improved" the wording and accidentally wiped out the order number placeholder. Of course, customers caught it before we did because when money's involved, people pay attention. the focus on testing staged emails and keeping sprintf compatibility intact is seriously overdue. Honestly, this should be mandatory reading for every dev and translator who works on checkout flows. Bookmarking this for our next localization push it's that good

Mark Jackson 5 months ago

Hey everyone! a friend recommended this guide when I was trying to translate WooCommerce receipts for my little side hustle. The tip about keeping those weird %s placeholders intact was a total lifesaver I had no clue how easy it was to mess up order totals just by changing a few words

Mahdi Jabinpour 5 months ago

That placeholder trick has saved me plenty of headaches too those little percentage signs can be surprisingly tricky! hope it made your process a bit easier

John Taylor 5 months ago

The WooCommerce email translation guide was a lifesaver for a non developer like me trying to customize receipts for multilingual customers. i had no idea how easy it is to mess up placeholders like %s when you're just trying to make sentences flow naturally in another language. That tip about testing emails before sending them live? really helpful probably saved me from a disaster with order confirmations. I do wish there were more real world examples for languages with totally different sentence structures, though

Mahdi Jabinpour 5 months ago

Your feedback on the guide is really helpful those placeholder issues trip up even the most experienced teams. we'll make sure to include more examples in the next version

Please log in to leave a review.