-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathmiddleware.ts
40 lines (35 loc) · 1021 Bytes
/
middleware.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import createMiddleware from 'next-intl/middleware'
import locales from './locales/locales.json'
import { DEFAULT_LANGUAGE, NEXT_INTL_LOCALE_PREFIX } from '#utils/constants'
export default createMiddleware({
locales,
defaultLocale: DEFAULT_LANGUAGE,
localePrefix: NEXT_INTL_LOCALE_PREFIX,
})
export const config = {
// Match only internationalized pathnames
matcher: [
'/',
'/(en|zh-Hans|ko)/:path*',
// old paths that may have non-i18n-prefixed references
'/about/:path*',
'/card/:path*',
'/cards/:path*',
'/characters/:path*',
'/colors/:path*',
'/diary/:path*',
'/emblems/:path*',
'/eventstories/:path*',
'/messages/:path*',
'/moshikoi/:path*',
'/mtalk/:path*',
'/notemap/:path*',
'/page/:path*.tsx',
'/search/:path*',
'/settings/:path*',
'/spine/:path*',
'/stories/:path*',
'/story/:path*',
'/units/:path*',
],
}