{"id":29038212,"url":"https://github.com/mstgnz/nexti8n","last_synced_at":"2026-05-17T15:33:39.578Z","repository":{"id":287938613,"uuid":"963432282","full_name":"mstgnz/nexti8n","owner":"mstgnz","description":"NextJS Internationalization Starter","archived":false,"fork":false,"pushed_at":"2025-04-09T17:13:18.000Z","size":69,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-26T22:33:51.565Z","etag":null,"topics":["i8n","localization","nextjs","starter-kit"],"latest_commit_sha":null,"homepage":"","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/mstgnz.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}},"created_at":"2025-04-09T17:12:09.000Z","updated_at":"2025-04-09T17:22:54.000Z","dependencies_parsed_at":"2025-04-14T18:57:30.246Z","dependency_job_id":"e053d796-15e7-4fdc-b364-b2d2a6bb4da7","html_url":"https://github.com/mstgnz/nexti8n","commit_stats":null,"previous_names":["mstgnz/nexti8n"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/mstgnz/nexti8n","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstgnz%2Fnexti8n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstgnz%2Fnexti8n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstgnz%2Fnexti8n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstgnz%2Fnexti8n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mstgnz","download_url":"https://codeload.github.com/mstgnz/nexti8n/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mstgnz%2Fnexti8n/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279008620,"owners_count":26084480,"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-10-11T02:00:06.511Z","response_time":55,"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":["i8n","localization","nextjs","starter-kit"],"created_at":"2025-06-26T13:37:01.344Z","updated_at":"2025-10-11T20:34:19.175Z","avatar_url":"https://github.com/mstgnz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nexti8n - Next.js Internationalization Starter\n\nA lightweight, flexible, and easy-to-use internationalization (i18n) starter kit for Next.js applications. This project provides a complete solution for building multilingual websites with Next.js 15+ App Router.\n\n## Features\n\n- 🌐 **Middleware-based routing**: Automatically routes users based on their language preference\n- 🔄 **Seamless URL localization**: Clean URLs with language prefixes (`/en/about`, `/tr/hakkimizda`)\n- 📝 **JSON-based translations**: Simple management of translations in JSON files\n- 🧩 **TypeScript support**: Full type safety for your translations\n- 🖥️ **Server and Client components**: Works with both React Server Components and Client Components\n- 🔀 **Language switcher**: Easy-to-implement language switching component\n- 🎯 **SEO friendly**: Proper language tags and metadata for search engines\n- 🚀 **Zero dependencies**: No additional i18n libraries required\n\n## Demo\n\nThe demo showcases a simple multilingual website with multiple pages and navigation that automatically adjusts based on the selected language.\n\n## Getting Started\n\n### Installation\n\n```bash\n# Clone the repository\ngit clone https://github.com/yourusername/nexti8n.git\n\n# Navigate to the project\ncd nexti8n\n\n# Install dependencies\nnpm install\n\n# Run the development server\nnpm run dev\n```\n\n### Project Structure\n\n```\n/\n├── app/                   # Next.js App Router\n│   ├── [locale]/          # Dynamic route for localized pages\n│   │   ├── about/         # Localized About page\n│   │   ├── contact/       # Localized Contact page\n│   │   ├── login/         # Localized Login page\n│   │   └── ...            # Other localized pages\n│   └── layout.tsx         # Root layout\n├── context/               # React context for locale management\n├── lib/                   # Utility functions\n│   └── i18n.ts            # i18n helper functions\n├── locales/               # Translation files\n│   ├── en.json            # English translations\n│   └── tr.json            # Turkish translations\n├── middleware.ts          # Next.js middleware for handling localization\n└── ...\n```\n\n### How It Works\n\n1. **Middleware**: Handles language detection and routing\n2. **JSON Files**: Store translations for different languages\n3. **Context API**: Manages the current locale\n4. **Helper Functions**: Provide utilities for translation and URL generation\n\n### Adding a New Language\n\n1. Create a new JSON file in the `locales` folder (e.g., `fr.json`)\n2. Add the language code to the `locales` array in `middleware.ts`\n3. Fill in the translations in your new JSON file\n\n### Adding Translations\n\nThe translation files follow this structure:\n\n```json\n{\n  \"routes\": {\n    \"home\": \"\",\n    \"about\": \"about\",\n    \"contact\": \"contact\",\n    \"not-found\": \"404\",\n    \"login\": \"login\",\n    \"register\": \"register\",\n    \"forgot-password\": \"forgot-password\",\n    \"account\": {\n      \"logout\": \"account/logout\",\n      \"profile\": \"account/profile\"\n    }\n  },\n  \"common\": {\n    \"home\": \"Home\",\n    \"about\": \"About\",\n    \"contact\": \"Contact\"\n  }\n}\n```\n\n## Usage\n\n### Translating Content\n\n```tsx\n// Import the helper function\nimport { getMessages } from \"@/lib/i18n\";\n\n// In your component\nexport default function Page({ params: { locale } }) {\n  const messages = getMessages(locale);\n\n  return (\n    \u003cdiv\u003e\n      \u003ch1\u003e{messages.common.home}\u003c/h1\u003e\n    \u003c/div\u003e\n  );\n}\n```\n\n### Creating Localized Links\n\n```tsx\nimport Link from \"next/link\";\nimport { getLocalizedPath } from \"@/lib/i18n\";\n\nexport default function Navigation({ locale }) {\n  return (\n    \u003cnav\u003e\n      \u003cLink href={getLocalizedPath(locale, \"about\")}\u003eAbout\u003c/Link\u003e\n    \u003c/nav\u003e\n  );\n}\n```\n\n## Customization\n\n### Changing the Default Language\n\nEdit the `defaultLocale` variable in `middleware.ts`:\n\n```ts\n// Default locale\nexport const defaultLocale = \"en\";\n```\n\n### Customizing Routes\n\nEdit the route definitions in the respective locale files:\n\n```json\n// locales/en.json\n{\n  \"routes\": {\n    \"blog\": \"blog\",\n    \"products\": \"products\"\n  }\n}\n\n// locales/fr.json\n{\n  \"routes\": {\n    \"blog\": \"blog\",\n    \"products\": \"produits\"\n  }\n}\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmstgnz%2Fnexti8n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmstgnz%2Fnexti8n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmstgnz%2Fnexti8n/lists"}