yassinedoghri / astro-i18next

An astro integration of i18next + some utility components to help you translate your astro websites!
https://astro-i18next.yassinedoghri.com
MIT License
473 stars 33 forks source link

Ignore 404.astro when run `npx astro-i18next generate` #184

Open bowencool opened 6 months ago

bowencool commented 6 months ago

Describe the bug

Since src/pages/[lang]/404.astro will never be displayed, I have written custom logic in src/pages/404.astro.

const pathname = Astro.url.pathname;
if (pathname.startsWith("/zh/")) {
  changeLanguage("zh");
} else {
  changeLanguage("en");
}

However, running npx astro-i18next generate will break this logic.

Expected behavior

Ignore 404.astro file

Screenshots

image

Context (please complete the following information):

bowencool commented 6 months ago

By the way, please add support for .ts and .tsx files to the generate command.