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

Support for Multi-Domain Locale Detection in Angular SSR #29111

Open
alan-agius4 opened this issue Dec 11, 2024 · 1 comment
Open

Support for Multi-Domain Locale Detection in Angular SSR #29111

alan-agius4 opened this issue Dec 11, 2024 · 1 comment
Labels
area: @angular/ssr feature Issue that requests a new feature

Comments

@alan-agius4
Copy link
Collaborator

alan-agius4 commented Dec 11, 2024

Description

Currently, Angular SSR does not provide built-in functionality to detect the domain in a multi-domain setup and serve the appropriate localized version of the application. This feature would allow Angular SSR to dynamically render pages with the correct locale based on the domain.

Use Case:

  • Applications serving different localized versions (e.g., example.com, fr.example.com, example.de) need SSR to serve the appropriate locale.
  • Example:
    • example.com → English content
    • fr.example.com → French content
    • example.de → German content

Describe the solution you'd like

Allow SSR to use the detected domain to select the corresponding locale configuration. Which simplifies multi-language deployment without relying on path-based locales (e.g., /en, /fr).

Describe alternatives you've considered

No response

@alan-agius4 alan-agius4 added area: @angular/ssr feature Issue that requests a new feature labels Dec 11, 2024
@jnizet
Copy link
Contributor

jnizet commented Dec 11, 2024

Just my two cents: I had to do that for a backend (not using Angular SSR), and I found it rather elegant to do it by relying on the Accept-Language header.

The reverse-proxy in front of the backend would be configured to set the appropriate Accept-Language header value based on the domain. This limits the configuration that needs to be done on the backend side.

And relying on the Accept-Language header could also be a good thing for simpler deployments where there is a single URL to serve the app, and where the Accept-Language header coming from the browser is used to decide which locale to use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: @angular/ssr feature Issue that requests a new feature
Projects
None yet
Development

No branches or pull requests

2 participants