I'm trying to migrate my Angular App to an Angular SSR for better SEO. I need to provide the html's lang attribute depending on the route :
- If the route starts with /fr, set it to fr
- If the route starts with /en, set it to en
I think I have to use this in my AppComponent :
public readonly document = inject(DOCUMENT);
constructor() {
this.document.documentElement.lang = myLanguage;
}
But I have no idea how to retrieve the route to know which language I should set.