Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bowencool opened this issue Jan 10, 2024 · 1 comment
Open

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

bowencool opened this issue Jan 10, 2024 · 1 comment

Comments

@bowencool
Copy link

bowencool commented Jan 10, 2024

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):

  • "astro": "^4.0.8",
  • "astro-i18next": "^1.0.0-beta.21",
  • OS: MacOS Sonoma 14.3
  • Browser: Chrome Version 120.0.6099.199
@bowencool
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant