{"_id":"@amdglobal/astro-i18next","_rev":"7-b5f4d3f211a4d283faf9dbf387f8b90c","name":"@amdglobal/astro-i18next","dist-tags":{"latest":"1.0.0-beta.1","beta":"1.0.0-beta.2"},"versions":{"1.0.0-beta.1":{"name":"@amdglobal/astro-i18next","version":"1.0.0-beta.1","keywords":["astro-component","astro-integration","seo","i18next","i18n","internationalization","i10n","localization"],"author":{"url":"https://yassinedoghri.com/","name":"Yassine Doghri","email":"yassine@doghri.fr"},"license":"MIT","_id":"@amdglobal/astro-i18next@1.0.0-beta.1","maintainers":[{"name":"fauxsoup","email":"fauxsoup@gmail.com"}],"homepage":"https://astro-i18next.yassinedoghri.com/","bugs":{"url":"https://github.com/yassinedoghri/astro-i18next/issues"},"bin":{"astro-i18next":"dist/cli/index.js"},"dist":{"shasum":"f7af5f0dd060912cf1129527596cd89b23c6f970","tarball":"https://registry.npmjs.org/@amdglobal/astro-i18next/-/astro-i18next-1.0.0-beta.1.tgz","fileCount":39,"integrity":"sha512-v4HJWWj5edBTKOdf+nLDlkFQ2gfKJgfLvmKQrF30d3Awy3bxb+mbwMf+QXWX3S+/iM8/Qt9A6ggFGD3IdpZTnA==","signatures":[{"sig":"MEUCIQDvEnUvyaoK8t93kVW5wqYkTLTXwzL88mLLU/Biq7MXUwIgLTmgdMYm8iQTO0pVsgRvc6WpkvZ5nKUQz+32BS7whuQ=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":144834},"main":"./dist/index.js","type":"module","_from":"file:amdglobal-astro-i18next-1.0.0-beta.1.tgz","types":"./dist/types/index.d.ts","config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"exports":{".":"./dist/index.js","./components":"./src/components/index.ts"},"scripts":{"lint":"eslint --ext js,cjs,ts .","pack":"pnpm run build && pnpm pack","test":"vitest","build":"tsc && pnpm run typecheck:emit","commit":"cz","preview":"astro preview","prettier":"prettier --check --ignore-path .prettierignore .","typecheck":"tsc --noEmit","prettier:fix":"prettier --write --ignore-path .prettierignore .","test:coverage":"pnpm test -- --coverage","typecheck:emit":"tsc --declaration --emitDeclarationOnly --outDir dist/types","semantic-release":"semantic-release"},"_npmUser":{"name":"fauxsoup","email":"fauxsoup@gmail.com"},"_resolved":"/tmp/71e70d14477781bc7e9fad5247ae0bbe/amdglobal-astro-i18next-1.0.0-beta.1.tgz","_integrity":"sha512-v4HJWWj5edBTKOdf+nLDlkFQ2gfKJgfLvmKQrF30d3Awy3bxb+mbwMf+QXWX3S+/iM8/Qt9A6ggFGD3IdpZTnA==","repository":{"url":"git+https://github.com/amdglobal/astro-i18next.git","type":"git"},"_npmVersion":"9.6.6","description":"An astro integration of i18next + some utility components to help you translate your astro websites!","directories":{},"lint-staged":{"*.{js,cjs,ts}":"eslint --ext js,cjs,ts . --cache --fix","*.{js,cjs,ts,astro,css,md}":"prettier --write --ignore-path .prettierignore ."},"_nodeVersion":"20.2.0","dependencies":{"pathe":"^1.1.0","i18next":"^22.4.10","iso-639-1":"^2.1.15","locale-emoji":"^0.3.0","@proload/core":"^0.3.3","i18next-fs-backend":"^2.1.1","@proload/plugin-tsm":"^0.2.1","i18next-http-backend":"^2.1.1","i18next-browser-languagedetector":"^7.0.1"},"publishConfig":{"access":"public"},"typesVersions":{"*":{"index":["./dist/types/index.d.ts"],"components":["./src/components/index.d.ts"]}},"_hasShrinkwrap":false,"devDependencies":{"fdir":"^6.0.1","astro":"2.0.17","husky":"^8.0.3","is-ci":"^3.0.1","yargs":"^17.7.1","eslint":"^8.35.0","vitest":"^0.29.2","esbuild":"^0.17.11","i18next":"^22.4.10","fs-extra":"^11.1.0","prettier":"2.8.4","commitizen":"^4.3.0","typescript":"^4.9.5","lint-staged":"^13.1.2","@types/yargs":"^17.0.22","@commitlint/cli":"^17.4.4","@types/fs-extra":"^11.0.1","eslint-plugin-n":"^15.6.1","semantic-release":"^20.1.1","eslint-plugin-jest":"^27.2.1","@vitest/coverage-c8":"^0.29.2","all-contributors-cli":"^6.24.0","eslint-plugin-import":"^2.27.5","@semantic-release/git":"^10.0.1","eslint-plugin-promise":"^6.1.1","prettier-plugin-astro":"^0.8.0","@semantic-release/exec":"^6.0.3","esbuild-plugin-fileloc":"^0.0.6","eslint-config-prettier":"^8.6.0","eslint-config-standard":"^17.0.0","eslint-plugin-prettier":"^4.2.1","@typescript-eslint/parser":"^5.54.0","cz-conventional-changelog":"^3.3.0","@semantic-release/changelog":"^6.0.2","@commitlint/config-conventional":"^17.4.4","@typescript-eslint/eslint-plugin":"^5.54.0"},"peerDependencies":{"astro":">=2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/astro-i18next_1.0.0-beta.1_1692856004455_0.22171496236198696","host":"s3://npm-registry-packages"}},"1.0.0-beta.2":{"name":"@amdglobal/astro-i18next","version":"1.0.0-beta.2","keywords":["astro-component","astro-integration","seo","i18next","i18n","internationalization","i10n","localization"],"author":{"url":"https://yassinedoghri.com/","name":"Yassine Doghri","email":"yassine@doghri.fr"},"license":"MIT","_id":"@amdglobal/astro-i18next@1.0.0-beta.2","maintainers":[{"name":"fauxsoup","email":"fauxsoup@gmail.com"}],"homepage":"https://astro-i18next.yassinedoghri.com/","bugs":{"url":"https://github.com/yassinedoghri/astro-i18next/issues"},"bin":{"astro-i18next":"dist/cli/index.js"},"dist":{"shasum":"f6e69d478d3a2c1aedbfaade7b6547ddba705432","tarball":"https://registry.npmjs.org/@amdglobal/astro-i18next/-/astro-i18next-1.0.0-beta.2.tgz","fileCount":38,"integrity":"sha512-o1JRSIc9g5hLLsVjCQ441kLn7e1Ag66yePhtBf9PGZRK5lPEoP8QkSOjVYPxT4Kw7INlQC/YTUlg8gox5i2BzA==","signatures":[{"sig":"MEYCIQD2+extmwdz2qBbKYGUdlk3GFJZRGbRkIIE+gR8eC1uEgIhAKuPZLKb3sYkQo7HYoVM5KeiJ5cVqzlsPO/VSpKUoNYC","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":134730},"main":"./dist/index.js","type":"module","types":"./dist/types/index.d.ts","config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"readme":"<div align=\"center\">\n\n# 🧪 astro-i18next <!-- omit in toc -->\n\nAn [astro](https://astro.build/) integration of\n[i18next](https://www.i18next.com/) + some utility components to help you\ntranslate your astro websites!\n\n</div>\n\n<div align=\"center\">\n\n[![npm-badge]][npm]&nbsp;[![build-badge]][build]&nbsp;[![codecov-badge]][codecov]&nbsp;[![license-badge]][license]&nbsp;[![contributions-badge]][contributions]&nbsp;[![semantic-release-badge]][semantic-release]&nbsp;[![stars-badge]][stars]\n\n</div>\n\n> **Note**\n>\n> Status - 🚧 **Beta**\n>\n> [👉 **Road to v1.0.0**](https://github.com/yassinedoghri/astro-i18next/issues/19)\n>\n> You can use it, and feedback is more than welcome! Note that some breaking\n> changes may still be introduced during this phase as the goal for v1 is to get\n> the best possible DX for translating your Astro pages.\n\n## Examples\n\n| Example                               | Status                                                                                               |\n| ------------------------------------- | ---------------------------------------------------------------------------------------------------- |\n| [SSG - **Basics**](examples/basics)   | [![example-up-badge]](examples/basics)                                                               |\n| [SSR - **Node**](examples/node)       | [![example-up-badge]](examples/node)                                                                 |\n| [**React**](examples/react)           | [![example-up-badge]](examples/react)                                                                |\n| [SSR - **Netlify**](examples/netlify) | [![example-down-badge]](examples/netlify) (https://github.com/yassinedoghri/astro-i18next/issues/26) |\n| SSR - **Deno**                        | [![example-down-badge]](examples/basics) (https://github.com/yassinedoghri/astro-i18next/issues/55)  |\n\n- [Examples](#examples)\n- [🚀 Getting started](#-getting-started)\n  - [1. Install](#1-install)\n  - [2. Configure](#2-configure)\n  - [3. Start translating](#3-start-translating)\n- [💻 CLI commands](#-cli-commands)\n  - [generate](#generate)\n- [🔄 Translate Routes](#-translate-routes)\n- [📦 Utility components](#-utility-components)\n  - [Trans component](#trans-component)\n  - [LanguageSelector component](#languageselector-component)\n  - [HeadHrefLangs component](#headhreflangs-component)\n- [📦 Utility functions](#-utility-functions)\n  - [interpolate function](#interpolate-function)\n  - [localizePath function](#localizepath-function)\n  - [localizeUrl function](#localizeurl-function)\n- [👀 Going further](#-going-further)\n  - [Namespaces](#namespaces)\n  - [AstroI18nextConfig Props](#astroi18nextconfig-props)\n- [✨ Contributors](#-contributors)\n- [❤️ Acknowledgments](#️-acknowledgments)\n- [📜 License](#-license)\n\n## 🚀 Getting started\n\n### 1. Install\n\n```bash\nnpm install astro-i18next\n```\n\nor\n\n```bash\npnpm add astro-i18next\n```\n\nor\n\n```bash\nyarn add astro-i18next\n```\n\n### 2. Configure\n\n1. Add `astro-i18next` to your `astro.config.mjs`:\n\n   ```js\n   import { defineConfig } from \"astro/config\";\n   import astroI18next from \"astro-i18next\";\n\n   export default defineConfig({\n     integrations: [astroI18next()],\n   });\n   ```\n\n2. Configure `astro-i18next` in your `astro-i18next.config.mjs` file:\n\n   ```js\n   /** @type {import('astro-i18next').AstroI18nextConfig} */\n   export default {\n     defaultLocale: \"en\",\n     locales: [\"en\", \"fr\"],\n   };\n   ```\n\n   ℹ️ Your `astro-i18next` config file can be a javascript (`.js` | `.mjs` |\n   `.cjs`) or typescript (`.ts` | `.mts` | `.cts`) file.\n\n   ℹ️ For a more advanced configuration, see the\n   [AstroI18nextConfig props](#astroi18nextconfig-props).\n\n3. By default, `astro-i18next` expects your translations to be organized inside\n   your\n   [astro's `publicDir`](https://docs.astro.build/en/reference/configuration-reference/#publicdir),\n   in a `locales` folder:\n\n   ```bash\n     public\n     └── locales  # create this folder to store your translation strings\n         ├── en\n         |   └── translation.json\n         └── fr\n             └── translation.json\n   ```\n\n   ℹ️ `astro-i18next` loads your translation files both server-side and\n   client-side using\n   [i18next-fs-backend](https://github.com/i18next/i18next-fs-backend) and\n   [i18next-http-backend](https://github.com/i18next/i18next-http-backend)\n   plugins.\n\n   ℹ️ You may choose to organize your translations into multiple files instead\n   of a single file per locale [using namespaces](#namespaces).\n\n### 3. Start translating\n\nYou may now start translating your pages by using\n[i18next's `t` function](https://www.i18next.com/overview/api#t) or the\n[Trans component](#trans-component) depending on your needs.\n\nHere's a quick tutorial to get you going:\n\n1. Use translation keys in your Astro pages\n\n   ```astro\n   ---\n   // src/pages/index.astro\n   import i18next, { t } from \"i18next\";\n   import { Trans, HeadHrefLangs } from \"astro-i18next/components\";\n   ---\n\n   <html lang={i18next.language}>\n     <head>\n       <meta charset=\"utf-8\" />\n       <meta name=\"viewport\" content=\"width=device-width\" />\n       <title>{t(\"site.title\")}</title>\n       <meta name=\"description\" content={t(\"site.description\")} />\n       <HeadHrefLangs />\n     </head>\n     <body>\n       <h1>{t(\"home.title\")}</h1>\n       <p>\n         <Trans i18nKey=\"home.subtitle\">\n           This is a <em>more complex</em> string to translate, mixed with <strong\n             >html elements\n           </strong> such as <a href=\"https://example.com/\">a cool link</a>!\n         </Trans>\n       </p>\n     </body>\n   </html>\n   ```\n\n   ```json\n   // public/locales/en/translation.json\n   {\n     \"site\": {\n       \"title\": \"My awesome website!\",\n       \"description\": \"Here is the description of my awesome website!\"\n     },\n     \"home\": {\n       \"title\": \"Welcome to my awesome website!\",\n       \"subtitle\": \"This is a <0>more complex</0> string to translate, mixed with <1>html elements</1>, such as a <2>a cool link</2>!\"\n     }\n   }\n   ```\n\n   ```json\n   // public/locales/fr/translation.json\n   {\n     \"site\": {\n       \"title\": \"Mon super site web !\",\n       \"description\": \"Voici la description de mon super site web !\"\n     },\n     \"home\": {\n       \"title\": \"Bienvenue sur mon super site web !\",\n       \"subtitle\": \"Ceci est une chaine de charactères <0>plus compliquée</0> à traduire, il y a des <1>éléments html</1>, comme <2>un super lien</2> par exemple !\"\n     }\n   }\n   ```\n\n2. Create localized pages using the [generate command](#generate)\n\n   ```bash\n   npx astro-i18next generate\n   ```\n\n3. You're all set! Have fun translating and generate localized pages as you go\n   🚀\n\n> **Note**\n>\n> For a real world example, see the [website](./website/) or check out the\n> [examples](./examples/).\n\n---\n\n## 💻 CLI commands\n\n### generate\n\n```bash\nnpx astro-i18next generate\n```\n\nThis command will generate localized pages depending on your config and set\ni18next's language change on each page.\n\nFor instance, with `locales = [\"en\", \"fr\", \"es\"]`, and `\"en\"` being the default\nlocale and having:\n\n```bash\nsrc\n└── pages\n    ├── about.astro\n    └── index.astro\n```\n\n👇 Running `npx astro-i18next generate` will create the following pages\n\n```bash\nsrc\n└── pages\n    ├── es\n    |   ├── about.astro\n    |   └── index.astro\n    ├── fr\n    |   ├── about.astro\n    |   └── index.astro\n    ├── about.astro\n    └── index.astro\n```\n\n## 🔄 Translate Routes\n\n`astro-i18next` let's you translate your pages routes for each locale!\n\nFor instance, with support for 3 locales (`en`, `fr`, `es`), `en` being the\ndefault and the following pages:\n\n```bash\nsrc\n└── pages\n    ├── about.astro\n    ├── contact-us.astro\n    └── index.astro\n```\n\n1. Set route mappings in your `astro-i18next` config:\n\n   ```js\n   /** @type {import('astro-i18next').AstroI18nextConfig} */\n   export default {\n     defaultLocale: \"en\",\n     locales: [\"en\", \"fr\", \"es\"],\n     routes: {\n       fr: {\n         about: \"a-propos\",\n         \"contact-us\": \"contactez-nous\",\n         products: {\n           index: \"produits\",\n           categories: \"categories\",\n         },\n       },\n       es: {\n         about: \"a-proposito\",\n         \"contact-us\": \"contactenos\",\n         products: {\n           index: \"productos\",\n           categories: \"categorias\",\n         },\n       },\n     },\n   };\n   ```\n\n2. Generate your localized pages using the [generate CLI command](#generate),\n   they will be translated for you!\n\n```bash\nsrc\n└── pages\n    ├── es\n    |   ├── productos\n    |   |   ├── categorias.astro\n    |   |   └── index.astro\n    |   ├── a-proposito.astro\n    |   ├── contactenos.astro\n    |   └── index.astro\n    ├── fr\n    |   ├── produits\n    |   |   ├── categories.astro\n    |   |   └── index.astro\n    |   ├── a-propos.astro\n    |   ├── contactez-nous.astro\n    |   └── index.astro\n    ├── products\n    |   ├── categories.astro\n    |   └── index.astro\n    ├── about.astro\n    ├── contact-us.astro\n    └── index.astro\n```\n\n> **Note**\n>\n> The [localizePath](#localizepath-function) and\n> [localizeUrl](#localizeurl-function) utility functions will retrieve the\n> correct route based on your mappings.\n\n---\n\n## 📦 Utility components\n\n### Trans component\n\nA component that takes care of interpolating its children with the translation\nstrings. Inspired by\n[react-i18next's Trans component](https://react.i18next.com/latest/trans-component).\n\n```astro\n---\nimport { Trans } from \"astro-i18next/components\";\n---\n\n<Trans i18nKey=\"superCoolKey\">\n  An <a href=\"https://astro.build\" title=\"Astro website\">astro</a> integration of\n  <a href=\"https://www.i18next.com/\" title=\"i18next website\">i18next</a> and utility\n  components to help you translate your astro websites!\n</Trans>\n```\n\n```json\n// fr.json\n{\n  \"superCoolKey\": \"Une intégration <0>astro</0> d'<1>i18next</1> + quelques composants utilitaires pour vous aider à traduire vos sites astro !\"\n}\n```\n\n#### Trans Props\n\n| Prop name | Type (default)      | Description                                                                                                                                                                                                                            |\n| --------- | ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| i18nKey   | ?string (undefined) | Internationalization key to interpolate to. Can contain the namespace by prepending it in the form 'ns:key' (depending on i18next.options.nsSeparator). If omitted, a key is automatically generated using the content of the element. |\n| ns        | ?string (undefined) | Namespace to use. May also be embedded in i18nKey but not recommended when used in combination with natural language keys.                                                                                                             |\n\n### LanguageSelector component\n\nUnstyled custom select component to choose amongst supported locales.\n\n```astro\n---\nimport { LanguageSelector } from \"astro-i18next/components\";\n---\n\n<LanguageSelector showFlag={true} class=\"my-select-class\" />\n\n<!-- LanguageSelector with custom language naming -->\n<LanguageSelector\n  showFlag={true}\n  languageMapping={{ en: \"Anglais\" }}\n  class=\"my-select-class\"\n/>\n```\n\n#### LanguageSelector Props\n\n| Prop name       | Type (default)        | Description                                                                                 |\n| --------------- | --------------------- | ------------------------------------------------------------------------------------------- |\n| showFlag        | ?boolean (`false`)    | Choose to display the language emoji before language name                                   |\n| languageMapping | ?object (`undefined`) | Rewrite language names by setting the locale as key and the wording of your choice as value |\n\n### HeadHrefLangs component\n\nHTML tags to include in your page's `<head>` section to let search engines know\nabout its language and region variants. To know more, see\n[Google's advanced localized versions](https://developers.google.com/search/docs/advanced/crawling/localized-versions#html).\n\n```astro\n---\nimport i18next from \"i18next\";\nimport { HeadHrefLangs } from \"astro-i18next/components\";\n---\n\n<html lang={i18next.language}>\n  <head>\n    <meta charset=\"utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width\" />\n    <title>...</title>\n    <meta name=\"description\" content=\"...\" />\n    <HeadHrefLangs />\n  </head>\n  <body>...</body>\n</html>\n```\n\nThe HeadHrefLangs component will generate all of the alternate links depending\non the current url and supported locales.\n\nFor example, if you are on the `/about` page and support 3 locales (`en`, `fr`,\n`es`) with `en` being the default locale, this will render:\n\n```html\n<link rel=\"alternate\" hreflang=\"en\" href=\"https://www.example.com/about/\" />\n<link rel=\"alternate\" hreflang=\"fr\" href=\"https://www.example.com/fr/about/\" />\n<link rel=\"alternate\" hreflang=\"es\" href=\"https://www.example.com/es/about/\" />\n```\n\n## 📦 Utility functions\n\n### interpolate function\n\n`interpolate(i18nKey: string, reference: string, namespace: string | null): string`\n\n`astro-i18next` exposes the logic behind the Trans component, you may want to\nuse it directly.\n\n```ts\nimport { interpolate } from \"astro-i18next\";\n\nconst interpolated = interpolate(\n  \"superCoolKey\",\n  'An <a href=\"https://astro.build\" title=\"Astro website\">astro</a> integration of <a href=\"https://www.i18next.com/\" title=\"i18next website\">i18next</a> and utility components to help you translate your astro websites!'\n);\n```\n\n### localizePath function\n\n`localizePath(path: string, locale: string | null = null, base: string = import.meta.env.BASE_URL): string`\n\nSets a path within a given locale. If the locale param is not specified, the\ncurrent locale will be used.\n\n> **Note**\n>\n> This should be used instead of hard coding paths to other pages. It will take\n> care of setting the right path depending on the locale you set.\n\n```astro\n---\nimport { localizePath } from \"astro-i18next\";\nimport i18next from \"i18next\";\n\ni18next.changeLanguage(\"fr\");\n---\n\n<a href={localizePath(\"/about\")}>...</a>\n<!-- renders: <a href=\"/fr/about\">...</a> -->\n```\n\n### localizeUrl function\n\n`localizeUrl(url: string, locale: string | null = null, base: string = import.meta.env.BASE_URL): string`\n\nSets a url within a given locale. If the locale param is not specified, the\ncurrent locale will be used.\n\n> **Note**\n>\n> This should be used instead of hard coding urls for internal links. It will\n> take care of setting the right url depending on the locale you set.\n\n```astro\n---\nimport { localizeUrl } from \"astro-i18next\";\nimport i18next from \"i18next\";\n\ni18next.changeLanguage(\"fr\");\n---\n\n<a href={localizeUrl(\"https://www.example.com/about\")}>...</a>\n<!-- renders: <a href=\"https://www.example.com/fr/about\">...</a> -->\n```\n\n---\n\n## 👀 Going further\n\n### Namespaces\n\ni18next allows you to organize your translation keys into\n[namespaces](https://www.i18next.com/principles/namespaces).\n\nYou can have as many namespaces as you wish, have one per page and one for\ncommon translation strings for example:\n\n```bash\npublic\n├-- locales\n|   |-- en\n|   |   |-- about.json    # \"about\" namespace\n|   |   |-- common.json   # \"common\" namespace\n|   |   └-- home.json     # \"home\" namespace\n|   └-- fr   # same files in other locale folders\nsrc\n└-- pages\n      |-- about.astro\n      └-- index.astro\n```\n\n1. It can easily be setup using the `namespaces` and `defaultNamespace` keys,\n   like so:\n\n   ```ts\n   /** @type {import('astro-i18next').AstroI18nextConfig} */\n   export default {\n     defaultLocale: \"en\",\n     locales: [\"en\", \"fr\"],\n     namespaces: [\"about\", \"common\", \"home\"],\n     defaultNamespace: \"common\",\n   };\n   ```\n\n2. Load the namespace globally using `i18next.setDefaultNamespace(ns: string)`\n   or specify it in the `t` function or the `Trans` component:\n\n   ```astro\n   ---\n   import { t, setDefaultNamespace } from \"i18next\";\n   import { Trans } from \"astro-i18next/components\";\n\n   setDefaultNamespace(\"home\");\n   ---\n\n   <h1>{t(\"myHomeTitle\")}</h1>\n   <p>\n     <Trans i18nKey=\"myHomeDescription\">\n       This translation is loaded from the default <strong>home</strong> namespace!\n     </Trans>\n   </p>\n   <p>\n     <Trans i18nKey=\"myCommonCTA\" ns=\"common\">\n       This translation is loaded from the <strong>common</strong> namespace!\n     </Trans>\n   </p>\n   <!-- t function loads the \"buttonCTA\" key from the \"common\" namespace -->\n   <button>{t(\"common:buttonCTA\")}</button>\n   ```\n\n### AstroI18nextConfig Props\n\n`astro-i18next`'s goal is to abstract most of the configuration for you so that\nyou don't have to think about it. Just focus on translating!\n\nThough if you'd like to go further in customizing i18next, feel free to tweak\nyour config!\n\n| Prop name            | Type (default)                               | Description                                                                                                                    |\n| -------------------- | -------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ |\n| defaultLocale        | `string` (undefined)                         | The default locale for your website.                                                                                           |\n| locales              | `string[]` (undefined)                       | Your website's supported locales.                                                                                              |\n| namespaces           | `string` or `string[]` ('translation')       | String or array of namespaces to load.                                                                                         |\n| defaultNamespace     | `string` (translation')                      | Default namespace used if not passed to the translation function.                                                              |\n| load                 | `Array<\"server\" or \"client\">` (`[\"server\"]`) | Load i18next on server side only, client side only or both.                                                                    |\n| resourcesBasePath    | `?string`                                    | Set base path for i18next resources. Defaults to `/locales`.                                                                   |\n| i18nextServer        | `?InitOptions`                               | The i18next server side configuration. See [i18next's documentation](https://www.i18next.com/overview/configuration-options).  |\n| i18nextServerPlugins | `?{[key: string]: string}` (`{}`)            | Set i18next server side plugins. See [available plugins](https://www.i18next.com/overview/plugins-and-utils).                  |\n| i18nextClient        | `?InitOptions`                               | The i18next client side configuration . See [i18next's documentation](https://www.i18next.com/overview/configuration-options). |\n| i18nextClientPlugins | `?{[key: string]: string}` (`{}`)            | Set i18next client side plugins. See [available plugins](https://www.i18next.com/overview/plugins-and-utils).                  |\n| routes               | `[segment: string]: string or object`(`{}`)  | The translations mapping for your routes. See [translate routes](#-translate-routes).                                          |\n| showDefaultLocale    | `boolean`(`false`)                           | Whether or not the defaultLocale should show up in the url just as other locales.                                              |\n\n## ✨ Contributors\n\nThanks goes to these wonderful people\n([emoji key](https://allcontributors.org/docs/en/emoji-key)):\n\n<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->\n<!-- prettier-ignore-start -->\n<!-- markdownlint-disable -->\n<table>\n  <tbody>\n    <tr>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://yassinedoghri.com/\"><img src=\"https://avatars.githubusercontent.com/u/11021441?v=4?s=100\" width=\"100px;\" alt=\"Yassine Doghri\"/><br /><sub><b>Yassine Doghri</b></sub></a><br /><a href=\"https://github.com/yassinedoghri/astro-i18next/commits?author=yassinedoghri\" title=\"Code\">💻</a> <a href=\"https://github.com/yassinedoghri/astro-i18next/commits?author=yassinedoghri\" title=\"Documentation\">📖</a> <a href=\"#ideas-yassinedoghri\" title=\"Ideas, Planning, & Feedback\">🤔</a> <a href=\"#design-yassinedoghri\" title=\"Design\">🎨</a> <a href=\"#example-yassinedoghri\" title=\"Examples\">💡</a> <a href=\"#maintenance-yassinedoghri\" title=\"Maintenance\">🚧</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://gdevs.io/\"><img src=\"https://avatars.githubusercontent.com/u/10165264?v=4?s=100\" width=\"100px;\" alt=\"Davide Ceschia\"/><br /><sub><b>Davide Ceschia</b></sub></a><br /><a href=\"https://github.com/yassinedoghri/astro-i18next/commits?author=killpowa\" title=\"Code\">💻</a> <a href=\"https://github.com/yassinedoghri/astro-i18next/issues?q=author%3Akillpowa\" title=\"Bug reports\">🐛</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://github.com/preetamslot\"><img src=\"https://avatars.githubusercontent.com/u/5420582?v=4?s=100\" width=\"100px;\" alt=\"preetamslot\"/><br /><sub><b>preetamslot</b></sub></a><br /><a href=\"https://github.com/yassinedoghri/astro-i18next/issues?q=author%3Apreetamslot\" title=\"Bug reports\">🐛</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://www.linkedin.com/in/dklymenko\"><img src=\"https://avatars.githubusercontent.com/u/1391015?v=4?s=100\" width=\"100px;\" alt=\"Dmytro\"/><br /><sub><b>Dmytro</b></sub></a><br /><a href=\"https://github.com/yassinedoghri/astro-i18next/issues?q=author%3Admythro\" title=\"Bug reports\">🐛</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://duskmoon314.com/\"><img src=\"https://avatars.githubusercontent.com/u/20477228?v=4?s=100\" width=\"100px;\" alt=\"Campbell He\"/><br /><sub><b>Campbell He</b></sub></a><br /><a href=\"https://github.com/yassinedoghri/astro-i18next/issues?q=author%3Aduskmoon314\" title=\"Bug reports\">🐛</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://t.me/mellkam\"><img src=\"https://avatars.githubusercontent.com/u/51422045?v=4?s=100\" width=\"100px;\" alt=\"MelKam\"/><br /><sub><b>MelKam</b></sub></a><br /><a href=\"https://github.com/yassinedoghri/astro-i18next/commits?author=MellKam\" title=\"Code\">💻</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://webslc.com/\"><img src=\"https://avatars.githubusercontent.com/u/34887287?v=4?s=100\" width=\"100px;\" alt=\"L1lith\"/><br /><sub><b>L1lith</b></sub></a><br /><a href=\"https://github.com/yassinedoghri/astro-i18next/issues?q=author%3AL1lith\" title=\"Bug reports\">🐛</a> <a href=\"#ideas-L1lith\" title=\"Ideas, Planning, & Feedback\">🤔</a></td>\n    </tr>\n    <tr>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://github.com/Anomander43\"><img src=\"https://avatars.githubusercontent.com/u/14289502?v=4?s=100\" width=\"100px;\" alt=\"Anomander43\"/><br /><sub><b>Anomander43</b></sub></a><br /><a href=\"https://github.com/yassinedoghri/astro-i18next/commits?author=Anomander43\" title=\"Documentation\">📖</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://github.com/dschoeni\"><img src=\"https://avatars.githubusercontent.com/u/1913623?v=4?s=100\" width=\"100px;\" alt=\"Dominik Schöni\"/><br /><sub><b>Dominik Schöni</b></sub></a><br /><a href=\"https://github.com/yassinedoghri/astro-i18next/commits?author=dschoeni\" title=\"Code\">💻</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://github.com/dallyh\"><img src=\"https://avatars.githubusercontent.com/u/6968534?v=4?s=100\" width=\"100px;\" alt=\"Dalibor Hon\"/><br /><sub><b>Dalibor Hon</b></sub></a><br /><a href=\"https://github.com/yassinedoghri/astro-i18next/commits?author=dallyh\" title=\"Code\">💻</a> <a href=\"https://github.com/yassinedoghri/astro-i18next/issues?q=author%3Adallyh\" title=\"Bug reports\">🐛</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://github.com/aquaminer\"><img src=\"https://avatars.githubusercontent.com/u/17113289?v=4?s=100\" width=\"100px;\" alt=\"Oleksii Lozoviahin\"/><br /><sub><b>Oleksii Lozoviahin</b></sub></a><br /><a href=\"https://github.com/yassinedoghri/astro-i18next/commits?author=aquaminer\" title=\"Code\">💻</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://talale.it/\"><img src=\"https://avatars.githubusercontent.com/u/68308554?v=4?s=100\" width=\"100px;\" alt=\"Alessandro Talamona\"/><br /><sub><b>Alessandro Talamona</b></sub></a><br /><a href=\"https://github.com/yassinedoghri/astro-i18next/issues?q=author%3AxTalAlex\" title=\"Bug reports\">🐛</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://github.com/jkjustjoshing\"><img src=\"https://avatars.githubusercontent.com/u/813192?v=4?s=100\" width=\"100px;\" alt=\"Josh Kramer\"/><br /><sub><b>Josh Kramer</b></sub></a><br /><a href=\"https://github.com/yassinedoghri/astro-i18next/commits?author=jkjustjoshing\" title=\"Code\">💻</a> <a href=\"https://github.com/yassinedoghri/astro-i18next/issues?q=author%3Ajkjustjoshing\" title=\"Bug reports\">🐛</a></td>\n      <td align=\"center\" valign=\"top\" width=\"14.28%\"><a href=\"https://github.com/Alexandre-Fernandez\"><img src=\"https://avatars.githubusercontent.com/u/79476242?v=4?s=100\" width=\"100px;\" alt=\"Alexandre Fernandez\"/><br /><sub><b>Alexandre Fernandez</b></sub></a><br /><a href=\"https://github.com/yassinedoghri/astro-i18next/commits?author=Alexandre-Fernandez\" title=\"Code\">💻</a> <a href=\"https://github.com/yassinedoghri/astro-i18next/issues?q=author%3AAlexandre-Fernandez\" title=\"Bug reports\">🐛</a></td>\n    </tr>\n  </tbody>\n</table>\n\n<!-- markdownlint-restore -->\n<!-- prettier-ignore-end -->\n\n<!-- ALL-CONTRIBUTORS-LIST:END -->\n\nThis project follows the\n[all-contributors](https://github.com/all-contributors/all-contributors)\nspecification. Contributions of any kind welcome!\n\n## ❤️ Acknowledgments\n\nThis wouldn't have been possible without the awesome work from the\n[Locize](https://locize.com/) and [Astro](https://astro.build/) teams.\n\nInspired by some of the greatly thought-out i18n implementations:\n\n- [next-i18next](https://github.com/i18next/next-i18next)\n- [react-i18next](https://github.com/i18next/react-i18next)\n- [NextJS's Internationalized Routing](https://nextjs.org/docs/advanced-features/i18n-routing)\n\n## 📜 License\n\nCode released under the [MIT License](https://choosealicense.com/licenses/mit/).\n\nCopyright (c) 2022-present, Yassine Doghri\n([@yassinedoghri](https://twitter.com/yassinedoghri))\n\n[npm]: https://www.npmjs.com/package/astro-i18next\n[npm-badge]: https://img.shields.io/npm/v/astro-i18next\n[build]:\n  https://github.com/yassinedoghri/astro-i18next/actions/workflows/publish.yml\n[build-badge]:\n  https://img.shields.io/github/actions/workflow/status/yassinedoghri/astro-i18next/publish.yml\n[license]:\n  https://github.com/yassinedoghri/astro-i18next/blob/develop/LICENSE.md\n[license-badge]:\n  https://img.shields.io/github/license/yassinedoghri/astro-i18next?color=blue\n[contributions]: https://github.com/yassinedoghri/astro-i18next/issues\n[contributions-badge]:\n  https://img.shields.io/badge/contributions-welcome-blueviolet.svg\n[semantic-release]: https://github.com/semantic-release/semantic-release\n[semantic-release-badge]:\n  https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg\n[stars]: https://github.com/yassinedoghri/astro-i18next/stargazers\n[stars-badge]:\n  https://img.shields.io/github/stars/yassinedoghri/astro-i18next?style=social\n[codecov]: https://codecov.io/gh/yassinedoghri/astro-i18next\n[codecov-badge]:\n  https://codecov.io/gh/yassinedoghri/astro-i18next/branch/develop/graph/badge.svg?token=IFWNB6UJDJ\n[example-up-badge]: https://img.shields.io/badge/status-up-brightgreen\n[example-down-badge]: https://img.shields.io/badge/status-down-red\n","exports":{".":"./dist/index.js","./components":"./src/components/index.ts"},"gitHead":"3630038bef4de6e189e8b4cc3f53a2a25a1ab6f9","scripts":{"lint":"eslint --ext js,cjs,ts .","pack":"pnpm run build && pnpm pack","test":"vitest","build":"tsc && pnpm run typecheck:emit","commit":"cz","prepare":"is-ci || husky install","preview":"astro preview","prettier":"prettier --check --ignore-path .prettierignore .","typecheck":"tsc --noEmit","prettier:fix":"prettier --write --ignore-path .prettierignore .","test:coverage":"pnpm test -- --coverage","typecheck:emit":"tsc --declaration --emitDeclarationOnly --outDir dist/types","semantic-release":"semantic-release"},"_npmUser":{"name":"fauxsoup","email":"fauxsoup@gmail.com"},"repository":{"url":"git+https://github.com/amdglobal/astro-i18next.git","type":"git"},"_npmVersion":"9.6.7","description":"An astro integration of i18next + some utility components to help you translate your astro websites!","directories":{},"lint-staged":{"*.{js,cjs,ts}":"eslint --ext js,cjs,ts . --cache --fix","*.{js,cjs,ts,astro,css,md}":"prettier --write --ignore-path .prettierignore ."},"_nodeVersion":"18.17.1","dependencies":{"pathe":"^1.1.0","i18next":"^22.4.10","iso-639-1":"^2.1.15","locale-emoji":"^0.3.0","@proload/core":"^0.3.3","i18next-fs-backend":"^2.1.1","@proload/plugin-tsm":"^0.2.1","i18next-http-backend":"^2.1.1","i18next-browser-languagedetector":"^7.0.1"},"publishConfig":{"access":"public"},"typesVersions":{"*":{"index":["./dist/types/index.d.ts"],"components":["./src/components/index.d.ts"]}},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"fdir":"^6.0.1","astro":"2.0.17","husky":"^8.0.3","is-ci":"^3.0.1","yargs":"^17.7.1","eslint":"^8.35.0","vitest":"^0.29.2","esbuild":"^0.17.11","i18next":"^22.4.10","fs-extra":"^11.1.0","prettier":"2.8.4","commitizen":"^4.3.0","typescript":"^4.9.5","lint-staged":"^13.1.2","@types/yargs":"^17.0.22","@commitlint/cli":"^17.4.4","@types/fs-extra":"^11.0.1","eslint-plugin-n":"^15.6.1","semantic-release":"^20.1.1","eslint-plugin-jest":"^27.2.1","@vitest/coverage-c8":"^0.29.2","all-contributors-cli":"^6.24.0","eslint-plugin-import":"^2.27.5","@semantic-release/git":"^10.0.1","eslint-plugin-promise":"^6.1.1","prettier-plugin-astro":"^0.8.0","@semantic-release/exec":"^6.0.3","esbuild-plugin-fileloc":"^0.0.6","eslint-config-prettier":"^8.6.0","eslint-config-standard":"^17.0.0","eslint-plugin-prettier":"^4.2.1","@typescript-eslint/parser":"^5.54.0","cz-conventional-changelog":"^3.3.0","@semantic-release/changelog":"^6.0.2","@commitlint/config-conventional":"^17.4.4","@typescript-eslint/eslint-plugin":"^5.54.0"},"peerDependencies":{"astro":">=2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/astro-i18next_1.0.0-beta.2_1692856357428_0.413158555334858","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-08-24T05:46:44.341Z","modified":"2026-06-16T18:04:30.869Z","1.0.0-beta.1":"2023-08-24T05:46:44.647Z","1.0.0-beta.2":"2023-08-24T05:52:37.714Z"},"bugs":{"url":"https://github.com/yassinedoghri/astro-i18next/issues"},"author":{"url":"https://yassinedoghri.com/","name":"Yassine Doghri","email":"yassine@doghri.fr"},"license":"MIT","homepage":"https://astro-i18next.yassinedoghri.com/","keywords":["astro-component","astro-integration","seo","i18next","i18n","internationalization","i10n","localization"],"repository":{"url":"git+https://github.com/amdglobal/astro-i18next.git","type":"git"},"description":"An astro integration of i18next + some utility components to help you translate your astro websites!","maintainers":[{"email":"ganesh.r@excelglobalsolution.com","name":"ganeshr"},{"email":"muhammadyounus.shaik@excelglobalsolution.com","name":"younus183"},{"email":"fauxsoup@gmail.com","name":"fauxsoup"},{"email":"rohitkumar.padala@excelglobalsolution.com","name":"rohitkumarpadala"},{"email":"sean@amdtelemedicine.com","name":"dayburner"},{"email":"chip@amdtelemedicine.com","name":"chipmcintosh"}],"readme":"","readmeFilename":""}