Merge pull request #7180 from tchak/fix-html-lang
fix(a11y): html lang should reflect locale
This commit is contained in:
commit
c24b24c3a5
2 changed files with 5 additions and 1 deletions
|
@ -1,6 +1,10 @@
|
|||
module ApplicationHelper
|
||||
include SanitizeUrl
|
||||
|
||||
def html_lang
|
||||
I18n.locale.to_s
|
||||
end
|
||||
|
||||
def sanitize_url(url)
|
||||
if !url.nil?
|
||||
super(url, schemes: ['http', 'https'], replace_evil_with: root_url)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
!!! 5
|
||||
%html{ lang: "fr", class: yield(:root_class) }
|
||||
%html{ lang: html_lang, class: yield(:root_class) }
|
||||
%head
|
||||
%meta{ "http-equiv": "Content-Type", content: "text/html; charset=UTF-8" }
|
||||
%meta{ "http-equiv": "X-UA-Compatible", content: "IE=edge" }
|
||||
|
|
Loading…
Reference in a new issue