Skip to content

26 · Translatable string contains a javascript:// link – translations are rejected by locale

Project AI (Content Suggestions submodule – please verify the exact module)
Component Translation
Category Bug report
Priority Minor
Status Draft, not filed on drupal.org yet

Problem/Motivation

When importing German translations, locale reports:

Import of string "<a href="javascript://" class="toggle_content_suggestion_fields">Wählen Sie das/die Feld(er) aus, das/die Sie an den LLM senden möchten</a>" was skipped because of disallowed or malformed HTML.

The source string contains a javascript:// link, which locale_string_is_safe() rejects, so the translation never arrives.

Steps to reproduce

  1. Install Drupal CMS in German with the CareSphere site template (AI enabled).
  2. Check the installation log for the message above.

Proposed resolution

Keep the link markup out of the translatable string (translate only the label, render the link around it).

Copy to drupal.org

Issue title:

Translatable string contains a javascript:// link – translations are rejected by locale

Issue summary (paste it into the "Issue summary" field; project, component, category and priority are in the table above):

<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>When importing German translations, locale reports:</p>
<code>Import of string "<a href="javascript://" class="toggle_content_suggestion_fields">Wählen Sie das/die Feld(er) aus, das/die Sie an den LLM senden möchten</a>" was skipped because of disallowed or malformed HTML.</code>
<p>The source string contains a <code>javascript://</code> link, which <code>locale_string_is_safe()</code> rejects, so the translation never arrives.</p>
<h3 id="summary-steps-reproduce">Steps to reproduce</h3>
<ol>
<li>Install Drupal CMS in German with the CareSphere site template (AI enabled).</li>
<li>Check the installation log for the message above.</li>
</ol>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Keep the link markup out of the translatable string (translate only the label, render the link around it).</p>