Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: move to @nuxtjs/i18n #221

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/content/en/guide/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ Add `@nuxtjs/sitemap` to the `modules` section of your `nuxt.config.js` file:
```

> **notice:**
> If you use other modules (eg. `nuxt-i18n`), always declare the sitemap module at end of array
> eg. `modules: ['nuxt-i18n', '@nuxtjs/sitemap']`
> If you use other modules (eg. `@nuxtjs/i18n`), always declare the sitemap module at end of array
> eg. `modules: ['@nuxtjs/i18n', '@nuxtjs/sitemap']`
2 changes: 1 addition & 1 deletion docs/content/en/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ features:
- Module based on the awesome sitemap.js package ❤️
- Create sitemap or sitemap index
- Automatically add the static routes to each sitemap
- Support i18n routes from nuxt-i18n (latest version)
- Support i18n routes from `@nuxtjs/i18n` (latest version)
- Works with all modes (SSR, SPA, generate)
- For Nuxt 2.x and higher
---
Expand Down
6 changes: 3 additions & 3 deletions docs/content/en/usage/sitemap-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Add a trailing slash to each route URL (eg. `/page/1` => `/page/1/`)

- Default: `undefined`

Configure the support of localized routes from **[nuxt-i18n](https://i18n.nuxtjs.org/)** module.
Configure the support of localized routes from **[@nuxtjs/i18n](https://i18n.nuxtjs.org/)** module.

If the `i18n` option is configured, the sitemap module will automatically add the default locale URL of each page in a `<loc>` element, with child `<xhtml:link>` entries listing every language/locale variant of the page including itself (see [Google sitemap guidelines](https://support.google.com/webmasters/answer/189077)).

Expand All @@ -145,7 +145,7 @@ Example:
```js[nuxt.config.js]
{
modules: [
'nuxt-i18n',
'@nuxtjs/i18n',
'@nuxtjs/sitemap'
],
i18n: {
Expand All @@ -156,7 +156,7 @@ Example:
hostname: 'https://example.com',
// shortcut notation (basic)
i18n: true,
// nuxt-i18n notation (advanced)
// @nuxtjs/i18n notation (advanced)
i18n: {
locales: ['en', 'es', 'fr'],
routesNameSeparator: '___'
Expand Down
4 changes: 2 additions & 2 deletions docs/content/fr/guide/setup.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ Ajouter `@nuxtjs/sitemap` dans la section `modules` de votre fichier `nuxt.confi
```

> **Remarque:**
> Si vous utilisez d'autres modules (eg. `nuxt-i18n`), déclarez toujours le module sitemap à la fin du tableau
> ex: `modules: ['nuxt-i18n', '@nuxtjs/sitemap']`
> Si vous utilisez d'autres modules (eg. `@nuxtjs/i18n`), déclarez toujours le module sitemap à la fin du tableau
> ex: `modules: ['@nuxtjs/i18n', '@nuxtjs/sitemap']`
2 changes: 1 addition & 1 deletion docs/content/fr/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ features:
- Module basé sur le package génial sitemap.js ❤️
- Créer un plan de site ou un index de plan de site
- Ajoutez automatiquement les itinéraires statiques à chaque plan de site
- Prise en charge des routes i18n depuis nuxt-i18n (dernière version)
- Prise en charge des routes i18n depuis `@nuxtjs/i18n` (dernière version)
- Fonctionne avec tous les modes (SSR, SPA, generate)
- Pour Nuxt 2.x et plus
---
Expand Down
6 changes: 3 additions & 3 deletions docs/content/fr/usage/sitemap-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Ajouter une barre oblique à chaque URL de route (ex. `/page/1` => `/page/1/`)

- Défaut: `undefined`

Configurer la prise en charge des routes localisées à partir du module **[nuxt-i18n](https://i18n.nuxtjs.org/)**
Configurer la prise en charge des routes localisées à partir du module **[@nuxtjs/i18n](https://i18n.nuxtjs.org/)**

Si l'option `i18n` est configurée, le module de plan de site ajoutera automatiquement l'URL de la locale par défaut de chaque page dans un élément `<loc>`, avec des entrées enfants `<xhtml:link>` listant toutes les variantes de langue/locale de la page y compris elle-même (voir les [Consignes relatives au plan du site Google](https://support.google.com/webmasters/answer/189077)).

Expand All @@ -145,7 +145,7 @@ Exemple:
```js[nuxt.config.js]
{
modules: [
'nuxt-i18n',
'@nuxtjs/i18n',
'@nuxtjs/sitemap'
],
i18n: {
Expand All @@ -156,7 +156,7 @@ Exemple:
hostname: 'https://example.com',
// shortcut notation (basic)
i18n: true,
// nuxt-i18n notation (advanced)
// @nuxtjs/i18n notation (advanced)
i18n: {
locales: ['en', 'es', 'fr'],
routesNameSeparator: '___'
Expand Down
4 changes: 2 additions & 2 deletions lib/options.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ function setDefaultSitemapOptions(options, nuxtInstance, isLinkedToSitemapIndex
// Check modules config
const modules = Object.keys(nuxtInstance.requiredModules)
/* istanbul ignore if */
if (modules.indexOf('nuxt-i18n') > modules.indexOf(MODULE_NAME)) {
if (modules.indexOf('@nuxtjs/i18n') > modules.indexOf(MODULE_NAME)) {
logger.warn(
`To enable the "i18n" option, the "${MODULE_NAME}" must be declared after the "nuxt-i18n" module in your config`
`To enable the "i18n" option, the "${MODULE_NAME}" must be declared after the "@nuxtjs/i18n" module in your config`
)
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"lint-staged": "latest",
"node-fetch": "latest",
"nuxt": "latest",
"nuxt-i18n": "latest",
"@nuxtjs/i18n": "latest",
"prettier": "latest",
"standard-version": "latest"
},
Expand Down
2 changes: 1 addition & 1 deletion test/module.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ describe('sitemap - advanced configuration', () => {
})

describe('i18n options', () => {
const modules = [require('nuxt-i18n'), require('..')]
const modules = [require('@nuxtjs/i18n'), require('..')]

const nuxtI18nConfig = {
locales: ['en', 'fr'],
Expand Down
Loading