1
1
import {
2
- createCompileError ,
3
- CORE_ERROR_CODES_EXTEND_POINT
2
+ CORE_ERROR_CODES_EXTEND_POINT ,
3
+ createCompileError
4
4
} from '@intlify/core-base'
5
5
6
6
import type { BaseError } from '@intlify/shared'
@@ -26,7 +26,9 @@ export const I18nErrorCodes = {
26
26
// not compatible legacy vue-i18n constructor
27
27
NOT_COMPATIBLE_LEGACY_VUE_I18N : 33 ,
28
28
// Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly
29
- NOT_AVAILABLE_COMPOSITION_IN_LEGACY : 34
29
+ NOT_AVAILABLE_COMPOSITION_IN_LEGACY : 34 ,
30
+ // duplicate `useI18n` calling
31
+ DUPLICATE_USE_I18N_CALLING : 35
30
32
} as const
31
33
32
34
type I18nErrorCodes = ( typeof I18nErrorCodes ) [ keyof typeof I18nErrorCodes ]
@@ -57,5 +59,7 @@ export const errorMessages: { [code: number]: string } = {
57
59
[ I18nErrorCodes . NOT_COMPATIBLE_LEGACY_VUE_I18N ] :
58
60
'Not compatible legacy VueI18n.' ,
59
61
[ I18nErrorCodes . NOT_AVAILABLE_COMPOSITION_IN_LEGACY ] :
60
- 'Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly'
62
+ 'Not available Compostion API in Legacy API mode. Please make sure that the legacy API mode is working properly' ,
63
+ [ I18nErrorCodes . DUPLICATE_USE_I18N_CALLING ] :
64
+ "Duplicate `useI18n` calling by local scope. Please don't call it on local scope"
61
65
}
0 commit comments