Skip to content
Remix & Hydrogen i18n

Remix & Hydrogen i18n for storefront and route-driven apps

Use Lefine to keep server-rendered locale state, localized storefront content, and search-facing routes aligned in one workflow.

Package
lefine
Works with
Remix · Hydrogen
lefine
01Terminal
npm install lefine
02app/root.tsx
import { createStrings } from 'lefine/server';import { StringsProvider, useStrings } from 'lefine/react';const strings = createStrings({  project: 'app_3f9c0e4b2a7d4e1f9b6c5a8d7e2f1a0b',});export async function loader({ params }: LoaderFunctionArgs) {  return strings.load(params.locale ?? 'en', ['product']);}function ProductHero() {  const t = useStrings('product');  return <h1>{t('title')}</h1>;}export default function App() {  const props = useLoaderData<typeof loader>();  return (    <StringsProvider {...props}>      <ProductHero />      <Outlet />    </StringsProvider>  );}
t('title')
Linen shirt

Route-level locale wiring

A provider-based setup that fits loader-driven frameworks and storefront route trees.

01/Setup

Get started in 3 steps

  1. 01

    Install the app-side SDK

    Use @better-i18n/remix in your Remix, React Router or Hydrogen app so translated content can be shared across route modules.

    terminalbash
    npm install lefine
  2. 02

    Resolve locale on the server

    Read locale from request, route params, or storefront context and pass it into your app root.

    app/root.tsx
    import { createStrings } from 'lefine/server';// Create once at module scope (or in app/strings.server.ts)const strings = createStrings({  project: 'app_3f9c0e4b2a7d4e1f9b6c5a8d7e2f1a0b',});// The locale comes from your route, e.g. /:locale/...export async function loader({ params }: LoaderFunctionArgs) {  const locale = params.locale ?? 'en';  return strings.load(locale, ['common', 'product']);}
  3. 03

    Hydrate the provider in the root route

    Provide the locale once so nested routes, product pages, and cart UI all share the same translation source.

    app/root.tsx
    import { StringsProvider } from 'lefine/react';export default function App() {  const props = useLoaderData<typeof loader>();  return (    <StringsProvider {...props}>      <Outlet />    </StringsProvider>  );}
02/Capabilities

Why use Lefine with Remix and Hydrogen?

  • Server-loaded locale handling that fits Remix loaders and Hydrogen storefront flows
  • Good fit for SEO-sensitive category, product, and content pages
  • One translation workflow for storefront UI, account pages, and marketing routes
  • Supports route-based locale strategies without fragile file duplication
  • Lets developers ship localized storefront updates without blocking on redeploys
  • Keeps comparison and buyer-intent content aligned with product localization pages
Get started

Start free.

Ship localized storefronts without fragmented workflows

Keep server locale handling, product content, and buyer-intent pages in one localization system.