Merge pull request #7180 from tchak/fix-html-lang

fix(a11y): html lang should reflect locale
This commit is contained in:
Kara Diaby 2022-04-21 11:34:19 +02:00 committed by GitHub
commit c24b24c3a5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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" }