Skip to content
Jabelic-WorksPublic

About

Type-safe internationalization tool for Next.js App Router with co-location and IDE code jumping

Topics

Resources

Contributing

Stars

8 stars

Watchers

0 watching

Forks

Repository files navigation

i18n-at

🌍 Type-safe internationalization for React and Next.js with co-location and IDE code jumping

View i18n-at on npm

✨ Features

  • 🏗️ 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

🚀 Quick Start

Installation

npm install i18n-at

Basic Usage

// Define messages right where you use them
import { defineMessages } from "i18n-at";
import { I18nClientProvider, useI18n } from "i18n-at/client";

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 (
    <div>
      <h1>{t(m.dashboard.title)}</h1>
      <p>{t(m.dashboard.welcome, { name: "User" })}</p>
    </div>
  );
}

function App() {
  return (
    <I18nClientProvider locale="en">
      <Dashboard />
    </I18nClientProvider>
  );
}

Examples

📖 Documentation

For complete documentation, examples, and guides, visit our documentation site:

📚 View Full Documentation →

🎯 Why This Library?

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:

✅ Our Co-location Benefits

  • 🎯 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

🤝 Contributing

We welcome contributions! Please see our Contributing Guide.

📄 License

MIT © Jabelic


Made with ❤️ for type-safe internationalization

About

Type-safe internationalization tool for Next.js App Router with co-location and IDE code jumping

Topics

Resources

Contributing

Stars

8 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages