Problems developers face when localizing Bun apps—and how IntlPull helps.
Newer runtime. Some edge cases with complex npm packages. Most i18n libraries work fine.
No Bun-native i18n library yet. Use Node.js libraries which work well but aren't optimized for Bun.
i18n examples in Bun docs are limited. Rely on Node.js library docs with Bun adaptation.
Why Various is a great choice for Bun localization.
Run i18next, FormatJS, and most npm i18n packages unchanged. Bun's Node.js compatibility means zero migration.
vs incompatible runtimes
25x faster startup than Node.js. Ideal for serverless where cold starts matter. Load translations instantly.
vs slow Node.js startup
Bundle translations with Bun's built-in bundler. No webpack config. Fast builds with tree-shaking.
vs complex bundler setup
Full JavaScript Intl API support. DateTimeFormat, NumberFormat, Collator work natively.
vs polyfill requirements
Native TypeScript execution. No tsc step. Type-safe translations with zero config.
vs TypeScript compilation
Small runtime perfect for edge deployments. Cloudflare Workers, Vercel Edge compatibility.
vs heavy Node.js runtime
Get Various running in your Bun project.
Initialize a new Bun project with TypeScript.
bun init -y
# or for existing project
bun add i18nextAdd i18next for translation management.
bun add i18nextSet up locale files.
// locales/en.json
{
"welcome": {
"title": "Welcome to Bun",
"description": "The fastest JavaScript runtime"
},
"nav": {
"home": "Home",
"about": "About"
}
}
// locales/es.json
{
"welcome": {
"title": "Bienvenido a Bun",
"description": "El runtime de JavaScript mas rapido"
},
"nav": {
"home": "Inicio",
"about": "Acerca"
}
}Configure i18next for Bun.
// src/i18n.ts
import i18next from 'i18next';
import en from '../locales/en.json';
import es from '../locales/es.json';
await i18next.init({
lng: 'en',
fallbackLng: 'en',
resources: {
en: { translation: en },
es: { translation: es },
},
interpolation: {
escapeValue: false,
},
});
export default i18next;Access translations in your Bun application.
// src/index.ts
import i18n from './i18n';
console.log(i18n.t('welcome.title')); // "Welcome to Bun"
// Change language
i18n.changeLanguage('es');
console.log(i18n.t('welcome.title')); // "Bienvenido a Bun"
// With Bun's native Intl
const formatter = new Intl.DateTimeFormat('es-ES', {
dateStyle: 'full',
});
console.log(formatter.format(new Date())); // "lunes, 3 de febrero de 2025"Connect IntlPull to manage translations professionally.
Add the CLI for translation management.
bun add -D @intlpull/cliSet up the project configuration.
{
"projectId": "your-project-id",
"format": "json",
"sourceLocale": "en",
"localesDir": "./locales",
"filePattern": "{locale}.json"
}Download translations from IntlPull.
bunx intlpull pullIntegrate with your workflow.
// package.json
{
"scripts": {
"i18n:pull": "bunx intlpull pull",
"i18n:push": "bunx intlpull push",
"dev": "bun run i18n:pull && bun run src/index.ts"
}
}Complete guide to React localization with react-i18next. Setup, lazy loading, namespaces, SSR, and IntlPull integration for production i18n.
Complete guide to Astro localization with astro-i18next and built-in routing. Static site generation with multilingual content.
Complete guide to SolidJS localization with @solid-primitives/i18n. Reactive translations, lazy loading, and IntlPull integration.