Problems developers face when localizing Deno apps—and how IntlPull helps.
Not all npm packages work. Some i18n libraries need adaptation or alternatives.
Fewer Deno-specific i18n libraries. May need to adapt Node.js patterns.
Different from Node.js patterns. Permissions and URL imports need adjustment.
Why Various is a great choice for Deno localization.
No compilation step. TypeScript runs directly. Type-safe translations out of the box.
vs TypeScript compilation
Explicit permissions model. Control file and network access. Secure translation loading.
vs unrestricted access
Native Intl API support. fetch, URL, and web APIs work natively. Modern JavaScript.
vs Node.js polyfills
Import i18n libraries directly from URLs. No package.json required. esm.sh compatibility.
vs npm install
First-class i18n support with Deno Fresh. Island architecture with localized components.
vs heavy frameworks
deno fmt, deno lint, deno test included. No separate toolchain setup.
vs configuring tools
Get Various running in your Deno project.
Initialize a Deno project with TypeScript.
deno init my-app
cd my-appSet up locale JSON files.
// locales/en.json
{
"welcome": {
"title": "Welcome to Deno",
"description": "A secure JavaScript runtime"
},
"nav": {
"home": "Home",
"about": "About"
}
}
// locales/es.json
{
"welcome": {
"title": "Bienvenido a Deno",
"description": "Un runtime JavaScript seguro"
},
"nav": {
"home": "Inicio",
"about": "Acerca"
}
}Build a simple i18n helper.
// src/i18n.ts
type Translations = Record<string, Record<string, string>>;
type Locale = 'en' | 'es' | 'de';
const translations: Record<Locale, Translations> = {
en: {},
es: {},
de: {},
};
let currentLocale: Locale = 'en';
export async function loadLocale(locale: Locale): Promise<void> {
if (!translations[locale] || Object.keys(translations[locale]).length === 0) {
const data = await Deno.readTextFile(`./locales/${locale}.json`);
translations[locale] = JSON.parse(data);
}
currentLocale = locale;
}
export function t(key: string): string {
const keys = key.split('.');
let result: any = translations[currentLocale];
for (const k of keys) {
result = result?.[k];
}
return result ?? key;
}
export { currentLocale };Access translations in your Deno application.
// main.ts
import { loadLocale, t } from './src/i18n.ts';
await loadLocale('en');
console.log(t('welcome.title')); // "Welcome to Deno"
await loadLocale('es');
console.log(t('welcome.title')); // "Bienvenido a Deno"
// With native Intl API
const formatter = new Intl.DateTimeFormat('es-ES', {
dateStyle: 'full',
});
console.log(formatter.format(new Date()));Execute with file read permission.
deno run --allow-read=./locales main.tsConnect IntlPull to manage translations professionally.
Add the CLI for translation management.
# Using npm (works with Deno's npm: specifier)
npm install -g @intlpull/cliSet up the project configuration.
{
"projectId": "your-project-id",
"format": "json",
"sourceLocale": "en",
"localesDir": "./locales",
"filePattern": "{locale}.json"
}Download translations from IntlPull.
npx intlpull pullIntegrate with deno.json tasks.
// deno.json
{
"tasks": {
"i18n:pull": "npx intlpull pull",
"dev": "deno task i18n:pull && deno run --allow-read --allow-net main.ts"
}
}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.
Complete guide to internationalization in Bun. Use i18next, FormatJS, or lightweight solutions with Bun's fast runtime for multilingual applications.