fix: use dynamic path for locale javascript

This commit is contained in:
Yohan Boniface 2024-01-17 16:36:17 +01:00
parent 656e29c72b
commit 1b8e6164ed

View file

@ -27,7 +27,11 @@
<script src="{% static 'umap/vendors/dompurify/purify.js' %}" defer></script>
<script src="{% static 'umap/vendors/colorbrewer/colorbrewer.js' %}" defer></script>
<script src="{% static 'umap/vendors/simple-statistics/simple-statistics.min.js' %}" defer></script>
{% if locale %}<script src="{% static 'umap/locale/fr.js' %}" defer></script>{% endif %}{# TODO: handle dynamic locale! #}
{% if locale %}
{% with 'umap/locale/'|add:locale|add:'.js' as path %}
<script src="{% static path %}" defer></script>
{% endwith %}
{% endif %}
<script src="{% static 'umap/js/umap.core.js' %}" defer></script>
<script src="{% static 'umap/js/umap.autocomplete.js' %}" defer></script>
<script src="{% static 'umap/js/umap.popup.js' %}" defer></script>