Multi language support
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #3559026. -->
Reported by: [jelleglebbeek](https://www.drupal.org/user/3729474)
Related to !14
>>>
<h3 id="summary-problem-motivation">Problem</h3>
<p>This module does not seem to support multiple languages. The external_id sent to Vragen.ai does contain the language code, but upon retrieving results the module does not take the query language into account.</p>
<p>This means that the results might be in Dutch while the user is currently viewing the site in English. This is especially unfortunate when only a small amount of content on a site is translated.</p>
<h4 id="summary-steps-reproduce">Steps to reproduce</h4>
<ul>
<li>On a site with 2 languages</li>
<li>Index content of both languages</li>
<li>When searching through content mixed languages are returned</li>
</ul>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>The current behaviour within Vragen.ai seems fine, we have the possibility to index content in multiple languages, this is also returned when found. Semantically the language does not matter much.</p>
<p>I propose when transforming the search results back into SAPI items, we take the language into account and filter out results that are in the wrong language. The language could possibly also be sent as metadata to Vragen.ai, so upon requests to Vragen.ai we can pass the current language and filter on it.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ul>
<li>Adding languages as standard metadata</li>
<li>Filtering search results based on languages
</li><li>
</li></ul>
<h3 id="summary-ui-changes">User interface changes</h3>
<p>We might want to introduce an option for languages in results: return mixed languages, return only strict matches.</p>
<h3 id="summary-api-changes">API changes</h3>
<p>Additional metadata being sent to Vragen.ai by default.</p>
<h3 id="summary-data-model-changes">Data model changes</h3>
<p>None I can see.</p>
issue