fix(a11y): html lang should reflect locale

fix #7150
This commit is contained in:
Paul Chavard 2022-04-21 10:28:23 +02:00
parent 4a9250f377
commit 572e1dca8e
2 changed files with 5 additions and 1 deletions

View file

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

View file

@ -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" }