CLI referenceverbatra pseudonew

verbatra pseudo

Generate a pseudolocale from your source strings, without calling a provider or reading an API key.

Available from 0.11.0

This needs verbatra 0.11.0 or newer. Earlier releases do not have it, so check your installed version with verbatra --version and upgrade if it is older.

Run your app in a language that does not exist. pseudo builds a fake locale out of your source strings alone: every value is accented, made longer, and wrapped in visible boundary markers, so a clipped button, a sentence glued together from two fragments, and a label nobody ever extracted for translation all stand out on screen. It spends nothing: no provider is constructed, no network request is made, and no API key is read, so it works on a fresh checkout before any key exists.

Reach for it on day zero, before you have a provider account, and again whenever you change a layout. verbatra translate --dry-run tells you what a real run would translate; pseudo gives you something you can actually run the app against.

Synopsis

verbatra pseudo [flags]

Flags

FlagArgumentDefaultEffect
--cwd<path>current directoryresolve config and locale files from this directory
--config<path>search for oneload this config file instead of searching for one
--locale<code>en-XAthe pseudolocale to generate
--out<path>.verbatra-local/pseudodirectory to write the pseudolocale under, relative to the working directory and inside it
--jsonnoneoffprint one JSON envelope on stdout carrying the result under result

What the transform does

StepWhat you see
Accentevery ASCII letter becomes an accented look-alike, so Save reads Śáṽé
Expandthe value grows by about a third of its translatable length, roughly what German needs over English
Markthe value is wrapped in [ and ], so a clipped or concatenated string is obvious at a glance

Hello {{name}}, you have {{count}} unread messages comes out as [Ĥéĺĺó {{name}}, ýóú ĥáṽé {{count}} úńŕéáḋ ṁéśśáġéś······].

Nothing that is not translatable text is touched. Placeholders survive in every syntax the format adapters recognise: double-brace tokens, i18next nesting references, single-brace and ICU arguments, printf conversions and Apple plural variables, markup tags, XML entities, vue-i18n linked messages, and escape sequences. Inside an ICU message the argument names, the plural and select keywords, and every branch selector stay exactly as written, and only the text inside a branch is accented.

vue-i18n packs plural forms into a single pipe-separated value, so each form is accented, expanded and marked on its own: car | cars comes out as [ćáŕ··] | [ćáŕś··] rather than as one bracketed run, which is where plural layout is hardest to get right.

The transform is deterministic, so the same source always produces the same pseudolocale and the file diffs cleanly.

Nothing broken ever reaches the file

Every generated value is held to the same integrity gate a provider's translation must pass: the same placeholders as the source, valid under the format's message syntax, not degenerate, and not blank. A value that would not pass it is copied from the source verbatim and named under copied verbatim in the output, so the entry is still present and still renders. It is a report, not a failure, and the command still exits 0.

Where the output goes

The pseudolocale is written outside your real locale files, under .verbatra-local/pseudo by default. verbatra init already adds .verbatra-local/ to .gitignore, so the generated file is not committed by accident, and pseudo tops up an existing .gitignore with that entry if it is missing.

Your configured files.pattern is expanded inside that directory, so the file keeps the layout your app expects: with locales/{locale}.json, the default run writes .verbatra-local/pseudo/locales/en-XA.json. Point your dev server or your i18n library at that directory to load it. Pass --out to write it somewhere your build already serves.

Two rules keep it from ever standing in for a real translation:

  • A pseudolocale that names your source locale or one of your target locales is refused with PSEUDO_OUTPUT_CONFLICT, before anything is read or written.
  • An --out that would place the file on top of a configured locale file is refused the same way.
  • An --out that is absolute, or that climbs out of the working directory with .., is refused as well, so a generated pseudolocale never lands outside the project it came from.

Because the file lives outside files.pattern, verbatra translate never sees it and never spends on it, and verbatra check and verbatra diff never report it as missing or stale. There is nothing to add to targetLocales and nothing to exclude from CI.

Formats written by patching an existing file

xliff and apple-xcstrings are not rewritten from scratch: their writers patch units that are already in the destination document. The pseudolocale file is therefore re-copied from your source file on every write, so a key you add to the source after the first run still reaches the pseudolocale instead of going silently missing. A copied XLIFF also has its target-language attribute rewritten to the pseudolocale, so the file never claims to hold a language it does not.

Examples

# generate en-XA under .verbatra-local/pseudo
verbatra pseudo

# generate a second pseudolocale alongside it
verbatra pseudo --locale en-XB

# write it where the dev server already serves static files
verbatra pseudo --out public/locales-pseudo

# machine-readable result for a script
verbatra pseudo --json

A run looks like this:

verbatra pseudo
  en-XA: 118 of 120 entries pseudolocalized
    copied verbatim: legal.disclaimer, brand.name
  wrote /app/.verbatra-local/pseudo/locales/en-XA.json

Run it again without changing the source and it rewrites nothing:

verbatra pseudo
  en-XA: 120 of 120 entries pseudolocalized
  unchanged /app/.verbatra-local/pseudo/locales/en-XA.json

Exit codes

CodeMeaning
0the pseudolocale was generated, whether or not the file changed
2could not run: a usage error, a config or source problem, or a refused pseudolocale or output path

There is no exit 1: a value copied verbatim is reported, not treated as a failure.

  • verbatra translate does the real thing, once you have a key.
  • verbatra doctor is the other command that validates a project without spending anything.
  • Formats lists the placeholder syntax each format uses.
  • The config file documents files.pattern, which decides the generated file's layout.
Edit on GitHub