Problems developers face when localizing SolidJS apps—and how IntlPull helps.
Fewer resources and plugins compared to React i18n libraries.
Basic ICU support. Complex formatting may need additional setup.
Growing documentation. Some patterns require community examples.
Why @solid-primitives/i18n is a great choice for SolidJS localization.
Only translated text re-renders. No component re-renders on language change.
vs component-level updates
Composable primitives. Build custom i18n solutions. Extend easily.
vs monolithic libraries
Full TypeScript support. Type-safe translation keys. Autocomplete in IDE.
vs runtime key errors
Load translations on demand. Dynamic imports. Code splitting friendly.
vs loading all upfront
Works with SolidStart SSR. Proper hydration. SEO friendly.
vs client-only solutions
Under 2KB gzipped. No heavy dependencies. Solid-native approach.
vs bloated libraries
Get @solid-primitives/i18n running in your SolidJS project.
Add solid-primitives i18n package.
npm install @solid-primitives/i18nSet up locale dictionaries.
// src/i18n/en.ts
export const dict = {
welcome: {
title: 'Welcome',
description: 'Build something amazing with SolidJS',
},
nav: {
home: 'Home',
about: 'About',
contact: 'Contact',
},
};
// src/i18n/es.ts
export const dict = {
welcome: {
title: 'Bienvenido',
description: 'Construye algo increible con SolidJS',
},
nav: {
home: 'Inicio',
about: 'Acerca',
contact: 'Contacto',
},
};Set up the i18n provider.
// src/i18n/index.tsx
import { createI18nContext, I18nContext } from '@solid-primitives/i18n';
import { ParentComponent, createSignal } from 'solid-js';
import * as en from './en';
import * as es from './es';
const dictionaries = { en: en.dict, es: es.dict };
export const I18nProvider: ParentComponent = (props) => {
const [locale, setLocale] = createSignal('en');
const value = createI18nContext(dictionaries, locale);
return (
<I18nContext.Provider value={value}>
{props.children}
</I18nContext.Provider>
);
};Add provider to your app.
// src/index.tsx
import { render } from 'solid-js/web';
import { I18nProvider } from './i18n';
import App from './App';
render(
() => (
<I18nProvider>
<App />
</I18nProvider>
),
document.getElementById('root')!
);Access translations in components.
import { useI18n } from '@solid-primitives/i18n';
function Welcome() {
const [t, { locale, setLocale }] = useI18n();
return (
<div>
<h1>{t('welcome.title')}</h1>
<p>{t('welcome.description')}</p>
<select value={locale()} onChange={(e) => setLocale(e.target.value)}>
<option value="en">English</option>
<option value="es">Espanol</option>
</select>
</div>
);
}Connect IntlPull to manage translations professionally.
Add the CLI for translation management.
npm install -D @intlpull/cliSet up the project configuration.
{
"projectId": "your-project-id",
"format": "typescript",
"sourceLocale": "en",
"localesDir": "./src/i18n",
"filePattern": "{locale}.ts"
}Download translations from IntlPull.
npx intlpull pull --format typescriptIntegrate with your build process.
// package.json
{
"scripts": {
"i18n:pull": "intlpull pull --format typescript",
"build": "npm run i18n:pull && vite build"
}
}Complete guide to React localization with react-i18next. Setup, lazy loading, namespaces, SSR, and IntlPull integration for production i18n.
Complete guide to Svelte localization with svelte-i18n. Store-based reactivity, lazy loading, and IntlPull integration for SvelteKit apps.