Skip to content

Latest commit

 

History

102 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Messagevisor

Git-native i18n and l10n management solution

Manage your application copy, translations, and formatting declaratively from the comfort of your Git workflow.
Built by @fahad19

How does it work?

Messagevisor lets teams manage application copy, translations, and locale behavior as source code:

  1. Manage a Messagevisor project in Git.
  2. Author messages, locales, targets, overrides, segments, tests, and examples as YAML or JSON.
  3. Validate everything with the CLI.
  4. Build compact target and locale-specific datafiles.
  5. Serve those JSON datafiles from a CDN or application server.
  6. Evaluate translations, formatting, and conditional copy with the SDK.

Messagevisor

Why Messagevisor?

  • Translations as code: review copy changes in pull requests with the same workflow as application code.
  • Targeted datafiles: ship only the messages, locales, formats, metadata, and override logic each app needs.
  • Runtime conditions: define attributes, segments, and ordered overrides for plan, platform, country, feature flag, experiment, and audience-specific copy.
  • Locale inheritance: share translations and format presets across language and regional variants.
  • Portable formatting: define named number, date, time, relative, and range presets that SDKs can consume consistently.
  • Review UI: generate the Catalog to inspect messages, locales, targets, examples, relationships, Git history, and optional reports.
  • Release lanes: use sets and promotion flows for dev, staging, production, or parallel localization streams.

Quick start

npx messagevisor init
npm install

npx messagevisor lint
npx messagevisor build
npx messagevisor catalog

Read the full Quick start when you are ready to wire a generated datafile into an application.

Core concepts

Concept Purpose
Messages Translation keys, base translations, overrides, examples, metadata, deprecation, and archival
Locales Language and regional variants, direction, inheritance, formats, and locale examples
Targets Per-application datafile definitions with message inclusion, locales, context, output options, and format overlays
Attributes Runtime context fields used by conditions
Segments Reusable condition trees for audiences
Overrides Ordered conditional translation branches, first match wins
Tests Assertions for messages, locales, segments, and targets
Sets Independent project trees for environments, release lanes, and promotions
Catalog Static review UI generated from a Messagevisor project

CLI overview

Run commands inside a Messagevisor project:

npx messagevisor <command> [options]
Command Use
init Create a starter project
config Print resolved project configuration
info Show entity counts
lint Validate project definitions
list Query messages, locales, targets, attributes, segments, and tests
diff Review authored copy changes between Git states
evaluate Debug one message, raw ICU string, or segment quickly
examples Resolve authored message and locale examples
test Run Messagevisor test specs
build Generate datafiles
catalog Build, serve, and watch the Catalog in dev mode
export / import Exchange translations through CSV or JSON
find-duplicates Find duplicate resolved translation values
find-usage Find authored entity and format references
prune Remove redundant inherited translations or formats
promote Move changes between sets
generate-code Generate typed TypeScript helpers from message keys

See the CLI docs for all options. The fastest correctness loop while authoring is usually:

npx messagevisor lint
npx messagevisor evaluate --message=<key> --locale=<locale> --target=<target>
npx messagevisor test --keyPattern=<key>
npx messagevisor diff
npx messagevisor diff --resolved

diff compares HEAD with a dirty working tree, or main/master with the current branch when clean. Use --from and --to for explicit refs and --format=markdown for a PR-friendly report. It reports authored copy, workflow, and override routing changes; add --resolved to include downstream locale-inheritance impact.

Catalog

Catalog is a generated, read-only website for reviewing a Messagevisor project:

npx messagevisor catalog
npx messagevisor catalog export
npx messagevisor catalog serve
npx messagevisor catalog --set=staging --set=production

Translation-value search and duplicate reports are opt-in because they can be expensive in large projects:

npx messagevisor catalog --with-translation-search
npx messagevisor catalog --with-duplicates
npx messagevisor catalog export --with-translation-search --with-duplicates

catalog serve requires and serves already generated output. Run catalog export first. It does not build optional search or duplicate indexes.

For sets-based projects, catalog generation includes all sets by default. Pass --set=<name> one or more times to generate only selected sets.

Example projects

This monorepo includes focused projects under projects/:

Project Focus
project-1 Broad YAML example with ICU, overrides, targets, tests, examples, and format presets
project-demo Sets-based ecommerce demo
project-sets Minimal sets workflow
project-environments Environment-style sets starter
project-test-envs Test environments as sets
project-json JSON authoring
project-yml Minimal YAML authoring
project-rtl RTL locale review and rendering
project-raw Runtime without the ICU module

Try one:

npx @messagevisor/cli init --project=environments
npm install

npx messagevisor info
npx messagevisor test
npx messagevisor catalog

Packages

Package Purpose
@messagevisor/cli CLI entrypoint
@messagevisor/core Core project loading, linting, building, testing, import/export, promotion, and CLI plugins
@messagevisor/sdk JavaScript runtime SDK for Node.js and browsers
@messagevisor/react React bindings
@messagevisor/vue Vue bindings
@messagevisor/react-intl-compat Compatibility layer for react-intl style APIs
@messagevisor/catalog Static Catalog generator and UI
@messagevisor/parsers YAML and JSON authoring parsers
@messagevisor/module-icu ICU message formatting module
@messagevisor/module-interpolation Lightweight string interpolation module
@messagevisor/module-featurevisor Featurevisor feature and experiment condition integration
@messagevisor/module-missing-translations Missing translation reporting module
@messagevisor/types Shared TypeScript declarations

SDK usage

Applications consume built datafiles, not source YAML or JSON files:

import { createMessagevisor } from "@messagevisor/sdk";
import { createIcuModule } from "@messagevisor/module-icu";
import datafile from "./datafiles/messagevisor-web-en-US.json";

const m = createMessagevisor({
  datafile,
  modules: [createIcuModule()],
});

m.translate("auth.signin");
m.translate("dashboard.welcome", { name: "Ada" });

See the SDK docs for JavaScript, React, Vue, browser, Node.js, React Native, and react-intl compatibility usage.

Agent skills

Messagevisor ships an agent skill in skills/messagevisor. It helps AI coding agents understand the project model, choose safe commands, author translations, run evaluate, write tests, use Catalog, and avoid editing generated output as source.

Install it with:

npx skills add messagevisor/messagevisor

See skills/README.md for details.

Contributing

Install dependencies at the monorepo root:

npm install

Useful checks:

npm run typecheck
npm run test
npm run build

Targeted package checks:

npm run test --workspace @messagevisor/core
npm run test --workspace @messagevisor/catalog
npm run build --workspace @messagevisor/catalog

Read the Contributing docs for project conventions and release workflow.

License

MIT © Fahad Heylaal

About

Git-native i18n and l10n management solution

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

13 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages