Skip to content

better-i18n/oss

Repository files navigation

Better i18n

TypeScript SDKs for the Better i18n localization platform

Manage translations with CDN delivery, GitHub sync, and AI-powered workflows.
Documentation · Website · Blog

CLI version Next.js SDK version Expo SDK version MCP version MIT License


Why Better i18n?

Most localization tools weren't built for modern developer workflows. Better i18n is different:

  • GitHub-native — translations sync as PRs, reviews happen in your existing workflow
  • CDN-delivered — translations served from Cloudflare's edge network, updated without redeployment
  • AI-powered — context-aware translation with Google Gemini, not word-by-word machine output
  • TypeScript-first — full type safety across Next.js, React, Expo, and React Native
  • MCP-ready — AI agents can manage translations through the Model Context Protocol

How it compares

Feature Better i18n Crowdin Lokalise Phrase
GitHub-first workflow Partial Partial
AI translation with context
CDN delivery (no redeploy)
TypeScript SDKs
MCP server for AI agents
CLI scanner (unused key detection)
ICU MessageFormat support
Open-source SDKs Partial
Free tier

Packages

Package Description Version
@better-i18n/cli CLI for scanning, syncing, and managing translations npm
@better-i18n/next Next.js SDK with middleware and hooks npm
@better-i18n/use-intl React hooks for use-intl integration npm
@better-i18n/expo Expo / React Native integration with offline caching npm
@better-i18n/core Core utilities for locale handling and formatting npm
@better-i18n/mcp MCP server for AI agent integration npm
@better-i18n/schemas Shared Zod validation schemas npm

Quick Start

# Install the CLI
npm install -g @better-i18n/cli

# Initialize in your project
npx @better-i18n/cli init

# Scan your codebase for translation keys
npx @better-i18n/cli scan

# Sync translations with the Better i18n platform
npx @better-i18n/cli sync

Framework Integration

Next.js

npm install @better-i18n/next
// middleware.ts
import { createI18nMiddleware } from '@better-i18n/next';

export default createI18nMiddleware({
  locales: ['en', 'tr', 'de'],
  defaultLocale: 'en',
});

See the Next.js integration guide for routing, server components, and metadata setup.

React with use-intl

npm install @better-i18n/use-intl
import { BetterI18nProvider, useTranslations } from '@better-i18n/use-intl';

function App() {
  return (
    <BetterI18nProvider locale="en" messages={messages}>
      <MyComponent />
    </BetterI18nProvider>
  );
}

function MyComponent() {
  const t = useTranslations('common');
  return <h1>{t('welcome')}</h1>;
}

Expo / React Native

npm install @better-i18n/expo
import { BetterI18nExpoProvider, useTranslations } from '@better-i18n/expo';

export default function App() {
  return (
    <BetterI18nExpoProvider
      projectId="your-project-id"
      defaultLocale="en"
      fallbackMessages={fallback}
    >
      <HomeScreen />
    </BetterI18nExpoProvider>
  );
}

Supports offline caching, OTA translation updates, and automatic locale detection. See the Expo guide.

MCP Server (AI Agents)

npm install @better-i18n/mcp

Connect AI assistants like Claude, Cursor, or Windsurf to your translation workflow through the Model Context Protocol.

Documentation

Visit docs.better-i18n.com for full documentation:

Related

Contributing

Contributions are welcome! Please read our contributing guidelines before submitting PRs.

License

MIT — Better i18n