Toolbelt.Blazor.HeadElement icon indicating copy to clipboard operation
Toolbelt.Blazor.HeadElement copied to clipboard

Change Html Lang tag

Open mysteryx93 opened this issue 5 years ago • 3 comments
trafficstars

Another tag that would be useful to change is

<html lang="en">

mysteryx93 avatar May 19 '20 17:05 mysteryx93

@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?

jsakamoto avatar May 31 '20 06:05 jsakamoto

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

mysteryx93 avatar Jun 09 '20 15:06 mysteryx93

@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

jsakamoto avatar Jun 12 '20 13:06 jsakamoto