From 8bcd5a7ef2ff699e87b7c602e2ec41f9ff02a822 Mon Sep 17 00:00:00 2001 From: Rolf Niepraschk <Rolf.Niepraschk@ptb.de> Date: Tue, 27 Jul 2021 10:28:14 +0200 Subject: [PATCH] Language support activated --- server.py | 5 +---- templates/html/validation.html | 3 +-- trans.py | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/server.py b/server.py index 3ecb26c..455dec6 100644 --- a/server.py +++ b/server.py @@ -71,10 +71,7 @@ def validate(): def validation(): app.logger.debug('hit validation.html') l = str(request.accept_languages).split(',')[0][0:2] - if l != 'de': - l = 'en' - # x = '["2.4.0","2.3.0","2.2.0","2.1.1","2.1.0"]' - x = '[' + ','.join(versions) + ']'# javascript array definition as string + x = '[' + ','.join(versions) + ']'# javascript array definition return trans.show_html(version=utils.get_version(), language=l, xsd_versions=x) diff --git a/templates/html/validation.html b/templates/html/validation.html index 65a3a20..265accb 100644 --- a/templates/html/validation.html +++ b/templates/html/validation.html @@ -1,9 +1,8 @@ -<html lang="en" xmlns="http://www.w3.org/1999/xhtml"> +<html lang="{{LANGUAGE}}" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta name="description" content="DCC Validation Service"> - <meta name="author" content="wactbprot"> <title>DCC Validation Service</title> <!-- Bootstrap core CSS --> diff --git a/trans.py b/trans.py index 1e2f019..b83fe45 100644 --- a/trans.py +++ b/trans.py @@ -33,4 +33,4 @@ class Trans: d = self.mapping['en'] template = 'html/validation.html' return render_template(template, VERSION=version, - XSD_VERSIONS=xsd_versions, **d) + XSD_VERSIONS=xsd_versions, LANGUAGE=language, **d) -- GitLab