Skip to main content
T3 fan-out · product / content / i18n: three chained fan-outs (read-all → translate-all → write-all) with jq transpose zipping paths back to texts between stages. The masterclass file for collections.

The job

« Can we have the docs in French? » is weeks of copy-paste, or it’s this file: glob finds every markdown file, the texts are read and translated in parallel (rate-limited so the provider doesn’t choke), and the mirror tree appears under i18n/fr/ with the original paths preserved.

The shape

The file

localization-factory.nika

How it works

1

The filesystem is the collection

nika:glob returns the file list at runtime: add a doc tomorrow, it’s in the next run. exclude: keeps node_modules out.
2

transpose zips parallel arrays

Two fan-outs produce two aligned arrays (paths, texts). The jq transpose | map({path: .[0], text: .[1]}) zip turns them into [{path, text}], and ${{ item.path }} works, because loop-locals are full objects.
3

The mirror tree comes out the other end

The final fan-out writes ./i18n/fr/<original path> with create_dirs: true. Path templating is plain ${{ }} interpolation inside a string.

Constructs you just used

Run it

What it needs: A local model (Ollama serving qwen3.5:4b) and the two sample documents.
1

Rehearse it

A mock model answers, the sample files come with it, and nothing is written in your folder.
2

Get your own copy

Save the file above as localization-factory.nika in a new folder, then download the samples it reads:
3

Check it, then run it

The run writes the French mirror under i18n/fr/.Any other model works: pass --model <provider>/<name> with its key, and cap a cloud model with --max-cost-usd.To translate your own docs, change const.source_root and the matching permits.fs.read entry together (NIKA-AUTH-007).

Make it yours

  • All your locales: wrap the lang in a list and run per locale, or lift const.lang to a typed required input and call the workflow per language.
  • Glossary discipline: interpolate your terminology table into the translate prompt so product names never drift.
  • Only what changed: replace glob with exec: { command: [git, diff, --name-only] } (argv form, with exec: ["git"] in permits) and translate the delta, as PR review fan-out does. On macOS in 0.124.3 the sandbox refuses that Git read (Known limits).

Next · Config drift sentinel

RFC 7396 merge-patch + RFC 6902 diff: jq decides, the model only explains.