Skip to content
React SDK

React i18n Made Simple

Type-safe internationalization for React applications with hooks, context, and seamless CDN delivery.

Package
lefine
Entry
lefine/react
lefine
01Terminal
npm install lefine
02App.tsx
// strings.ts (server)import { createStrings } from 'lefine/server';export const strings = createStrings({ project: 'app_3f9c0e4b2a7d4e1f9b6c5a8d7e2f1a0b' });// in your route loader or server function://   const props = await strings.load(locale, ['common']);// App.tsximport { StringsProvider } from 'lefine/react';function App({ props }) {  return (    <StringsProvider {...props}>      <YourApp />    </StringsProvider>  );}
03MyComponent.tsx
import { useStrings } from 'lefine/react';function MyComponent() {  const t = useStrings('common');  return (    <div>      <h1>{t('welcome')}</h1>      <p>{t('greeting', { name: 'World' })}</p>    </div>  );}
t('welcome')
Welcome

Quick Start

Get started with Lefine in your React app in minutes.

01/Setup

Installation & Setup

Get started with @better-i18n/use-intl in three steps — install, wrap your app with the provider, and start translating.

  1. 01

    Install

    Add @better-i18n/use-intl and use-intl to your project.

    terminalbash
    npm install lefine
  2. 02

    Wrap your app with BetterI18nProvider

    Place the provider at the root of your component tree. It fetches messages from the CDN and makes them available via hooks.

    App.tsx
    // strings.ts (server)import { createStrings } from 'lefine/server';export const strings = createStrings({ project: 'app_3f9c0e4b2a7d4e1f9b6c5a8d7e2f1a0b' });// in your route loader or server function://   const props = await strings.load(locale, ['common']);// App.tsximport { StringsProvider } from 'lefine/react';function App({ props }) {  return (    <StringsProvider {...props}>      <YourApp />    </StringsProvider>  );}
  3. 03

    Use translations

    Call useTranslations() in any component to access your translation keys with full TypeScript support.

    MyComponent.tsx
    import { useStrings } from 'lefine/react';function MyComponent() {  const t = useStrings('common');  return <h1>{t('welcome')}</h1>;}
02/Runtime

How the React adapter behaves at runtime

The provider fetches your messages once, every hook reads them from context, and the core keeps them in an in-memory cache (5 minutes by default in production).

  • <StringsProvider>Provider fetches from the CDN once
  • useStrings('common')Every component reads from context
  • manifest · 60 sIn-memory cache (5 minutes by default in production), offline fallback
  • t('welcome')Keys resolved from the namespace you pass to useTranslations()
03/Capabilities

Features

  • React Hooks API (useTranslations)
  • Written in TypeScript, with typed hooks and provider props
  • Lazy loading for optimal bundle size
  • ICU message format with pluralization
  • Variable interpolation and formatting
  • React Context for locale management
  • SSR and SSG support
  • No caching in development, so edits show up on the next load
  • Works with the use-intl hooks you already know (useFormatter, useLocale, useNow)
04/Ecosystem

Works with Popular React i18n Libraries

Lefine isn't a replacement for your favorite i18n library - it's the translation management layer that makes them even more powerful.

  • react-intl

    The most popular React i18n library with ICU message format support. Used by thousands of production apps.

    Lefine delivers your translations as JSON that react-intl can load. Edit in our dashboard and publish — no redeploy needed.

  • react-i18next

    Powerful i18n framework for React based on i18next. Features like namespaces, interpolation, and plurals built-in.

    Export to i18next-compatible JSON with namespaces. Lefine handles the translation workflow, i18next handles the runtime.

  • FormatJS

    A set of libraries for internationalization that includes react-intl. Supports ICU Message syntax and CLDR data.

    Lefine keeps ICU messages intact: AI translation checks that plural and select branches and placeholders survive, and the CDN delivers JSON that FormatJS can load.

  • Lingui

    A readable, automated, and optimized i18n library. Great DX with macro-based message extraction.

    Extract messages with the Lingui CLI into JSON catalogs, manage translations in Lefine, and sync them back through the GitHub integration (beta).

How it works

Source strings flow into Lefine and back out to every locale

en
Source string

useStrings('common')

Edited in code, picked up on the next scan

Glossary

Brand terms stay untranslated

AI translation

Written from your product context, not word by word

GitHub sync (beta)

chore/i18n-sync

Opened as a pull request for review

LefineOne source of truth for every language
de
Published

de.json

Live on the CDN, no deploy

fr
Published

fr.json

Live on the CDN, no deploy

ja
Published

ja.json

Live on the CDN, no deploy

ar
Published

ar.json

Live on the CDN, no deploy

en
Source string

useStrings('common')

Edited in code, picked up on the next scan

Glossary

Brand terms stay untranslated

AI translation

Written from your product context, not word by word

GitHub sync (beta)

chore/i18n-sync

Opened as a pull request for review

LefineOne source of truth for every language
de
Published

de.json

Live on the CDN, no deploy

fr
Published

fr.json

Live on the CDN, no deploy

ja
Published

ja.json

Live on the CDN, no deploy

ar
Published

ar.json

Live on the CDN, no deploy

Keep reading

Related

Get started

Start free.

Start Building with React i18n

Free tier available. No credit card required.