jsakamoto / Toolbelt.Blazor.HeadElement

Head element support (change the document title, "meta" elements such as OGP, and "link" elements) for Blazor apps.
https://demo-blazor-headelement.azurewebsites.net/
Mozilla Public License 2.0
158 stars 11 forks source link

Change Html Lang tag #3

Open mysteryx93 opened 4 years ago

mysteryx93 commented 4 years ago

Another tag that would be useful to change is

<html lang="en">
jsakamoto commented 4 years ago

@mysteryx93

In my opinion, it is not a good idea to support the change lang tag by this component/library.

If I implement this case, I will implement it on standard ASP.NET Core server-side technologies, such as Razor pages (ex. _Host.cshtml)

Why do you think that you need to change lang tag by this component/library?

mysteryx93 commented 4 years ago

If I have pages in different languages on the website, how can the page tell the _Host its language?

jsakamoto commented 4 years ago

@mysteryx93

It is not a Blazor matter. It is a general topic of ASP.NET Razor Pages programming.

The "lang" attribute in the "html" tag is important for only the server-side rendering scenario. Changing the "lang" attribute at the client-side is no make sense.

Anyway, I wrote and published a sample code.

Please visit https://github.com/sample-by-jsakamoto/ASPNETCore-RazorPages-RenderLangAttribInHtmlTag