Actions
Bug #11129
openhtml lang attribute is not correctly set in plain html mode (including bot mode)
Start date:
12/04/2022
Due date:
% Done:
0%
Estimated time:
Description
Inside WebRenderer::setPageVars
, the html lang attribute is always set to "en":
if (session_.env().agentIsIE())
page.setVar("HTMLATTRIBUTES",
"xmlns:v=\"urn:schemas-microsoft-com:vml\""
" lang=\"en\" dir=\"ltr\"" + htmlAttr);
else
page.setVar("HTMLATTRIBUTES", "lang=\"en\" dir=\"ltr\"" + htmlAttr);
When ajax is not available, this attribute will never be updated to its correct value.
Solution
Use the WApplication::locale
if the app
is already available (which is the case in plain html mode):
if (session_.env().agentIsIE())
page.setVar("HTMLATTRIBUTES",
"xmlns:v=\"urn:schemas-microsoft-com:vml\""
" lang=\""+(app ? app->locale().name() : "en")+"\" dir=\"ltr\"" + htmlAttr);
else
page.setVar("HTMLATTRIBUTES", "lang=\""+(app ? app->locale().name() : "en")+"\" dir=\"ltr\"" + htmlAttr);
Updated by Matthias Van Ceulebroeck 19 days ago
- Target version set to 4.12.1
Hello Dries,
I have to admit I lost track of this ticket. The prompt on the related (#12148) got me to view this again.
Your proposal should fix the attribute for bots.
Actions