withastro / astro

The web framework for content-driven websites. ⭐️ Star to support our work!
https://astro.build
Other
46.42k stars 2.46k forks source link

Server islands do not respond to i18n language changes #12307

Open Amirhlotfi opened 6 hours ago

Amirhlotfi commented 6 hours ago

Astro Info

Server islands don’t respond to i18n language changes, and astro.currentLanguage consistently returns the default locale. This issue doesn’t seem to occur in Astro pages or components.

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

No response

Describe the Bug

astro.currentLanguage in a Server island consistently returns the default locale

What's the expected result?

astro.currentLanguage to return the correct locale.

Link to Minimal Reproducible Example

https://stackblitz.com/github/Amirhlotfi/astro-i18n-bug

Participation

ematipico commented 5 hours ago

Server islands are created using a particular route naming, so they are exempt from i18n checks.

However, can't you pass the current locale as a prop to the server island?