{"id":24047742,"url":"https://github.com/jon1vk/nextglobegen","last_synced_at":"2026-02-13T13:10:21.194Z","repository":{"id":266769857,"uuid":"898503377","full_name":"Jon1VK/NextGlobeGen","owner":"Jon1VK","description":"Internationalization (i18n) library for Next.js App Router","archived":false,"fork":false,"pushed_at":"2025-05-02T14:37:56.000Z","size":1287,"stargazers_count":22,"open_issues_count":2,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-05T06:54:07.482Z","etag":null,"topics":["i18n","internationalization","localization","nextjs","react"],"latest_commit_sha":null,"homepage":"https://next-globe-gen.dev/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Jon1VK.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"Jon1VK"}},"created_at":"2024-12-04T14:10:09.000Z","updated_at":"2025-06-21T12:31:49.000Z","dependencies_parsed_at":"2025-01-14T16:50:21.653Z","dependency_job_id":"93c87cfd-1c80-4cb0-95e4-1f015ab495ea","html_url":"https://github.com/Jon1VK/NextGlobeGen","commit_stats":null,"previous_names":["jon1vk/i18n-app-router","jon1vk/next-i18n-gen","jon1vk/nextglobegen"],"tags_count":53,"template":false,"template_full_name":null,"purl":"pkg:github/Jon1VK/NextGlobeGen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jon1VK%2FNextGlobeGen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jon1VK%2FNextGlobeGen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jon1VK%2FNextGlobeGen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jon1VK%2FNextGlobeGen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Jon1VK","download_url":"https://codeload.github.com/Jon1VK/NextGlobeGen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Jon1VK%2FNextGlobeGen/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266998002,"owners_count":24018949,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["i18n","internationalization","localization","nextjs","react"],"created_at":"2025-01-09T00:51:01.320Z","updated_at":"2026-02-13T13:10:21.184Z","avatar_url":"https://github.com/Jon1VK.png","language":"TypeScript","funding_links":["https://github.com/sponsors/Jon1VK"],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\n  \u003cpicture\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs/static/img/logo.dark.svg\"\u003e\n    \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"docs/static/img/logo.svg\"\u003e\n    \u003cimg alt=\"next-intl\" src=\"docs/static/img/logo.svg\" width=\"32\"\u003e\n  \u003c/picture\u003e\n  NextGlobeGen\n\u003c/h1\u003e\n\n\u003ca href=\"https://www.npmjs.com/package/next-globe-gen\"\u003e\u003cimg alt=\"NPM version\" src=\"https://img.shields.io/npm/v/next-globe-gen?style=for-the-badge\u0026color=%23CC3534\u0026logo=npm\u0026logoColor=%23CC3534\u0026labelColor=%23eee\"/\u003e\u003c/a\u003e\n\u003cimg alt=\"Next.js App Router Support\" src=\"https://img.shields.io/badge/App%20Router-%23000000?style=for-the-badge\u0026logo=nextdotjs\u0026logoColor=%23000000\u0026label=Next.js\u0026labelColor=%23eee\"/\u003e\n\u003cimg alt=\"TypeScript Support\" src=\"https://img.shields.io/badge/%20Type--safe-%233178C6?style=for-the-badge\u0026logo=typescript\u0026label=TypeScript\u0026labelColor=%23eee\"/\u003e\n\nNextGlobeGen makes it effortless to deliver your content in multiple languages with SEO-optimized, localized URLs.\n\nNextGlobeGen is a powerful TypeScript-first internationalization (i18n) library for Next.js App Router applications. Unlike traditional i18n solutions, NextGlobeGen uses **generative programming** to automatically create localized routes and type-safe APIs, giving you a seamless development experience with full TypeScript support.\n\n## Why NextGlobeGen?\n\n### 🎯 Developer Experience First\n\n- **Zero Runtime Overhead** - Routes are generated at build time, not runtime\n- **Type-Safe Everything** - Full TypeScript inference for routes, locales, and messages\n- **Universal API** - Same hooks and components work in both server and client components\n- **Hot Reloading** - Changes to routes and messages regenerate automatically\n\n### 🚀 Production Ready\n\n- **SEO Optimized** - Automatic language alternate links and localized pathnames\n- **Performance** - Code splitting support with filtered message delivery\n- **Flexible Routing** - Support for prefix-based and domain-based locale routing\n- **Next.js Native** - Built specifically for Next.js App Router with full feature support\n\n### 💪 Powerful Features\n\n- **Automatic Key Extraction** - Automatically discover translation keys from your source code\n- **ICU Message Format** - Rich text formatting with plurals, dates, numbers, and embedded React components\n- **Localized Pathnames** - Translate URL segments for better SEO (e.g., `/en/about` → `/fi/tietoja`)\n- **Smart Locale Detection** - Automatic user locale negotiation with cookie persistence\n- **Dynamic Routes** - Full support for dynamic segments, catch-all routes, and parallel routes\n\n## Quick Example\n\n```tsx\nimport { useTranslations, Link } from \"next-globe-gen\";\n\nexport default function HomePage() {\n  const t = useTranslations();\n\n  return (\n    \u003cdiv\u003e\n      \u003ch1\u003e{t(\"welcome\")}\u003c/h1\u003e\n      \u003cp\u003e{t(\"description\", { name: \"NextGlobeGen\" })}\u003c/p\u003e\n      \u003cLink href=\"/dashboard\"\u003e{t(\"dashboard.title\")}\u003c/Link\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n```json\n{\n  \"welcome\": \"Welcome!\",\n  \"description\": \"{name} makes i18n effortless\",\n  \"dashboard\": {\n    \"title\": \"Dashboard\"\n  }\n}\n```\n\nThis automatically works for all configured locales with zero additional code!\n\n## Key Features\n\n### Generative Locale Routes\n\nThe plugin watches your `src/_app` directory and automatically generates localized versions of your routes in real-time:\n\n```\nsrc/_app/about/page.tsx  →  src/app/(i18n)/en/about/page.tsx\n                         →  src/app/(i18n)/fi/tietoja/page.tsx\n```\n\nNo manual route duplication. No runtime route matching. Just write your routes once, and NextGlobeGen handles the rest.\n\n### Type-Safe API\n\nGet full TypeScript support across your entire i18n implementation:\n\n```tsx\n// Routes are type-checked\n\u003cLink href=\"/blog/[slug]\" params={{ slug: \"hello\" }}\u003e\n  Post\n\u003c/Link\u003e;\n\n// Message keys are autocompleted\nconst t = useTranslations(\"dashboard\");\nt(\"title\"); // ✓ Type-safe\nt(\"typo\"); // ✗ TypeScript error\n\n// Locale switching with preserved params\nconst route = useRoute(); // Type: \"/blog/[slug]\"\nconst params = useParams\u003cRouteParams\u003ctypeof route\u003e\u003e();\n\u003cLink href={route} params={params} locale=\"fi\"\u003e\n  Suomeksi\n\u003c/Link\u003e;\n```\n\n### ICU Message Format\n\nSupport for rich text formatting with plurals, select, dates, and React components:\n\n```json\n{\n  \"welcome\": \"Welcome {name}!\",\n  \"posts\": \"{count, plural, =0 {No posts} one {One post} other {# posts}}\",\n  \"updated\": \"Last updated: {date, date, long}\",\n  \"richText\": \"Read \u003clink\u003eour guide\u003c/link\u003e for more info\"\n}\n```\n\n```tsx\nt(\"welcome\", { name: \"Jon\" });\nt(\"posts\", { count: 5 });\nt(\"updated\", { date: new Date() });\nt(\"richText\", { link: (children) =\u003e \u003cLink href=\"/guide\"\u003e{children}\u003c/Link\u003e });\n```\n\n### Automatic Key Extraction\n\nNextGlobeGen automatically scans your source files and extracts translation keys, keeping your message files in sync with your code:\n\n```tsx\n// Keys are automatically extracted from your source files\nconst t = useTranslations(\"home\");\nt(\"title\"); // Extracted as \"home.title\"\nt(\"welcome\", { _defaultMessage: \"Welcome!\" }); // Extracted with default message\n```\n\nConfigure extraction behavior in your config:\n\n```ts\nconst config = {\n  messages: {\n    keyExtractionDirs: [\"./src\"], // Directories to scan\n    pruneUnusedKeys: true, // Remove keys no longer in code\n    whitelistedKeys: [/^dynamic\\./], // Protect dynamic keys from pruning\n  },\n};\n```\n\n### Flexible Routing Options\n\nChoose the routing strategy that fits your needs:\n\n**Prefix-Based Routing** (e.g., `example.com/en`, `example.com/fi`)\n\n```ts\nconst config = {\n  locales: [\"en\", \"fi\"],\n  defaultLocale: \"en\",\n  prefixDefaultLocale: true, // or false for root default locale\n};\n```\n\n**Domain-Based Routing** (e.g., `example.com`, `example.fi`)\n\n```ts\nconst config = {\n  domains: [\n    { domain: \"example.com\", locales: [\"en\"], defaultLocale: \"en\" },\n    { domain: \"example.fi\", locales: [\"fi\"], defaultLocale: \"fi\" },\n  ],\n};\n```\n\n### Smart Middleware\n\nThe included proxy/middleware handles:\n\n- **Locale Negotiation** - Detects user's preferred language from Accept-Language header\n- **Cookie Persistence** - Remembers user's language choice\n- **Alternate Links** - Adds SEO-friendly language alternate links to response headers\n- **Domain Routing** - Redirects users to the correct domain based on locale\n\n### Server \u0026 Client Components\n\nThe same API works everywhere:\n\n```tsx\n// \"use client\"; just add this directive for Client Components\nimport { useLocale, useTranslations } from \"next-globe-gen\";\n\nexport default function ServerComponent() {\n  const locale = useLocale();\n  const t = useTranslations();\n  return \u003ch1\u003e{t(\"title\")}\u003c/h1\u003e;\n}\n```\n\nNeed async functions? Use the `get*` aliases:\n\n```tsx\nexport async function generateMetadata() {\n  const t = getTranslations();\n  return { title: t(\"pageTitle\") };\n}\n```\n\n## Getting Started\n\nReady to internationalize your Next.js app? Follow our [Getting Started Guide](https://next-globe-gen.dev/docs/getting-started) to set up NextGlobeGen in minutes.\n\n### Coming from next-intl?\n\nIf you're familiar with next-intl or considering alternatives, check out our [detailed comparison](https://next-globe-gen.dev/docs/comparison-with-next-intl) to understand the differences and see which approach fits your project best.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjon1vk%2Fnextglobegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjon1vk%2Fnextglobegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjon1vk%2Fnextglobegen/lists"}