Workflows
Review translations locally and integrate the CLI into scripts and CI.
Run langnostic translate as an explicit step before building or deploying your
application. You can invoke it locally, in a pre-commit hook, after a pull request
or merge, on a schedule, or before a release.
Choose a workflow that leaves time to review generated text and validate your localization files. AI usage can incur provider charges.
Manual workflow
- Update your source catalogs or documents.
- For changed FormatJS messages under existing IDs, update target translations manually or remove affected target IDs to request replacements.
- Run
langnostic translate --dry-runto inspect pending files and counts. - Run
langnostic translate. - Review the diff and validate ICU messages, placeholders, Markdown, JSX, and code examples with your application’s tooling.
- Commit the source files, translated files, and MDX registries together.
Keep .langnostic/ debug output out of version control. Preserve the
*.langnostic.json files beside source documents; removing them can trigger
MDX retranslation. See MDX tracking behavior.
CI/CD workflow
A project-owned CI workflow can:
- Check out the source change and install the configured dependencies.
- Make the AI provider credentials available through the CI secret store.
- Run
langnostic translateand check its exit status. - Validate the generated files and collect the resulting diff.
- Commit changes to a translation branch or open a pull request for review.
The CLI performs translation and file updates; it does not create commits, branches, or pull requests. Configure those operations and their permissions in your CI workflow. Avoid sending credentials to untrusted pull-request jobs.
An exit status of 1 reports a failure, but completed batches or maintenance
may already have changed files. Do not publish a partial result solely because
some files were generated. A successful exit can also mean no source files
matched; inspect warnings if output is unexpectedly empty.
External file watching
Langnostic has no built-in watch mode. If you need translation during development, configure an external watcher to run the translation command when source files change.
Watch source files rather than generated target files or registries, and serialize runs so multiple processes do not write the same targets at once. Consider API usage and reviewability before translating after every save.
Review and retries
Unchanged runs normally avoid AI work according to the plugin’s tracking rules. FormatJS does not detect source-value edits under existing IDs. MDX can queue all blocks when a registry is missing or the target block count changes.
Before retrying, inspect changed files and preserve manual edits. Restore matching source, target, and registry state together when recovering an MDX document. See CLI for debug logs and Architecture for batch completion and write behavior.