394
Views
4
Comments
Solved
Accessibility Reactive - Adding a language tag
Question

Has anyone got an approach for adding a lang = "en" to a reactive app?  We have tried httprequesthandler AddAttributeToHtmlTag in the pages OnInitialize, OnRender and OnReady with no success.


2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
Solution

Hi Paul,

Do you want to add a global language attribute like this:

<html lang="en">
...
</html
>

You need some javascript in the OnReady event of your screen:

Then the generated HTML looks like this:



or like this:

<p lang="en">This is a paragraph in English.</p>

The latter should be possible using the attributes on the widget of a screen or block:

And this the generated HTML

Regards,

Daniel

2021-09-10 14-03-53
Salman Ansari

Paul Davies wrote:

Has anyone got an approach for adding a lang = "en" to a reactive app?  We have tried httprequesthandler AddAttributeToHtmlTag in the pages OnInitialize, OnRender and OnReady with no success.


Hi Paul

Could you please explain in more details what you wanted to achieve?


2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP
Solution

Hi Paul,

Do you want to add a global language attribute like this:

<html lang="en">
...
</html
>

You need some javascript in the OnReady event of your screen:

Then the generated HTML looks like this:



or like this:

<p lang="en">This is a paragraph in English.</p>

The latter should be possible using the attributes on the widget of a screen or block:

And this the generated HTML

Regards,

Daniel

UserImage.jpg
Paul Davies

Thanks Daniel worked like a charm.

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

You are welcome Paul!

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.