Type-safe internationalization tool for Next.js App Router with co-location and IDE code jumping
npm install i18n-atπ Type-safe internationalization tool for Next.js App Router with co-location and IDE code jumping
- ποΈ Co-location First - Define messages right where they're used
- π‘οΈ 100% Type-safe - Full TypeScript support with strict typing
- π IDE Code Jumping - Jump directly to message definitions
``bash`
npm install i18n-at
`typescript
// Define messages right where you use them
import { defineMessages, useI18n } from "i18n-at";
const { messages } = defineMessages({
en: {
dashboard: {
title: "Dashboard",
welcome: "Welcome, {$name}!",
},
},
ja: {
dashboard: {
title: "γγγ·γ₯γγΌγ",
welcome: "{$name} γγγγγγγοΌ",
},
},
});
function Dashboard() {
const { t, m } = useI18n(messages); // Type-safe & IDE jumping!
return (
{t(m.dashboard.welcome, { name: "User" })}
For complete documentation, examples, and guides, visit our documentation site:
π View Full Documentation β
- π Quick Start Guide - Get started in minutes
- π API Reference - Complete API documentation
- π― Why i18n-at? - Understanding the benefits
- π§ Advanced Usage - Advanced patterns and techniques
Unlike traditional i18n solutions that force you to manage translations in separate files, i18n-at lets you define and use messages in the same place:
- π― Easy Maintenance: Messages live next to their usage
- π IDE Code Jumping: F12 jumps directly to message definitions
- π‘οΈ 100% Type-safe: Full TypeScript support
- π§Ή Dead Code Detection: Unused messages are easily spotted
- β‘ Faster Refactoring: Change component? Messages move with it
We welcome contributions! Please see our Contributing Guide.
MIT Β© Jabelic
---
Made with β€οΈ for type-safe internationalization