Skip to content

Commit

Permalink
fix: put deprecation warning if hook in use (#2093)
Browse files Browse the repository at this point in the history
* docs: mention callbacks

* fix: put deprecation warning if hook in use
  • Loading branch information
ineshbose committed May 21, 2023
1 parent b79c689 commit a314697
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,14 @@ export default defineNuxtModule<NuxtI18nOptions>({
*/

// TODO: remove `i18n:extend-messages` before v8 official release
logger.warn(
'`i18n:extend-messages` is deprecated. ' +
'That hook will be removed feature at the time of the v8 official release.\n' +
"If you're using it, please use `i18n:registerModule` instead."
)
// @ts-ignore Property '_hooks' is private and only accessible within class 'Hookable<HooksT, HookNameT>'
if ('i18n:extend-messages' in nuxt.hooks._hooks) {
logger.warn(
'`i18n:extend-messages` is deprecated. ' +
'That hook will be removed feature at the time of the v8 official release.\n' +
"If you're using it, please use `i18n:registerModule` instead."
)
}
const additionalMessages = await extendMessages(nuxt, localeCodes, options)

/**
Expand Down

0 comments on commit a314697

Please sign in to comment.