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

Testing Domain Internationalization on localhost #12385

Open
1 task
jamieconnor-pv opened this issue Nov 6, 2024 · 0 comments
Open
1 task

Testing Domain Internationalization on localhost #12385

jamieconnor-pv opened this issue Nov 6, 2024 · 0 comments
Labels
needs triage Issue needs to be triaged

Comments

@jamieconnor-pv
Copy link

Astro Info

Astro                    v4.16.9
Node                     v18.20.4
System                   macOS (x64)
Package Manager          npm
Output                   server
Adapter                  @astrojs/node
Integrations             none

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

No response

Describe the Bug

I'm trying to test Astro Internationalization using domains on localhost and I am not able to get it display different pages dependant on the domain. It keeps displaying the default template.

I am testing on my local machine. I have set up my host file with so that I can test different domains

127.0.0.1 test
127.0.0.1 zh.test

My astro configuration looks like this
`
import node from '@astrojs/node';
import { defineConfig } from "astro/config";

export default defineConfig({
site: "http://test",
output: "server", // required, with no prerendered pages
adapter: node({
mode: 'standalone',
}),
i18n: {
defaultLocale: "en",
locales: ["en", "zh"],
routing: {
prefixDefaultLocale: false
},
domains: {
zh: "http://zh.test",
}
}
})
`

My pages look like this

pages/en/index.astro
pages/zh/index.astro
pages/index.astro

What's the expected result?

When I go to
zh.test:4321 I expect to get the template inside of src/pages/zh/index.astro
test:4321 I expect to get the template inside of src/pages/en/index.astro (the defaultLocale)

Link to Minimal Reproducible Example

https://stackblitz.com/edit/astro-uryli9

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 Nov 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant