Skip to content

Conversation

@LZylstra
Copy link
Collaborator

@LZylstra LZylstra commented Jan 8, 2026

No description provided.

@vercel
Copy link

vercel bot commented Jan 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
cms-nextjs Ready Ready Preview, Comment Jan 27, 2026 10:01pm
cms-nuxt Ready Ready Preview, Comment Jan 27, 2026 10:01pm
cms-svelte Ready Ready Preview, Comment Jan 27, 2026 10:01pm
pizza-frontend Ready Ready Preview, Comment Jan 27, 2026 10:01pm
visual-editor-demo Ready Ready Preview, Comment Jan 27, 2026 10:01pm

Request Review

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive internationalization (i18n) support to a Nuxt CMS application powered by Directus. The implementation uses locale prefixes in URLs (e.g., /es/blog/post) while keeping the default locale unprefixed, and integrates with Directus's translation tables to serve localized content.

Key Changes:

  • Added translation schema types and Directus collections for all content types (pages, posts, navigation, forms, etc.)
  • Implemented server-side locale detection via middleware and URL rewriting
  • Created i18n utilities for locale handling, translation merging, and link localization
  • Updated all API endpoints and components to support locale-aware content fetching

Reviewed changes

Copilot reviewed 34 out of 34 changed files in this pull request and generated 27 comments.

Show a summary per file
File Description
cms-i18n/nuxt/shared/types/schema.ts Adds TypeScript interfaces for 14+ translation collections and Language type
cms-i18n/nuxt/server/utils/i18n.ts Server-side locale extraction and language fetching utilities
cms-i18n/nuxt/server/utils/directus-i18n.ts Translation merging logic and Directus query builders for i18n
cms-i18n/nuxt/server/middleware/locale.ts Extracts locale from URL and rewrites requests for file-based routing
cms-i18n/nuxt/server/api/sitemap.get.ts Generates sitemap with alternate language links for all locales
cms-i18n/nuxt/server/api/site-data.get.ts Fetches globals and navigation with locale-specific translations
cms-i18n/nuxt/server/api/search.get.ts Adds translation support to search results
cms-i18n/nuxt/server/api/posts/*.ts Updates post endpoints to fetch and merge translations
cms-i18n/nuxt/server/api/pages/one.get.ts Adds i18n support for page fetching with nested blocks
cms-i18n/nuxt/middleware/locale.global.ts Client-side middleware for locale extraction
cms-i18n/nuxt/app/router.options.ts Adds locale-prefixed blog route alias
cms-i18n/nuxt/app/pages/blog/[slug].vue Updates blog page with locale handling and alternate links
cms-i18n/nuxt/app/pages/[...permalink].vue Updates catch-all page with locale support
cms-i18n/nuxt/app/lib/i18n/*.ts Core i18n configuration and utility functions
cms-i18n/nuxt/app/layouts/default.vue Adds locale-aware data fetching and HTML attributes
cms-i18n/nuxt/app/composables/useLocale.ts Composable for accessing current locale in components
cms-i18n/nuxt/app/components/ui/dialog/*.vue Code formatting improvements (spacing/indentation)
cms-i18n/nuxt/app/components/ui/input/Input.vue Code formatting improvements
cms-i18n/nuxt/app/components/shared/LanguageSwitcher.vue New language switcher component with dropdown
cms-i18n/nuxt/app/components/block/Posts.vue Adds locale support for post block links
cms-i18n/nuxt/app/components/base/*.vue Updates buttons and search with localized links
cms-i18n/nuxt/app/components/NavigationBar.vue Adds language switcher and localized navigation links
cms-i18n/nuxt/app/components/Footer.vue Adds localized footer links
cms-i18n/nuxt/app/app.vue Removes static lang attribute (moved to layout)
Comments suppressed due to low confidence (1)

cms-i18n/nuxt/app/components/base/BaseButton.vue:49

  • Type casting to any for record objects is unsafe. The icons record should be properly typed using Record<string, Component> or similar to maintain type safety.
const icons: Record<string, any> = {
	arrow: ArrowRight,
	plus: Plus,
};

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants