Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
@carbon/locale
Lingui runtime, locale selection, and per-render catalog activation for ERP and MES.
Always
- MUST translate component strings with
useLingui()or<Trans>from@lingui/react/macro. - MUST use
msgfrom@lingui/core/macroonly to createMessageDescriptorvalues such as breadcrumbs. - MUST update
lingui.config.js,supportedLanguages, andlanguageNativeLabelstogether when adding a locale. - MUST run extraction and translation after adding user-facing strings; commit
.pocatalogs, not compiled output. - MUST keep
LocaleProvideras the active Lingui runtime. It creates and activates a per-rendersetupI18n()instance.
Ask First
- Adding/removing a supported language or changing
defaultLanguage/resolveLanguage()fallback behavior. - Changing
LocaleProvider; every app mounts it fromroot.tsx. - Changing catalog source globs because ERP and MES share React/form/printing messages.
Never
- Never call
timported from@lingui/core/macro; it targets the unactivated global singleton and can crash SSR. - Never hardcode translatable UI copy outside
msg,useLingui().t, or<Trans>. - Never commit
packages/locale/locales/**/*.mjs; builds regenerate them. - Never treat
locales/nl/as supported. Dutch catalogs are orphaned untilnlis added to both runtime and Lingui config.
Validation Commands
pnpm --filter @carbon/locale test
pnpm --filter @carbon/locale typecheck
pnpm lingui:check
Key Exports
| Subpath | Provides |
|---|---|
. |
LocaleProvider, SupportedLanguage, supportedLanguages, languageNativeLabels, defaultLanguage, localeCookieName, resolveLanguage, getSortedLanguageSelectOptions |
Supported runtime locales are en, fr, de, es, it, ja, pl, pt, ru, zh, hi, tr, and ko. Catalogs live at packages/locale/locales/{locale}/{erp,mes}.po.
Catalog Workflow
- Mark with
useLingui().t,<Trans>, ormsg. - Run
pnpm lingui:extract. - Run
pnpm translateto fill non-English catalogs using the approved glossary. - Run
pnpm lingui:cleanto remove diff-noisy headers/origin references. - Run
pnpm lingui:compileorpnpm lingui:check; generated.mjsremains untracked.
Cross-References
.claude/rules/i18n-lingui-system.md— full i18n system docs, marking patterns, gotchaslingui.config.js(root) — catalog config, source paths, locale listpackages/locale/locales/glossary.jsonand@carbon/content/glossary— approved manufacturing terminology (terms usemsgdescriptors for i18n)apps/{erp,mes}/app/services/lingui.ts— isomorphic catalog loading (preloadCatalog/getCatalog/useCatalog)