diff --git a/README.md b/README.md index 157f04ab8..996332bcc 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ If you would like to use the stable version for Nuxt 2, please see the [`main` b ### Install with `next` tag -1. Add the following line to the `devDependencies` wiht package manager: +1. Add the following line to the `devDependencies` with your package manager: ```sh # Using npm @@ -55,7 +55,7 @@ pnpm install --shamefully-hoist -D @nuxtjs/i18n@next 2. Run `npm install` or `yarn` or `pnpm install --shamefully-hoist`. -3. Add `@nuxtjs/i18n` to the `modules` section of `nuxt.config.ts` +3. Add `@nuxtjs/i18n` to the `modules` section of `nuxt.config.ts`. ```ts { @@ -69,7 +69,7 @@ pnpm install --shamefully-hoist -D @nuxtjs/i18n@next [Read more v8 documentation](https://v8.i18n.nuxtjs.org/). -Keep in mind that not all features are supported yet and some things might be broken. +Keep in mind that not all features are currently supported yet and some things might be broken. ## 🔗 Links - 📘 [Documentation for v8](https://v8.i18n.nuxtjs.org/) diff --git a/docs/content/1.getting-started/1.setup.md b/docs/content/1.getting-started/1.setup.md index ab67f20dc..6dc716109 100644 --- a/docs/content/1.getting-started/1.setup.md +++ b/docs/content/1.getting-started/1.setup.md @@ -3,13 +3,13 @@ ::alert{type="warning"} ❗IMPORTANT -- From this section, this documentation is for Nuxt i18n module (`@nuxtjs/i18n`) v8 beta. if you would like to use v7.x, see the [here](https://i18n.nuxtjs.org/) +- From this section, this documentation is for Nuxt i18n module (`@nuxtjs/i18n`) v8 beta. If you would like to use v7.x, see [here](https://i18n.nuxtjs.org/). -- Nuxt i18n module next is still v8 **beta**, the API might subject to breaking changes. We will make every effort to have the same I/F as v7.x, but Nuxt 3 is a major release, it might not be the same I/F. +- Nuxt i18n module's next version, **v8**, is in beta and still undergoing development. Its API may be subject to changes that could cause compatibility issues. Although the development team will try to maintain the same interface as version 7.x, the upcoming major release of Nuxt 3 may introduce changes that could affect the interface. :: ::alert{type="info"} -Check the [Nuxt.js documentation](https://nuxt.com/docs/guide/concepts/modules) for more information about installing and using modules in Nuxt.js. +Check the [Nuxt documentation](https://nuxt.com/docs/guide/concepts/modules) for more information about installing and using modules in Nuxt. :: Add `@nuxtjs/i18n` dependency to your project: @@ -28,9 +28,9 @@ pnpm add @nuxtjs/i18n@next --save-dev ``` :: -Then, add `@nuxtjs/i18n` to the `modules` section in your `nuxt.config.js`. You can use either of the following ways to specify the module options: +Then, add `@nuxtjs/i18n` to the `modules` section in your `nuxt.config`. You can use either of the following ways to specify the module options: -```js {}[nuxt.config.js] +```ts {}[nuxt.config.ts] export default defineNuxtConfig({ modules: [ '@nuxtjs/i18n', @@ -43,7 +43,7 @@ export default defineNuxtConfig({ or -```js {}[nuxt.config.js] +```ts {}[nuxt.config.ts] export default defineNuxtConfig({ modules: [ [ diff --git a/docs/content/1.getting-started/2.basic-usage.md b/docs/content/1.getting-started/2.basic-usage.md index d8740dba5..568534631 100644 --- a/docs/content/1.getting-started/2.basic-usage.md +++ b/docs/content/1.getting-started/2.basic-usage.md @@ -1,6 +1,6 @@ # Basic Usage -The basic to get started with Nuxt i18n module is to translate with Vue I18n via the `vueI18n` option. +The basics to get started with the Nuxt i18n module is to translate with Vue I18n via the `vueI18n` option. --- @@ -8,9 +8,9 @@ The basic to get started with Nuxt i18n module is to translate with Vue I18n via The basic to get started with **Nuxt i18n module** is to **translate with Vue I18n via the `vueI18n` option** -So, let's get started configuring the following nuxt config: +So, let's get started configuring the following `nuxt.config`: -```js {}[nuxt.config.js] +```ts {}[nuxt.config.ts] export default defineNuxtConfig({ modules: [ '@nuxtjs/i18n' @@ -33,9 +33,9 @@ export default defineNuxtConfig({ }) ``` -`vueI18n` option is the same as `createI18n` function option of Vue I18n. `vueI18n` option is passed to the `createI18n` function via the nuxt plugin of this module internally. +The `vueI18n` option is the same as `createI18n` function option of Vue I18n. `vueI18n` option is passed to the `createI18n` function via the nuxt plugin of this module internally. -About detail of `vueI18n` option, see the [Vue I18n documentation](https://vue-i18n.intlify.dev/api/general.html#createi18n) +For more details about the `vueI18n` option, see the [Vue I18n documentation](https://vue-i18n.intlify.dev/api/general.html#createi18n). Now, put (or edit) the following the page component in `pages` directory of you project: @@ -65,7 +65,7 @@ The code demonstrated in this chapter is illustrated using Nuxt [Pages](https:// ::alert{type="info"} -Some composable functions provided by @nuxtjs/i18n such as `useI18n` are [auto-imported by Nuxt](https://nuxt.com/docs/guide/concepts/auto-imports#auto-imports) +Some composable functions provided by @nuxtjs/i18n such as `useI18n` are [auto-imported by Nuxt](https://nuxt.com/docs/guide/concepts/auto-imports#auto-imports). If you want to import them explicitly, you can use `#imports` as follows: @@ -73,39 +73,36 @@ If you want to import them explicitly, you can use `#imports` as follows: ```vue ``` :: -You have a really simple Vue I18n based translation environment ready to go. You run the above page component in your project, you can see the form that has English or French in select. so you will select a language, you can see the "welcome" in the each language. +You now have a really simple Vue I18n based translation environment ready to go! The `
` element that contains both English and French options, choosing either languages from the dropdown, you can see the word "welcome" change in its corresponding language. -you are now ready to localize your application using Vue I18n. Vue I18n also provides several other features. -For more information on Vue I18n, refer to the [docs](https://vue-i18n.intlify.dev/) +For more information about **Vue I18n**, you can refer to its documentation [here](https://vue-i18n.intlify.dev/). ## Link localizing -**Nuxt i18n module** extends the integrated Vue I18n to give us some i18n features for Nuxt application. In here, we introduce one of those features, the link localization with extending Nuxt pages and routing. +The **Nuxt i18n module** extends the integrated Vue I18n to give us some i18n features for Nuxt application. In here, we introduce one of those features, the link localization with extending Nuxt pages and routing. ### Configurations -You will need to additionally set the `defaultLocale` and `locales` options, as in the following configuration. +You'll need to additionally set the `defaultLocale` and `locales` options, as in the following configuration. -In the link localizing, using the codes provided in the `locales` option as the URL path prefix, except for the `defaultLocale` (read more on [routing](/guide/routing-strategies)). +For localizing links, you can use the code provided from the `locales` option as the URL path prefix, except for `defaultLocale` (read more on [routing](/guide/routing-strategies)). -```diff {}[nuxt.config.js] +```diff {}[nuxt.config.ts] export default defineNuxtConfig({ modules: [ '@nuxtjs/i18n' ], - i18n: { -+ locales: ['en', 'fr'], // used in URL path prefix -+ defaultLocale: 'en', // default locale of your project for Nuxt pages and routings ++ locales: ['en', 'fr'], // used in URL path prefix ++ defaultLocale: 'en', // default locale of your project for Nuxt pages and routings vueI18n: { legacy: false, locale: 'en', @@ -122,15 +119,13 @@ In the link localizing, using the codes provided in the `locales` option as the }) ``` -When rendering internal links in your app using ``, you need to get proper URLs for the current locale. To do this, **Nuxt i18n module** provides some helper composables: +When rendering internal links in your app using ``, you need to get proper URLs for the current locale. To do this, the **Nuxt i18n module** provides some helper composables: ### URL path You can localize URL path with using `useLocalePath`. -`useLocalePath` is a composable function. Calling that composable function returns a function that is able to return the localized URL for a given page. - -The first parameter can be either the path or name of the route or an object for more complex routes. A locale code can be passed as the second parameter to generate a link for a specific language: +`useLocalePath` is a composable which returns a function used to get the localized URL for a given page. The first parameter can be either the path or name of the route or an object for more complex routes. A locale code can be passed as the second parameter to generate a link for a specific language: ```vue