{"id":13444976,"url":"https://github.com/intlify/nuxt3","last_synced_at":"2025-04-05T16:05:07.909Z","repository":{"id":39753476,"uuid":"405430182","full_name":"intlify/nuxt3","owner":"intlify","description":"Nuxt 3 Module for vue-i18n-next","archived":false,"fork":false,"pushed_at":"2023-01-23T14:10:22.000Z","size":1427,"stargazers_count":202,"open_issues_count":43,"forks_count":18,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-29T15:04:33.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/intlify.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":"kazupon","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"issuehunt":null,"custom":null}},"created_at":"2021-09-11T16:38:50.000Z","updated_at":"2024-10-17T06:55:33.000Z","dependencies_parsed_at":"2023-02-12T23:45:40.416Z","dependency_job_id":null,"html_url":"https://github.com/intlify/nuxt3","commit_stats":null,"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intlify%2Fnuxt3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intlify%2Fnuxt3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intlify%2Fnuxt3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/intlify%2Fnuxt3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/intlify","download_url":"https://codeload.github.com/intlify/nuxt3/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247361617,"owners_count":20926642,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T04:00:41.378Z","updated_at":"2025-04-05T16:05:07.873Z","avatar_url":"https://github.com/intlify.png","language":"TypeScript","funding_links":["https://github.com/sponsors/kazupon"],"categories":["Notes","TypeScript","Features"],"sub_categories":["Localization"],"readme":"# @intlify/nuxt3\n\nNuxt3 module for vue-i18n-next\n\n## ** ⚠️ IMPORTANT**\n\n**This project is maintenance mode, because I'm forcusing [@nuxtjs/i18n](https://v8.i18n.nuxtjs.org/). We would recommend to use it**\n\n## ❓ What is defference from `@nuxtjs/i18n` ?\n\nThis nuxt module is intended to be a quick and easy way for people to use vue-i18n-next with Nuxt3.\n\nIt also has the purpose of finding issues on the vue-i18n-next so that `@nuxtjs/i18n` can support Nuxt3.\n\n- Setup `vue-i18n` for your Nuxt3 project\n  - You do not need to entrypoint codes with `createI18n`.\n- Setup bundle tools\n  - `@intlify/vue-i18n-loader` and `@intlify/vite-plugin-vue-i18n` are included\n- Locale resources importing\n\n## 💿 Installation\n\nFirst install\n\n```sh\n# for npm\nnpm install --save-dev @intlify/nuxt3\n\n# for yarn\nyarn add -D @intlify/nuxt3\n```\n\nAfter the installation in the previous section, you need to add `@intlify/nuxt3` module to `modules` options of `nuxt.confg.[ts|js]`\n\n```js\n// nuxt.config.js\nexport default {\n  // ...\n  modules: ['@intlify/nuxt3']\n  // ...\n}\n```\n\n## 🔧 Configurations\n\nYou can set the following types in nuxt.config with below options:\n\n```ts\nexport interface IntlifyModuleOptions {\n  /**\n   * Options specified for `createI18n` in vue-i18n.\n   *\n   * If you want to specify not only objects but also functions such as messages functions and modifiers for the option, specify the path where the option is defined.\n   * The path should be relative to the Nuxt project.\n   */\n  vueI18n?: I18nOptions | string\n  /**\n   * Define the directory where your locale messages files will be placed.\n   *\n   * If you don't specify this option, default value is `locales`\n   */\n  localeDir?: string\n}\n```\n\nThe above options can be specified in the `intlify` config of nuxt.config\n\nnuxt.config below:\n\n```js\nexport default {\n  // ...\n  modules: ['@intlify/nuxt3'],\n  // config for `@intlify/nuxt3`\n  intlify: {\n    vueI18n: {\n      // You can setting same `createI18n` options here !\n      locale: 'en',\n      messages: {\n        en: {\n          hello: 'Hello'\n        },\n        ja: {\n          hello: 'こんにちは'\n        }\n      }\n    }\n  }\n}\n```\n\nIf you specify the path to `intlify.vueI18n`, you need to set it to a file in `mjs` format.\n\nThe following ˋnuxt.config`:\n\n```js\nexport default {\n  // ...\n  modules: ['@intlify/nuxt3'],\n  // config for `@intlify/nuxt3`\n  intlify: {\n    vueI18n: 'vue-i18n.mjs'\n  }\n}\n```\n\n`vue-i18n.mjs` as follows:\n\n```js\n// The configuration must be returned with an **async function**.\nexport default async () =\u003e ({\n  locale: 'en',\n  messages: {\n    en: {\n      hello: ({ named }) =\u003e `HELLO, ${named('name')}!`\n    },\n    ja: {\n      hello: 'こんにちは、{name}!'\n    }\n  }\n})\n```\n\n## 📁 Locale resources importing\n\nYou can load the locale resources stored in the file from the directory specified in `intlify.localeDir`.\n\nThe following is an example of the nuxt.conf:\n\n```js\nexport default {\n  // ...\n  modules: ['@intlify/nuxt3'],\n  // config for `@intlify/nuxt3`\n  intlify: {\n    localeDir: 'locales', // set the `locales` directory at source directory of your Nuxt application\n    vueI18n: {\n      // ...\n    }\n  }\n}\n```\n\nThe following is a set of files of locale resources defined in the directory:\n\n```sh\n-| app/\n---| nuxt.config.js\n---| package.json\n---| locales/\n------| en.json/\n------| ja.json/\n```\n\nThe locale messages defined above will be loaded by the `@intlify/nuxt3` module and set to the `messages` option of `createI18n` on the module side.\n\nEach locale in the `messages` option is used as a file name without its extension. For example, In the `locales` directory above, `en.json` will use `en` as the locale.\n\n## ©️ LICENSE\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintlify%2Fnuxt3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fintlify%2Fnuxt3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fintlify%2Fnuxt3/lists"}