Set lang value in generated HTML page

This commit is contained in:
Gregory Soutade 2024-02-15 10:54:52 +01:00
parent d78739157b
commit b9566beb80
2 changed files with 10 additions and 10 deletions

View File

@ -59,7 +59,7 @@ compress_output_files = ['html', 'css', 'js']
locales_path = './locales' locales_path = './locales'
# Default locale (english) # Default locale (english)
locale = 'en_EN' locale = 'en'
# Don't keep requests of all visitors into database # Don't keep requests of all visitors into database
keep_requests = False keep_requests = False

View File

@ -365,20 +365,20 @@ class DisplayHTMLPage(object):
self.logger.debug('Write %s' % (filename)) self.logger.debug('Write %s' % (filename))
f = codecs.open(filename, 'w', 'utf-8') f = codecs.open(filename, 'w', 'utf-8')
f.write(u'<!DOCTYPE html>') f.write(u'<!DOCTYPE html>\n')
f.write(u'<html>') f.write(u'<html lang="{}">\n'.format(self.iwla.getConfValue('locale', 'en')))
f.write(u'<head>') f.write(u'<head>\n')
f.write(u'<meta http-equiv="Content-type" content="text/html; charset=UTF-8" />') f.write(u'<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>\n')
f.write(u'<link rel="icon" type="image/png" href="/resources/icon/favicon.png"/>') f.write(u'<link rel="icon" type="image/png" href="/resources/icon/favicon.png"/>\n')
for css in self.css_path: for css in self.css_path:
f.write(u'<link rel="stylesheet" href="/%s"/>' % (css)) f.write(u'<link rel="stylesheet" href="/%s"/>\n' % (css))
if self.title: if self.title:
f.write(u'<title>%s</title>' % (self.title)) f.write(u'<title>%s</title>\n' % (self.title))
f.write(u'</head><body>') f.write(u'</head><body>\n')
for block in self.blocks: for block in self.blocks:
block.build(f, filters=filters) block.build(f, filters=filters)
if displayVersion: if displayVersion:
f.write(u'<div style="text-align:center;width:100%%">Generated by <a href="%s">IWLA %s</a></div>' % f.write(u'<div style="text-align:center;width:100%%">Generated by <a href="%s">IWLA %s</a></div>\n' %
("http://indefero.soutade.fr/p/iwla", self.iwla.getVersion())) ("http://indefero.soutade.fr/p/iwla", self.iwla.getVersion()))
f.write(u'</body></html>') f.write(u'</body></html>')
f.close() f.close()