Direct answer

A placeholder represents a piece of data or markup that software fills in or interprets later. When translating messages, preserve the placeholder identity and required structure while adapting the surrounding natural language. Compare source and target tokens and reject unexplained changes. A sentence can read beautifully while breaking the application if {name} becomes {nombre}, %s disappears or an XLIFF inline element is damaged. Use a validator aware of the actual message syntax, and test representative rendered strings, especially plural and gender variants. Never assume a basic text pattern checker understands every nested format.

Why placeholders are different from ordinary terms

A glossary term such as “workspace” may have an approved target-language equivalent, but {workspace_id} is typically a technical identifier. Renaming it during translation may prevent the runtime from supplying its value. Similarly, HTML, XML or XLIFF inline structures can carry formatting or protected content. The translator must know which pieces are translatable and which are structural.

Record the localization framework and interpolation conventions before any edit. A JavaScript template, Python printf-style message and ICU MessageFormat expression do not necessarily have the same rules.

A deliberately small source example

An invented English notification:

A Spanish target preserving tokens:

A version that changes {folder} into {carpeta} may look more Spanish, but the application may not recognize the new variable. It is safer to preserve the token and translate “folder” only where it appears as ordinary natural-language text.

This example is illustrative, not an assertion about the variable syntax of a particular live Polyglot screen.

Different formats require different parsers

Simple interpolation patterns such as {name} or ${ORG} can sometimes be checked lexically. ICU plural and select messages contain nesting and branch semantics that require a proper parser. A rule that merely counts matching braces cannot determine whether every plural option is supported or if a translated branch selects the correct message.

In XLIFF, inline tags may represent placeholders, codes or styled spans. Structural validation must preserve required relationships, attributes and tag pairing. A regex that detects familiar tags can flag some losses but is not an XML parser. Secure XML readers should restrict external entities, DTDs, document size and nesting.

Key and token checks work together

A JSON locale file might preserve {name} inside a value but accidentally remove the entire key that contains it. That is why placeholder comparison should follow key-parity and type checks. For CSV catalogs, reject duplicate identifiers and preserve the configured delimiters and quoting. For YAML, parse actual structure before claiming safety.

A useful report lists affected key, source token, target token, missing count, extra count and whether the relevant syntax is supported or needs manual review.

Original test matrix

These are test-case designs, not a claim that every row is currently supported by a public Polyglot validator.

SourceTarget changeExpected result
Hello {name}Hola {name}Tokens conserved
Hello {name}Hola {nombre}Missing/extra token warning
Total: %sTotal:Missing argument warning
ICU plural messageMissing branchRequires ICU-aware parser
XLIFF inline codeLost paired markerRequires structural review

Do not auto-rewrite warnings

A missing placeholder is sometimes a clear technical defect, but the remedy depends on context. If a sentence is intentionally redesigned, the developer may also update the application contract. A localization tool should report the mismatch and request a decision instead of silently reintroducing tokens in arbitrary positions.

For messages containing safety instructions, payment information or confidential data, a human review of the meaning remains important even when tokens match exactly.

Privacy and files

Localization catalogs can reveal unreleased product names or private workflows. Avoid uploading them to external services without authorization. Browser-local inspection can reduce transfer risks when it is actually implemented and verified, but one local component does not establish the data practices of a whole platform.

Keep test fixtures fictional or approved for public use. Enforce size and depth limits to prevent resource exhaustion when processing untrusted files.

For a public starting point, use the Polyglot tools directory and verify the exact capability shown there before treating any placeholder-specific checker as available.

Acceptance workflow

Freeze source revision; parse both locales; compare keys/types; validate placeholders with the correct syntax; render a representative set of messages with realistic values; review meaning, plural branches and typography; record exceptions and final acceptance. If the content changes after signoff, rerun the appropriate checks.

Original test corpus: a notification with several interpolation contracts

A realistic application can contain messages from different subsystems, each using its own variable convention. A UI notification may use {name}, an older email template might expect %(count)d, and a server log formatter may use positional %s. They can coexist in one product but are not interchangeable syntaxes. A validation tool must know which renderer owns each string before interpreting apparent placeholders.

Create a small synthetic test catalog with explicit expectations:

