Skip to content

Instantly share code, notes, and snippets.

@FrancisGregori
Created November 25, 2023 23:24
Show Gist options
  • Save FrancisGregori/3075b75c21984e4ae4bac3a4be201323 to your computer and use it in GitHub Desktop.
Save FrancisGregori/3075b75c21984e4ae4bac3a4be201323 to your computer and use it in GitHub Desktop.
import createMiddleware from 'next-intl/middleware';
import { locales } from './navigation';
export default createMiddleware({
locales,
defaultLocale: 'en',
localePrefix: 'never',
localeDetection: false,
domains: [
{
domain: process.env.PT_DOMAIN!,
defaultLocale: 'pt',
locales: ['pt'],
},
{
domain: process.env.ES_DOMAIN!,
defaultLocale: 'es',
locales: ['es'],
},
],
});
export const config = {
// Skip all paths that should not be internationalized
matcher: ['/((?!_next|_vercel|.*\\..*).*)'],
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment