Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Slice language code to two letters to fix #378
Browse files Browse the repository at this point in the history
  • Loading branch information
ckleemann committed Mar 22, 2020
1 parent 2afbd43 commit 2c55a5f
Showing 1 changed file with 36 additions and 35 deletions.
71 changes: 36 additions & 35 deletions ophasebase/templates/ophasebase/frontend_base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,47 +2,48 @@
<html>
<head>
<title>{% block title %}{% endblock %} | OphaseHQ - d120.de</title>
<meta charset="utf-8" />
<meta name=viewport content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="{% static 'vendor/bootstrap/dist/css/bootstrap.min.css' %}" media="screen" />
<link rel="stylesheet" href="{% static 'vendor/@fortawesome/fontawesome-free/css/all.min.css' %}" />
<link rel="stylesheet" href="{% static 'ophasebase/css/pyophase.css' %}" media="screen" />
<meta charset="utf-8"/>
<meta name=viewport content="width=device-width, initial-scale=1"/>
<link rel="stylesheet" href="{% static 'vendor/bootstrap/dist/css/bootstrap.min.css' %}" media="screen"/>
<link rel="stylesheet" href="{% static 'vendor/@fortawesome/fontawesome-free/css/all.min.css' %}"/>
<link rel="stylesheet" href="{% static 'ophasebase/css/pyophase.css' %}" media="screen"/>
</head>
<body>

{% block language-switcher %}
<!-- language switcher -->
<div class="language-switcher">
<div class="container">
<form action="{% url 'set_language' %}" method="post" class="form-inline" name="language-form">
{% csrf_token %}
<input name="next" type="hidden" value="{{ request.path }}" />
Switch language:
<select name="language" class="form-control input-sm w-initial">
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
<option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE %} selected="selected"{% endif %}>
{{ language.code | upper }}
</option>
{% endfor %}
</select>
<input type="submit" value="{% trans 'Sprache ändern' %}" class="btn btn-primary btn-sm" />
</form>
</div>
{% block language-switcher %}
<!-- language switcher -->
<div class="language-switcher">
<div class="container">
<form action="{% url 'set_language' %}" method="post" class="form-inline" name="language-form">
{% csrf_token %}
<input name="next" type="hidden" value="{{ request.path }}"/>
Switch language:
<select name="language" class="form-control input-sm w-initial">
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
{% for language in languages %}
<option value="{{ language.code }}"{% if language.code == LANGUAGE_CODE|slice:":2" %}
selected="selected"{% endif %}>
{{ language.code | upper }}
</option>
{% endfor %}
</select>
<input type="submit" value="{% trans 'Sprache ändern' %}" class="btn btn-primary btn-sm"/>
</form>
</div>
{% endblock %}
</div>
{% endblock %}

<div class="container">
<div class="container">

<!-- Header -->
<div class="row">
<div class="col-sm-12 col-md-10 mt-4">
<h1>
<a href="{% url 'website:homepage' %}" class="no-underline d-none d-sm-inline">
<img src="{% static 'website/ophasen-wesen.svg' %}" class="header-img-wesen" />
</a>
<!-- Header -->
<div class="row">
<div class="col-sm-12 col-md-10 mt-4">
<h1>
<a href="{% url 'website:homepage' %}" class="no-underline d-none d-sm-inline">
<img src="{% static 'website/ophasen-wesen.svg' %}" class="header-img-wesen"/>
</a>
{% block heading %}{% endblock %}
</h1>
</div>
Expand Down

0 comments on commit 2c55a5f

Please sign in to comment.