Cost Control: Estimating Tokens per String
Before You Commit to a Full Plugin Locale
Vendor assists bill by how much text you send and how much text comes back, not by how many blue rows you see in Loco. A WooCommerce extension that looks like “a few hundred strings” on paper can hide megabytes of HTML snippets, legal footers, and plural forms that multiply every request. This guide shows how to estimate per-string cost, sample a locale honestly, and stop promising flat fees that collapse the first time someone enables turbo on a checkout plugin.
Updated 2026
Localization ops
Agencies lose money twice on bad estimates: once when the assist bill exceeds the quote, and again when the client pauses mid-locale after discovering the same truth. Tokens are the meter. If you cannot describe, in a spreadsheet row, what you expect each string family to cost, you are not ready to commit the whole plugin. You are ready to run a sample wave and read the numbers.
Per-string thinking beats per-plugin slogans. Two msgids named “Shipping” can differ by an order of magnitude if one is a twelve-character label and the other embeds a table of carrier clauses. Loco exposes that honesty. Finance should inherit it before anyone clicks “translate all.”
Loco AI Auto Translator for controlled bulk gettext assists on WordPress with visible batch scope helps operators align vendor spend with the rows they actually select, instead of pretending every string weighs the same.
Tokens are the meter; strings are just the index
Most billing dashboards summarize usage in tokens or characters. A token is not a word in the literary sense; it is a chunk the vendor’s tokenizer learns from training data. English marketing copy often lands near three-fourths of a word per token, but HTML attributes, WooCommerce placeholders, and SKU-heavy catalogs skew the ratio. Treat published averages as hypotheses until you measure your own PO export.
Each assist call typically includes: instructions you set once, any glossary or style block the integration attaches, the source string, surrounding context if the product sends it, and the completion that returns. You pay for the whole envelope, not for the two words you mentally focused on. That is why “translate five hundred strings” is never a sufficient brief for finance.
WordPress’s own primer on internationalization APIs explains why developers wrap user-visible text in gettext calls. Your job is to connect that engineering discipline to procurement discipline: every wrapped string is a potential invoice line.
System and user instructions, glossary injections, source msgid and msgctxt, prior translator comments if forwarded, plus the model completion. Each layer adds length before anyone debates fluency.
Rows in the editor. Bridge that gap early: row count times optimistic tokens is how quotes turn into losses.
GNU’s gettext plural-forms documentation clarifies why a single conceptual phrase can occupy multiple rows. Plural entries are not “duplicates” for estimation; they are multipliers.
When vendors publish “tokens per million” pricing, convert that into a mental model your PM understands: take your sampled average input plus output tokens per row, multiply by expected rows, apply the vendor rate, add tax and currency drift. The spreadsheet row should expose each factor so finance can stress-test it. Hiding assumptions inside a single cell named “API cost” guarantees a surprised director later.
Remember output tokens grow with verbose languages. A German completion often consumes more tokens than the English source suggested. If you quote English-to-English sanity passes differently from English-to-Japanese market launches, say so in the assumptions column. Parity across locales is a linguistic goal, not a billing law of nature.
The thirty-minute sampling protocol agencies skip, then regret
Before quoting a full plugin locale, export the POT or PO, stratify rows into buckets, and measure. Bucket A: short labels under forty characters. Bucket B: sentences without markup. Bucket C: strings containing HTML tags or inline links. Bucket D: legal, tax, or subscription disclaimers. Bucket E: pluralized inventory. Randomly sample ten rows per bucket, run assists on staging, and record vendor usage metrics if your dashboard exposes them. If it does not, approximate with a local tokenizer your team trusts and mark the estimate conservative.
Multiply bucket averages by bucket counts. Sum. Add ten percent for retries and human spot checks unless you have historical retry data for that client stack. Present the result as a range, not a point estimate. Ranges survive reality; point estimates become arguments.
If you refuse to sample because “the plugin is standard,” you are not estimating; you are marketing. Standard plugins ship nonstandard stores.
Screenshot the sampling wave. Attach it to the estimate email. Later disputes shrink when everyone remembers you proved the shape of the workload in advance.
Export the POT or sync PO from Loco; freeze plugin versions in the ticket.
Stratify rows into buckets; count rows per bucket in the spreadsheet tab named after the plugin slug.
Run ten assists per bucket; log tokens or character counts; discard outliers only if you can explain them (for example a truncated upload).
Compute weighted averages; add retry margin; present low-mid-high to the client; file the sheet next to the signed estimate.
WooCommerce and page builders: where averages die
Checkout strings carry compliance language. Subscription plugins reference renewal timing, proration, and dunning. Page builders embed shortcodes inside translatable attributes. Each pattern lengthens source text faster than translators notice while scrolling Loco. Your bucket model exists to catch those tails. Without tails, budgets lie.
Placeholders deserve explicit policy. Some teams require assistants to preserve %s, {name}, and HTML entities exactly. That correctness constraint lengthens instructions on every call. Price it.
Also price reviewer time. Tokens buy completions, not courtroom safety. High-risk buckets should carry higher human QA hours even when assists look cheap.
| Bucket | Typical inflation driver | Estimation posture |
|---|---|---|
| Labels | Rare; watch ampersands | Use floor token rate |
| HTML snippets | Tags and attributes | Measure, never default |
| Legal and tax | Long clauses | Separate quote line |
| Plural forms | Multiple msgids per idea | Multiply by form count |
Membership, bundles, and marketplace extensions often ship admin notices, vendor dashboards, and email templates in the same PO. Email HTML is a notorious token hog because tables and inline styles survive translation boundaries. If your sample skipped email templates because you only looked at frontend cart strings, your quote is fiction. Walk the notification list in WooCommerce and related plugins before you seal the spreadsheet.
Blocks and patterns introduced by page builders sometimes store translatable strings inside JSON-like structures. They still extract to gettext for many products, but the escaping can balloon character counts. When you encounter them, mark the bucket as “structured markup” and widen the confidence interval. Precision beats false confidence when finance reads the final column.
Google’s internationalization overview for search reminds stakeholders why localized stores need coherent URLs, hreflang discipline, and trustworthy copy. Token estimates sit upstream of that coherence: you cannot fix discovery with brilliant SEO if the checkout strings never shipped because budget ran out at seventy percent completion.
Prompt blocks and glossary injections: recurring overhead
Every repeated instruction is a tax spread across the whole locale. A two-hundred-token style guide sounds modest until you multiply by four thousand rows. Some overhead is unavoidable: brand voice rules, DO NOT TRANSLATE lists, and formatting constraints. The cost-control question is whether those tokens duplicate work humans already perform in QA. Sometimes shorter prompts plus stricter review win on total project cost.
Glossaries trade completion variance for predictable substitutions. Large glossaries appended to each call can dominate input length. Segment glossaries by domain: checkout glossary for checkout files, marketing glossary for campaign strings. Segmentation is both a linguistic and a financial tool.
WooCommerce maintains translation-oriented documentation that helps teams understand which components generate user-visible strings. Use it when scoping which plugins enter the bucket spreadsheet.
Turbo mode: throughput burns budgets when discipline slips
Higher throughput reduces wall time. It also reduces the pause between a rising error rate and a human noticing. From a cost perspective, turbo increases the speed at which you convert mistakes into sunk tokens: duplicate passes on rows that failed validation, overly creative completions that get rejected, and retries triggered by aggressive pacing. Turbo belongs in the estimate as a scenario column, not as the only column.
Pair turbo windows with caps: maximum rows per hour, mandatory checkpoints, and automatic stop thresholds when failure rates cross a line you set in daylight.
If a client insists on the fastest possible calendar finish, translate that request into tokens per hour and quote both labor and vendor usage. Calendar acceleration is rarely free.
Provider mix: price curves differ; your spreadsheet should too
Different vendors publish different unit economics. Some optimize for short chatty prompts; others penalize long system blocks. Your integration may allow multiple providers precisely so you can route buckets intelligently: cheaper paths for simple labels, premium paths for legal tails, local models for markets with data residency requirements. Cost control is partly procurement and partly routing policy.
Document the routing rule in plain language. “Checkout files use provider X unless HTTP errors exceed two percent, then fall back to Y” is a contract with your future tired self.
Revisit the mix quarterly. Vendors adjust pricing; your bucket distribution shifts when clients add plugins. Static assumptions age like unrefrigerated dairy.
Retries, duplicates, and the difference between sunk cost and strategy
A retry is sometimes necessary. It is also a second purchase of the same row if your process failed to fix the underlying instruction gap. Track retry rate per bucket. If legal strings retry three times as often as labels, your prompt or glossary failed legal, not “the API.” Fix the instruction once; stop rebuying the same lesson.
Duplicates across plugins happen when themes and extensions ship overlapping msgids. Deduplication in planning saves money; deduplication in billing saves relationships. Tell clients when two paid products repeat the same English source so you do not charge twice for identical assists without transparency.
Goodhart’s law applies to metrics: when leadership pressures “lowest tokens per string,” teams strip prompts until QA costs explode elsewhere. Balance metrics: tokens, defect rate, and reviewer hours on one dashboard.
Settings hygiene: keys, environments, and accidental double runs
Staging and production keys should never silently share the same billing profile without a label. Accidental double execution of a “full catalog” assist against both environments is an entirely preventable horror story. Name keys after environment and owner. Rotate them on offboarding the same way you rotate SSH credentials.
Also watch cron overlap: scheduled tasks that sync translations while humans run bulk assists can interleave saves and provoke retries nobody planned for. Operational calendars belong next to financial calendars.
Loco AI Auto Translator WordPress plugin settings for governed Loco gettext assist deployments should be referenced in onboarding checklists, not discovered during panic.
Client quotes: ranges, caps, and change orders in plain English
Lead with the sampling evidence. Present low-mid-high scenarios keyed to bucket counts. State assumptions explicitly: which plugins are in scope, which languages, whether HTML-heavy extensions are included, and how many reviewer rounds you priced. Invite clients to remove scope early; scope removal is cheaper than token refunds are rare.
Define a cap mechanism: hours, rows, or vendor spend triggers that pause work for written approval. Caps feel bureaucratic until they prevent a five-figure surprise. Professionals use them.
Change orders trigger when clients add plugins mid-locale, alter legal text in source English, or request additional markets. Tie each change to a revised bucket table. The token math is your objective referee.
“We measured ten rows per bucket; legal tails run ~3× label cost; here is the range.”
“Should be cheap; it is just WooCommerce.”
Attach the spreadsheet, not only the PDF proposal. Clients who see formulas ask better questions before work starts. Include a tab that translates tokens into money using the vendor rate you expect on day one and a second column with a higher rate to model renewal pricing risk. Transparency is cheaper than arbitration.
Define who pays assist overages when product owners edit English source weekly. Many teams adopt a simple rule: first N source edits per month are included; beyond that, re-run sampling and issue a change order. Write it down now so friendships survive launch month.
Finally, separate “translate for launch” from “maintain forever.” Maintenance retainers should include a token allowance sized from your historical drift. Without an allowance, every plugin update becomes a negotiation instead of a ticket.
Synthesis: commit to locales only after the meter makes sense
Full plugin locales are finance projects wearing a language hat. Tokens tie assist spend to measurable text. Buckets tie text to risk. Sampling ties quotes to evidence. Turbo, prompts, glossaries, and retries belong in the same worksheet as labor and hosting. When those pieces align, Loco AI Auto Translator as the Loco Translate assist layer with bulk scope, per-string controls, and multi-provider routing for WordPress WooCommerce gettext stops being a line item clients fear and becomes a line item they plan around.
Estimate before you commit. Cap before you sprint. Document before you argue. The PO file will still be there after the spreadsheet is done; the margin might not be if you skip the spreadsheet.
Token math came through at the last second.
Hey everyone, this guide was a total lifesaver in the middle of a project. I was ready to give a client a flat rate for localizing a WooCommerce plugin when I decided to test the sampling workflow here. boy am I glad I did those "few hundred strings" turned out to be packed with HTML heavy legal disclaimers and plural forms that made the token count skyrocket. nothing groundbreaking, but it definitely kept me from underbidding by assuming every "Shipping" label would cost the same
Picked this up hoping to get a better handle on localization costs, and the breakdown of token estimation is solid. the sampling workflow makes sense for avoiding surprises, but I was a bit let down by how much manual setup is still needed to align it with actual vendor bills. The guide's push for per string thinking over blanket quotes is smart, but it's not as turnkey as I'd hoped for someone juggling multiple plugins. If you're already deep in Loco and gettext, this will save you money
This approach makes sense, but how do you actually build that spreadsheet row for variable strings? The plural forms and embedded HTML examples hit close to home