diff --git a/README.md b/README.md index 05b3a61..f77f73a 100644 --- a/README.md +++ b/README.md @@ -95,7 +95,9 @@ npm install astro-i18next [AstroI18nextConfig props](#astroi18nextconfig-props). 3. By default, `astro-i18next` expects your translations to be organized inside - your `public` folder, in a `locales` folder: + your + [astro's `publicDir`](https://docs.astro.build/en/reference/configuration-reference/#publicdir), + in a `locales` folder: ```bash public diff --git a/src/index.ts b/src/index.ts index 2b5cfcc..85a7a5d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -72,7 +72,7 @@ export default (options?: AstroI18nextOptions): AstroIntegration => { defaultNS: astroI18nextConfig.defaultNamespace, initImmediate: false, backend: { - loadPath: "./public/locales/{{lng}}/{{ns}}.json", + loadPath: config.publicDir.pathname + "locales/{{lng}}/{{ns}}.json", }, ...astroI18nextConfig.i18nextServer, };