how to set language to meet web accessibiity guideline?

40 views Asked by At

I'm checking my site for Web Accessibiity using the Web Accessibility Access Tool *WAVE) at http://wave.webaim.org

It tells me I should have a language specification, e.g.

<html lang="en">

Fair enough. How can I do this in rails?

Currently in app/views/layouts/application.html.haml I have

%head
  %title="#{controller.controller_name.capitalize} - #{controller.action_name}"
  = stylesheet_link_tag 'application'
  = javascript_include_tag "application"
  = csrf_meta_tag
%body
  ...

and that generates:

<document>
<html>
<head>
  ...
<body>
...

but how would I get lang="en" into the html tag as recommended ?

1

There are 1 answers

0
Michael Durrant On

Perhaps one answer is to just put it in the body tag, i.e.

%body{lang:'en'}

which generates

<body lang="en">

However the WAVE tool still complains.