feat: Search language specific

This commit is contained in:
moanos [he/him] 2025-01-09 22:39:34 +01:00
parent c6af3e8d04
commit 91d740511d

View File

@ -4,6 +4,7 @@
{% block title %}<title>{% translate "Suche" %}</title>{% endblock %} {% block title %}<title>{% translate "Suche" %}</title>{% endblock %}
{% block content %} {% block content %}
{% get_current_language as LANGUAGE_CODE_CURRENT %}
<div class="container-cards"> <div class="container-cards">
<form class="form-search card half" method="post"> <form class="form-search card half" method="post">
{% csrf_token %} {% csrf_token %}
@ -35,6 +36,7 @@
</div> </div>
</div> </div>
{% include "fellchensammlung/lists/list-adoption-notices.html" %} {% include "fellchensammlung/lists/list-adoption-notices.html" %}
Lang {{ LANGUAGE_CODE_CURRENT }}
<script> <script>
const locationInput = document.getElementById('id_location_string'); const locationInput = document.getElementById('id_location_string');
@ -50,7 +52,7 @@
} }
try { try {
const response = await fetch(`{{ geocoding_api_url }}/?q=${encodeURIComponent(query)}&limit=5`); const response = await fetch(`{{ geocoding_api_url }}/?q=${encodeURIComponent(query)}&limit=5&lang={{ LANGUAGE_CODE_CURRENT }}`);
const data = await response.json(); const data = await response.json();
if (data && data.features) { if (data && data.features) {