From 2b9165a405a584af5986436e396ef55214fc6af8 Mon Sep 17 00:00:00 2001
From: Elke Kreim <elke.kreim@hs-hannover.de>
Date: Tue, 4 Aug 2020 10:57:58 +0200
Subject: [PATCH] Changes for language use

Add language code to html tag, add frame to active language flag, update watchdog and libsass
---
 hshassets/templates/hshassets/includes/nav_lang_flags.html | 4 +++-
 hshassets/templates/hshassets/layout/base.html             | 6 ++++--
 requirements.txt                                           | 4 ++--
 setup.py                                                   | 6 +++---
 4 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/hshassets/templates/hshassets/includes/nav_lang_flags.html b/hshassets/templates/hshassets/includes/nav_lang_flags.html
index db62d521..97f98cf4 100644
--- a/hshassets/templates/hshassets/includes/nav_lang_flags.html
+++ b/hshassets/templates/hshassets/includes/nav_lang_flags.html
@@ -2,15 +2,17 @@
 {% load static %}
 
 {# note: if you are adding more languages, do not edit this file; just add a new flag icon, named lang-xx.png, where xx is the language code #}
+{# Add url "url(r'^i18n/', include('django.conf.urls.i18n'))", to your URLconf to activate view set_language #}
 <span class="navbar-item">
     <form id="language-switch-form" class="nav-item" role="change-language" action="{% url 'set_language' %}" method="POST">
         {% csrf_token %}
+        {% get_current_language as LANGUAGE_CODE %}
         {% get_available_languages as LANGUAGES %}
         {% get_language_info_list for LANGUAGES as languages %}
         {% for language in languages %}
 
             <button
-                class="button"
+                class="button {% if language.code == LANGUAGE_CODE %}is-white is-focused{% endif %}"
                 type="submit"
                 name="language"
                 value="{{ language.code }}"
diff --git a/hshassets/templates/hshassets/layout/base.html b/hshassets/templates/hshassets/layout/base.html
index 301ba5b0..f5970804 100644
--- a/hshassets/templates/hshassets/layout/base.html
+++ b/hshassets/templates/hshassets/layout/base.html
@@ -1,6 +1,8 @@
 <!DOCTYPE html>
-{% load static piwik %}
-<html>
+{% load static i18n piwik %}
+{% get_current_language as LANGUAGE_CODE %}
+
+<html lang="{{ LANGUAGE_CODE }}">
     <head>
         <meta charset="utf-8">
         <meta name="viewport" content="width=device-width, initial-scale=1">
diff --git a/requirements.txt b/requirements.txt
index 64bdb735..ac08b308 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,3 +1,3 @@
-libsass==0.17.0
+libsass==0.19.4
 jsmin==2.2.2
-watchdog==0.9.0
+watchdog==0.10.2
diff --git a/setup.py b/setup.py
index e9f90f84..fd368230 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
 
 setup(
     name='django-hshassets',
-    version='2.2.15',
+    version='2.2.17',
     packages=find_packages(),
     include_package_data=True,
     license='MIT License',
@@ -18,9 +18,9 @@ setup(
     author_email='tim.fechner@hs-hannover.de',
     zip_safe=False,
     install_requires=[
-        'libsass==0.17.0',
+        'libsass==0.19.4',
         'jsmin==2.2.2',
-        'watchdog==0.9.0'
+        'watchdog==0.10.2'
     ],
     classifiers=[
         'Environment :: Web Environment',
-- 
GitLab