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

astro build doesn't output right dist files when config i18n fallback #12013

Closed
1 task done
yuchenii opened this issue Sep 17, 2024 · 2 comments
Closed
1 task done

astro build doesn't output right dist files when config i18n fallback #12013

yuchenii opened this issue Sep 17, 2024 · 2 comments
Assignees
Labels
needs repro Issue needs a reproduction needs response Issue needs response from OP

Comments

@yuchenii
Copy link

yuchenii commented Sep 17, 2024

Astro Info

Astro                    v4.15.6
Node                     v18.20.3
System                   Linux (x64)
Package Manager          pnpm
Output                   static
Adapter                  none
Integrations             none

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

  1. Follow this page to add i18n features, and config i18n.fallback en: "zh", more detailed information is on StackBlitz.
  2. After running pnpm build, the dist directory is as follows. There are also en and zh directories under the en directory, this is a bug or my problem
dist
  ├─en
  │    ├─blog
  │    │    └─first-post
  │    │         └─index.html
  │    ├─en
  │    │    └─blog
  │    │         └─first-post
  │    │              └─index.html
  │    ├─index.html
  │    └─zh
  │         └─blog
  │              └─first-post
  │                   └─index.html
  ├─index.html
  └─zh
       └─blog
            └─first-post
                 └─index.html
  1. if comment out the fallback configuration or add prefixDefaultLocale: true to i18n.routing,there will be no problem

What's the expected result?

The dist directory should look like this

dist
  ├─en
  │    └─blog
  │         └─first-post
  │              └─index.html
  ├─index.html
  └─zh
       └─blog
            └─first-post
                 └─index.html

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-1vx29t-fsktjn?file=astro.config.mjs

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Sep 17, 2024
@ematipico ematipico added - P3: minor bug An edge case that only affects very specific usage (priority) feat: i18n Related to internalization (scope) and removed needs triage Issue needs to be triaged labels Sep 17, 2024
@ematipico ematipico self-assigned this Oct 7, 2024
@ematipico ematipico added needs response Issue needs response from OP needs repro Issue needs a reproduction and removed - P3: minor bug An edge case that only affects very specific usage (priority) feat: i18n Related to internalization (scope) labels Oct 15, 2024
Copy link
Contributor

Hello @yuchenii. Please provide a minimal reproduction using a GitHub repository or StackBlitz. Issues marked with needs repro will be closed if they have no activity within 3 days.

@ematipico
Copy link
Member

ematipico commented Oct 15, 2024

I did triage the issue, and I believe you're using the feature incorrectly, or you provided an incorrect reproduction.

Your reproduction has two issues:

  • it uses collections to dynamically generate content, which means there's always content, so the fallback isn't needed
  • you reproduction has content for both pages (first-post), so the fallback doesn't make sense

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs repro Issue needs a reproduction needs response Issue needs response from OP
Projects
None yet
Development

No branches or pull requests

2 participants