37 · Google Translate widget in the top bar is hard-coded to English¶
| Project | Convivial Gov (site template, Morpht) |
| Component | Configuration (Canvas page region) |
| Category | Bug report |
| Priority | Normal |
| Status | Reported upstream as #3582424 |
Problem/Motivation¶
The recipe's config/canvas.page_region.morphos.top_bar.yml places the Morphos google_translate component in the top bar with a fixed input:
component_id: sdc.morphos.google_translate
inputs:
language: en
icon: globe
The component passes this value to Google as pageLanguage. On a site installed in another language, e.g. German (<html lang="de">), Google therefore treats the page as English: it shows its bar "Diese Seite anzeigen auf: Deutsch – Übersetzen – Deaktivieren für: Englisch" and offers to translate the already German page into German.
Steps to reproduce¶
- Install Drupal CMS in German with the Convivial Gov site template.
- Open the front page as an anonymous visitor.
- The top bar's language selector is initialised with
data-language="en", and Google Translate offers to translate the page from English.
Proposed resolution¶
Don't set language in the recipe, so the component can use the page language (see the related Morphos report), or set it from the site's default language when the recipe is applied.
Remaining tasks¶
- Agree on the approach together with the Morphos component (report #38).
Additional information¶
Found with Convivial Gov on Drupal CMS 2.2 and Morphos 1.3.2 (September 2026).
Copy to drupal.org
Issue title:
Google Translate widget in the top bar is hard-coded to English
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>The recipe's <code>config/canvas.page_region.morphos.top_bar.yml</code> places the Morphos <code>google_translate</code> component in the top bar with a fixed input:</p>
<code>component_id: sdc.morphos.google_translate
inputs:
language: en
icon: globe</code>
<p>The component passes this value to Google as <code>pageLanguage</code>. On a site installed in another language, e.g. German (<code><html lang="de"></code>), Google therefore treats the page as English: it shows its bar "Diese Seite anzeigen auf: Deutsch – Übersetzen – Deaktivieren für: Englisch" and offers to translate the already German page into German.</p>
<h3 id="summary-steps-reproduce">Steps to reproduce</h3>
<ol>
<li>Install Drupal CMS in German with the Convivial Gov site template.</li>
<li>Open the front page as an anonymous visitor.</li>
<li>The top bar's language selector is initialised with <code>data-language="en"</code>, and Google Translate offers to translate the page from English.</li>
</ol>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Don't set <code>language</code> in the recipe, so the component can use the page language (see the related Morphos report), or set it from the site's default language when the recipe is applied.</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<ul>
<li>Agree on the approach together with the Morphos component (report #38).</li>
</ul>
<h3>Additional information</h3>
<p>Found with Convivial Gov on Drupal CMS 2.2 and Morphos 1.3.2 (September 2026).</p>