For each key, write down the expected parameter names and value types in a separate schema. If the Spanish translation changes {name} to {nombre}, flag the unexpected token. If %(count)d becomes %s, the name/type contract has changed even though both strings contain a percent sign. If two copies of {{user.email}} appear where only one was expected, report the extra occurrence.

This corpus is invented for teaching and must be tested against the appropriate message engines before being used as a product fixture. Polyglot's simple lexical module can identify some patterns, but cannot establish the behavior of arbitrary template engines.

Duplicate occurrences and ordering

A useful token comparison should count occurrences rather than only check membership. If the source contains two {count} tokens and the target contains one, the difference may matter. However, duplicating a value in the destination can sometimes be a deliberate grammatical construction; the runtime contract and meaning need review. Report counts and context instead of silently inserting or removing tokens.

The order of named variables may legitimately change during translation. A Spanish sentence might place a person's name later than an English sentence. A checker should not require every named variable to remain at the same character offset. Positional arguments are trickier: %1$s and %2$s may carry different meanings, and reordering requires syntax supported by the actual formatter. Avoid converting position-sensitive placeholders to generic %s without checking the runtime.

Complex ICU example: test branches, not just names

Consider a deliberately simplified ICU MessageFormat pattern:

The pattern combines a plural argument with a nested name argument. A translated variant can preserve count and name and still use the wrong plural branch or omit required syntax. This is why a lexical count of braces or variable names is only a preliminary signal. A correct test parses the message with the intended ICU implementation and renders representative values such as zero, one, two and a larger quantity when appropriate for the locale.

Different languages have different plural categories. The reviewer should validate target-language grammar and context, not force the English branches into every locale unchanged. Avoid using other or a visible hash marker without understanding the formatting rules.

Primary reference: Unicode ICU MessageFormat user guide. It documents the argument structure and plural/select behavior but does not establish that any particular Polyglot checker already implements full ICU parsing.

XLIFF inline structures need structural identity

When working with XLIFF, a protected marker may be represented as an inline code rather than a literal brace-delimited variable. A translation can preserve the visible text but remove or reorder a required inline element incorrectly. A safe XLIFF-aware validator must read XML structure, check code identities and relationships and reject unsafe entities.

A simple regular-expression extractor may find familiar ph or pc tags but cannot independently prove that the document is well formed or that paired codes have valid nesting. These limitations should appear in the report. In a real project, retain the source file, compare each segment's inline codes and test the target in its consuming application.

Acceptance report template

Use PASS, FAIL and NOT TESTED distinctly. A placeholder report can establish structural consistency for its supported syntax, not translation accuracy, format preservation or privacy for the full workflow.

Key/segmentRequired tokensTarget tokensFindingReviewer action
greeting{name} ×1{nombre} ×1Identity changedPreserve contract or change code
inbox%(count)d ×1%s ×1Syntax changedVerify formatter/type
organization${ORG} ×1${ORG} ×1MatchesCheck rendered result
ICU pluralValid branchingBranch unparsedNot testedUse ICU-aware parser
XLIFF inlineMatching code pairPair missingStructural riskXML/XLIFF QA

Delivery and security considerations

Protect source catalogs that contain unreleased UI text, customer data or private identifiers. Limit the file size and nesting depth an analyzer will accept; avoid unsafe XML processing, external references and dynamic code execution. Never log full sensitive messages in public CI output. If a browser tool claims local processing, test normal use and network activity before publishing that privacy statement.

A reliable release should identify the source revision, target locale, checker version, supported syntax, observed warnings, accepted exceptions and the final reviewed file checksum. If the message changes after approval, the evidence belongs to the old version and relevant checks must run again.

A deliberately small source example

Hello {name}, you have %s items in {folder}.

A deliberately small source example

Hola {name}, tienes %s elementos en {folder}.

Original test corpus: a notification with several interpolation contracts

{
  "greeting": "Welcome back, {name}",
  "inbox": "You have %(count)d messages",
  "organization": "Account: ${ORG}",
  "label": "{{user.email}}"
}

Complex ICU example: test branches, not just names

{count, plural,
  one {{name} has one document}
  other {{name} has # documents}
}