11import { createCoreContext } from '@intlify/core'
22import { describe , expect , test } from 'vitest'
3- import { SYMBOL_I18N , SYMBOL_I18N_LOCALE } from './symbols.ts'
3+ import { SYMBOL_INTLIFY , SYMBOL_INTLIFY_LOCALE } from './symbols.ts'
44
55import {
6- defineI18nMiddleware ,
6+ defineIntlifyMiddleware ,
77 detectLocaleFromAcceptLanguageHeader ,
88 getDetectorLocale ,
99 useTranslation
@@ -23,8 +23,8 @@ test('detectLocaleFromAcceptLanguageHeader', () => {
2323 expect ( detectLocaleFromAcceptLanguageHeader ( eventMock ) ) . toBe ( 'en-US' )
2424} )
2525
26- test ( 'defineI18nMiddleware ' , ( ) => {
27- const middleware = defineI18nMiddleware ( {
26+ test ( 'defineIntlifyMiddleware ' , ( ) => {
27+ const middleware = defineIntlifyMiddleware ( {
2828 locale : detectLocaleFromAcceptLanguageHeader ,
2929 messages : {
3030 en : {
@@ -62,14 +62,14 @@ describe('useTranslation', () => {
6262 }
6363 } ,
6464 context : {
65- [ SYMBOL_I18N ] : context as CoreContext
65+ [ SYMBOL_INTLIFY ] : context as CoreContext
6666 }
6767 } as H3Event
6868 const locale = context . locale as unknown
6969 const bindLocaleDetector = ( locale as LocaleDetector ) . bind ( null , eventMock )
7070 // @ts -ignore ignore type error because this is test
7171 context . locale = bindLocaleDetector
72- eventMock . context [ SYMBOL_I18N_LOCALE ] = bindLocaleDetector
72+ eventMock . context [ SYMBOL_INTLIFY_LOCALE ] = bindLocaleDetector
7373
7474 // test `useTranslation`
7575 const t = await useTranslation ( eventMock )
@@ -101,14 +101,14 @@ test('getDetectorLocale', async () => {
101101 }
102102 } ,
103103 context : {
104- [ SYMBOL_I18N ] : context as CoreContext
104+ [ SYMBOL_INTLIFY ] : context as CoreContext
105105 }
106106 } as H3Event
107107 const _locale = context . locale as unknown
108108 const bindLocaleDetector = ( _locale as LocaleDetector ) . bind ( null , eventMock )
109109 // @ts -ignore ignore type error because this is test
110110 context . locale = bindLocaleDetector
111- eventMock . context [ SYMBOL_I18N_LOCALE ] = bindLocaleDetector
111+ eventMock . context [ SYMBOL_INTLIFY_LOCALE ] = bindLocaleDetector
112112
113113 const locale = await getDetectorLocale ( eventMock )
114114 expect ( locale . language ) . toEqual ( 'ja' )
0 commit comments