Fanee is a modular internationalization (i18n) ecosystem built on the Open Translation Bundle (OTB) specification. It provides a standardized directory structure for hierarchical translation resources alongside a high-performance runtime, build plugins, framework bindings, and AST-powered verification tooling.
fanee/
├── packages/
│ ├── core/ # Core runtime, state management, and MF2 message formatting
│ ├── fs-scanner/ # OTB filesystem and zip archive bundle scanner
│ ├── node/ # Node.js filesystem provider plugin for @fanee/core
│ ├── vite/ # Vite plugin for virtual module resolution and HMR
│ ├── react/ # React context provider and hooks (useT, useLocale)
│ ├── solid/ # SolidJS context provider and reactive accessors
│ └── tools/ # CLI toolchain, AST scanner, unused key detector, typegen
├── apps/
│ ├── example-react/# Vite + React demo application
│ └── example-solid/# Vite + SolidJS demo application
└── spec/ # Open Translation Bundle (OTB) specification
| Package | Description | Version |
|---|---|---|
@fanee/core |
Core runtime, translation resolution, and MF2 formatting engine | 0.9.0 |
@fanee/tools |
AST code scanner, resource validation CLI, and TypeScript generator | 0.9.0 |
@fanee/vite |
Vite plugin providing virtual:fanee imports with CSR & SSR HMR |
0.9.0 |
@fanee/solid |
SolidJS bindings with fine-grained reactivity | 0.9.0 |
@fanee/react |
React bindings with concurrent mode and external store support | 0.9.0 |
@fanee/node |
Node.js provider for loading OTB bundles from disk into the runtime | 0.9.0 |
@fanee/fs-scanner |
Bundle directory traversal, module inheritance, and zip extractor | 0.9.0 |
The OTB Specification defines a directory structure and metadata standard for modular translations:
- Root
manifest.jsondefines the bundle format, target locales, and default formatting mode. - Namespaces are mapped from filesystem directory hierarchies under
modules/. - Descendant modules inherit and override messages from parent modules, with support for
"standalone": trueisolation.
bun add @fanee/core @fanee/solid # or @fanee/react
bun add -D @fanee/vite @fanee/tools// vite.config.ts
import { defineConfig } from "vite";
import { fanee } from "@fanee/vite";
export default defineConfig({
plugins: [
fanee({ bundlePath: "./locale" }),
],
});// fanee.config.ts
import { defineConfig } from "@fanee/tools";
export default defineConfig({
bundlePath: "locale",
sourceLocale: "en",
sources: [
{ include: ["src/**/*.{ts,tsx}"] },
],
});# Validate translation keys and message variables
bun run --bun fanee check
# Report translations defined in resources but unreferenced in code
bun run --bun fanee unused| Command | Description |
|---|---|
bun run build |
Build all workspace packages and demo applications |
bun run test |
Run unit and integration tests across all packages |
bun run typecheck |
Run TypeScript type checks across all packages (tsgo) |
bun run ci |
Run complete CI verification (Biome format & lint + package CI) |
bun run format |
Auto-format all code files across the repository |
bun run lint |
Lint all workspace packages |
MIT
