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

When setting the prefixDefaultLocale = false, fallback to default is not working at homepage. #10724

Closed
1 task
dande-sun opened this issue Apr 9, 2024 · 4 comments · Fixed by #10755
Closed
1 task
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: i18n Related to internalization (scope)

Comments

@dande-sun
Copy link

Astro Info

Astro                    v4.5.12
Node                     v20.8.1
System                   Linux (x64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/node
Integrations             @astrojs/react
                         @astrojs/vue
                         @astrojs/tailwind
                         @astrojs/mdx
                         @astrojs/partytown
                         client:eager

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

Chrome

Describe the Bug

when setting below options, the fallback for SG homepage is not working, the Location in response is a null string.
i18n: { defaultLocale: "default", locales: [ "default", "fr", ], fallback: { "fr": 'default' }, routing: { prefixDefaultLocale: false } }, trailingSlash: "never"

This is the response,
Request URL: https://astro.avepoint.com/uk Request Method: GET Status Code: 302 Found Remote Address: 10.1.0.182:443 Referrer Policy: strict-origin-when-cross-origin Date: Tue, 09 Apr 2024 07:31:48 GMT Last-Modified: Tuesday, 09-Apr-2024 07:31:48 UTC Location: Referrer-Policy: no-referrer-when-downgrade

What's the expected result?

It's should be fallback to default homepage.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-xfj9kv?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 Apr 9, 2024
@ematipico
Copy link
Member

Can you please create a valid reproduction? The reproduction uses the fr language, but then the pages/ folder contains a es/ folder instead.

Also, when running astro build, I can see the emitted files as expected.

@ematipico ematipico added needs response Issue needs response from OP needs repro Issue needs a reproduction and removed needs triage Issue needs to be triaged labels Apr 9, 2024
Copy link
Contributor

github-actions bot commented Apr 9, 2024

Hello @dande-sun. 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.

@dande-sun
Copy link
Author

@ematipico, the fr only an example, I set the fallback fr to default, but there not have the fr homepage, it should be fallback to default homepage, the bug does not need astro build, in the dev mod is same too.
Anyway I updated the reproduction, https://stackblitz.com/edit/github-xfj9kv

@ematipico ematipico added needs triage Issue needs to be triaged and removed needs response Issue needs response from OP needs repro Issue needs a reproduction labels Apr 11, 2024
@ematipico
Copy link
Member

@dande-sun: thank you

@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 Apr 11, 2024
@ematipico ematipico self-assigned this Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) feat: i18n Related to internalization (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants