Skip to content

armgit / wger

Public Imported from GitHub
0

Self hosted FLOSS fitness/workout, nutrition and weight tracker

Add the language switch to the mobile version

Roland Geiderbea53412c961
diff --git a/wger/manager/templates/mobile/navigation.html b/wger/manager/templates/mobile/navigation.html
index 11699f93f..163a4fa24 100644
--- a/wger/manager/templates/mobile/navigation.html
+++ b/wger/manager/templates/mobile/navigation.html
@@ -1,4 +1,18 @@
-{% load i18n %}{% load url from future %}{% load cache %}
+{% load i18n %}{% load url from future %}{% load cache %}{% load wger_extras %}
+
+<div data-role="popup"
+ id="language-options"
+ data-overlay-theme="a"
+ class="ui-content">
+ <div>
+ <h3>{% trans "Language" %}</h3>
+ {% for language in languages %}
+ {% language_select language %}
+ {% endfor %}
+ </ul>
+ </div>
+</div>
+
{# #}
{# Close button for panel #}
@@ -143,6 +157,17 @@
{# #}
<li><a href="?flavour=full" data-ajax="false">{% trans "Desktop version" %}</a></li>
+
+ {# #}
+ {# Language #}
+ {# #}
+ <li>
+ <a href="#language-options"
+ data-rel="popup"
+ data-position-to="window">{% trans "Language" %}
+ </a>
+ </li>
+
</ul>
diff --git a/wger/manager/templates/mobile/tags/language_select.html b/wger/manager/templates/mobile/tags/language_select.html
new file mode 100644
index 000000000..12ef78c23
--- /dev/null
+++ b/wger/manager/templates/mobile/tags/language_select.html
@@ -0,0 +1,10 @@
+{% load i18n %}
+{% load staticfiles %}
+
+<a href="{{i18n_path}}"
+ data-role="button">
+ <img src="{% static path %}"
+ width="22"
+ height="22"
+ alt="{% trans language_name %}">
+ {% trans language_name %}</a>
\ No newline at end of file