Skip to content

Commit

Permalink
docs: improve extend messages hooking (nuxt-modules#1870)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazupon authored Feb 18, 2023
1 parent 2f4c4b6 commit f78cf83
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions docs/content/2.guide/13.extend-messages.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,23 @@ export default defineNuxtModule({

Now the project has access to new messages and can use them through `$t('my-module-exemple.hello')`.

::alert{type="info"}

The custom module that is use `i18n:extend-messages` hook should be inserted before nuxt i18n module.

```ts {}[nuxt.config.ts]
import CustomModule from './custom' // import your custom module
export default defineNuxtConfig({
modules: [
CustomModule,
'@nuxtjs/i18n',
],
})
```

::

::alert

Because module's messages are merged with the project's ones, it's safer to prefix them.
Expand Down

0 comments on commit f78cf83

Please sign in to comment.