Skip to content

Commit

Permalink
fix: expect locales folder to be in astro's publicDir config by default
Browse files Browse the repository at this point in the history
closes #64
  • Loading branch information
yassinedoghri committed Nov 27, 2022
1 parent be30517 commit ec72ff3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down

0 comments on commit ec72ff3

Please sign in to comment.