i18n String Extractor
Bootstrap a locale catalog from t(), $t() and gettext() call sites — with locations.
Source files
0 file(s) · 0 key(s)empty · static scan only; no code is executed.
Extraction
0 keys · 0 duplicates · 0 dynamicNo source yet
Paste code, add files or load the sample project to build a locale skeleton.
Details
Paste source files and get a flat or dotted-nested catalog with TODO values, source locations, duplicate counts, dynamic-key exclusions, nested-clash diagnostics and a CSV handoff. The scanner walks call parentheses with a string/comment guard, uses gettext-specific argument positions and correctly handles Vue templates (including attribute calls) and Python message ids. Everything runs in the browser tab; source is never executed or uploaded.
More examples
React/TypeScript
return <button>{t("common.save", { count: 2 })}</button>;The first argument becomes the key common.save; extra arguments are ignored and the location is recorded.
Vue SFC
<button :label="$t('common.save')">{{ $t('form.title') }}</button>Template calls in attributes and interpolations are found; HTML comments and <style> blocks are ignored.
Python gettext
pgettext("menu", "Save changes")gettext-family argument semantics are respected: the context string is not mistaken for the message id.
Examples
Multi-line call
t(
"form.title",
{ count: 2 },
){"form.title": "TODO"}The parenthesis walk crosses newlines and ignores extra arguments.
Vue template attribute
<button :label="$t('common.save')">{{ $t('form.title') }}</button>{"common.save": "TODO", "form.title": "TODO"}HTML attribute quoting does not hide template call sites.
Duplicate across files
a.ts: t("dup");
b.ts: t("dup");dup × 2 — a.ts:1:1, b.ts:1:1Every location is listed, and the CSV gets one row with a count.
About this tool
i18n String Extractor inventories translation call sites in pasted source and emits a locale JSON skeleton you can hand to translators. It recognises t(), $t(), i18n.t(), tc(), translate() and the gettext family in JavaScript, TypeScript, Vue SFCs and Python, recording file, line and column for every hit.
Static keys become catalog entries with TODO values (or a copy of the key), either flat or nested by dots. Dynamic calls such as t(`btn.${action}`) are excluded and listed for manual mapping, duplicates are counted with all their locations, and nested-mode leaf/path collisions are reported instead of silently overwriting data.
The scanner is a zero-dependency parenthesis walk with string and comment guards — no AST parser is bundled and no source is executed or uploaded. A UTF-8 BOM-prefixed CSV with quoting and formula-injection guards is available for translation vendors, and an optional existing catalog reveals added and unused keys.
What this tool does not do
- No JavaScript/TypeScript AST parser is bundled; exotic macro syntax and tagged templates are not extracted.
- Dynamic keys, computed keys and non-literal first arguments are listed but never guessed.
- The 5 MB paste cap rejects larger sources with an explicit error instead of freezing the tab.
- Nested-mode leaf/path collisions are reported; the later key is omitted from the nested catalog only.
- Hardcoded string heuristics, ICU plural extraction and POT/PO export are out of scope.
How to use this tool
Add source files
Paste code into the source editor, change the filename to set the language, and use Add file for more than one file. The sample project loads React, Vue and Python files at once.
Tune the call table
Leave Call names blank for the built-in JS/Python tables or enter a comma-separated override such as t, $t, tr.
Pick an output shape
Choose flat keys or nested-by-dots, TODO or copy-of-key values, gettext message-id mode and optional sorting.
Read the diagnostics
The Diagnostics tab lists duplicate keys with every location and nested clashes. The Dynamic tab lists calls the scanner could not turn into a literal key.
Hand off the catalog
Copy the JSON, download en.json, or download the CSV for translators. Paste an existing catalog to see added and unused keys.
Use cases
Internationalising a legacy app
Bootstrap en.json from years of accumulated t() calls before translation work begins.
Translator handoff
Export a quoted CSV of keys, placeholders, files and counts for a translation vendor.
Vue audit
Collect $t() keys from templates and scripts while ignoring HTML comments and style blocks.
Catalog hygiene
Merge an existing catalog to find new keys and stale entries that no source file references.
Call patterns and output modes
| Input pattern | Result |
|---|---|
| t("common.save") / $t('save') | Static key with source location |
| i18n.t(...) / this.$t(...) | Recognised call (dotted and Vue instance forms) |
| t(`btn.${action}`) / _(f"Hi {name}") | Dynamic exclusion with the call snippet |
| gettext("msg") / pgettext("ctx", "msg") | Literal message id using the correct argument position |
| // t("x") / <!-- $t('x') --> | Ignored comment or HTML comment |
| Flat mode / Nested mode | {"a.b": "TODO"} / {"a": {"b": "TODO"}} |
Source is capped at 5 MB per run; backticks with interpolation and f-strings are always dynamic.
Common mistakes
Mistake:Expecting an AST-perfect extraction.
Fix:This is a parenthesis walk with literal guards. Review dynamic exclusions and unusual syntax manually.
Mistake:Treating every dotted identifier as a translation call.
Fix:Plain member calls such as obj.t('x') are excluded; explicit table entries like i18n.t and Vue's $t are kept.
Mistake:Using pgettext's context string as the key.
Fix:Gettext-family calls use the documented message-id argument position; the context and domain are skipped.
Mistake:Assuming nested mode can represent a leaf and a path with the same name.
Fix:Clashes are reported and the later key is excluded from the nested catalog; use flat mode if you need both.
Mistake:Pasting a formula-looking key into a spreadsheet unchanged.
Fix:The CSV prefixes =, +, - and @ with an apostrophe and doubles embedded quotes.
Frequently asked questions
Which call patterns does it detect?
By default: t, $t, i18n.t, tc and translate in JavaScript, TypeScript and Vue, plus gettext, _, trans, pgettext, dgettext and ngettext in Python. You can replace the table with a comma-separated list of your own call names. Plain member calls such as obj.t('x') are excluded, while explicit entries such as i18n.t and Vue's this.$t are detected.
What happens to dynamic keys?
Calls whose first argument is not a single static literal — template interpolation, f-strings, concatenations or identifiers — are excluded from the catalog and shown in the Dynamic tab with the call snippet and location. That keeps the generated JSON valid while making the manual mapping work explicit.
Can it output gettext-style text keys?
Yes. Gettext mode keeps message text verbatim, so dots in a sentence remain part of the key instead of creating nested objects. Gettext-family calls also use their real message-id argument positions: pgettext and dgettext skip context or domain before the message.
Does it handle Vue SFC templates?
Yes. Calls in template interpolations and attributes such as :label="$t('save')" are found, script blocks use the normal JavaScript rules, and HTML comments plus <style> blocks are ignored. Attribute forms that store a key directly (for example i18n-key="save") are out of scope.
How do duplicates and nested clashes work?
A key seen more than once appears in Diagnostics with every file, line and column, while the catalog holds it once. In nested mode, a key that is both a leaf and a path (a.b together with a.b.c) produces a clash: the later key is excluded from the nested catalog and listed as a warning. Flat mode keeps both keys.
Is my source uploaded or saved anywhere?
No. Scanning happens in your browser tab with zero dependencies and no network requests. Source text is not persisted; only the small output files are created when you explicitly download them.
References & standards
Related tools
.env Secret Safety Linter
Validate .env syntax and spot likely leaked credentials or placeholder secrets.
.gitattributes Generator
Build .gitattributes rules for line endings, Git LFS, GitHub linguist marks and merge drivers — with a one-line explanation for every rule.
.htaccess Generator
Build an Apache .htaccess — HTTPS redirects, rewrites, error pages, security headers, and basic auth
2D Fluid Dynamics & Particle Physics Sandbox
A physics playground with two engines sharing one canvas. The fluid mode runs a real Eulerian Navier-Stokes solver — semi-Lagrangian advection, explicit diffusion, Jacobi pressure projection and vorticity confinement — that you paint with dye and velocity using mouse or touch. The particle mode is a damped Verlet N-body engine with gravity wells, Coulomb attractors and repulsors, spring links, wall restitution and elastic circle collisions. Particle counts adapt to the device (100k target on WebGL2 desktop, 2k-5k on CPU fallback), and every configuration exports as runnable code: a Matter.js world, a PixiJS ticker setup, or a standalone vanilla Canvas engine.
A/B Test Sample Size Calculator
Compute required sample size per variant and test duration from baseline conversion rate, minimum detectable effect, alpha and power.
ABA Routing Number Validator
Validate 9-digit US ABA routing numbers with 3-7-1 Mod-10 breakdown.