$ show opral/inlang
Inlang is a localization platform that treats translation as code, storing messages in a versioned Lix database managed through Git. The monorepo includes a TypeScript SDK for loading, querying, and exporting translation projects; a CLI for running checks and machine translation; a plugin system for integrating with multiple message formats (JSON, ICU, i18next, Android XML, Apple xcstrings, and more); and Lit-based web components for editing translations in-browser. The SDK provides a rich data model (bundles, messages, variants with selectors) and a checks engine for detecting missing translations, unused messages, and plural errors. Architecturally, the repo is organized as a pnpm/Nx monorepo. The core `@inlang/sdk` package manages project lifecycle and database operations via Kysely. Plugins conform to a uniform `importFiles/exportFiles` interface and are loaded dynamically. The CLI uses Commander and Consola, while the UI components use Lit with Shoelace design tokens. The companion website (TanStack Start) serves documentation, a marketplace registry, and SEO-optimized pages. The system is designed to run in Node.js (CLI) and browsers (editor), with a focus on preserving file formatting through careful diffing and merging during export. Notable craftsmanship includes the `keepUnchangedJsonEntries` utility for byte-identical file preservation, the `EchoTracker` for optimistic UI state, the `pluralExamples` helper for locale-aware examples, and the `human-id` word lists for generating readable identifiers. These components are self-contained, well-tested, and reusable outside the localization domain. The codebase demonstrates strong engineering practices with extensive test coverage (vitest, Storybook, fuzzing) and compatibility tests ensuring backward compatibility across SDK versions.
The LLM identified 4 files worth highlighting for reuse:
Safely preserves JSON formatting (indentation, whitespace, key order, encoding) by diffing exported content with existing file and rewriting only changed entries. Reusable across any JSON-based localization plugin.
Tracks optimistic pattern edits with an echo queue to prevent overwriting user changes from slow async saves. Demonstrates advanced async state management in web components.
Generates locale-specific plural example strings (e.g., '0 dogs', '1 dog', '2 dogs', '5 dogs') using Intl.PluralRules. Simple, stateless, and immediately reusable for any plural-form editor UI.
Provides word lists (animals, adjectives, adverbs, verbs) to generate readable, random identifiers for translation bundles. Self-contained constant arrays with no dependencies, usable in any project needing human-friendly IDs.