44 · Many interface texts of the theme are hard-coded in English¶
| Project | Hourglass (theme, used by the Hourglass Corporate site template) |
| Component | Code |
| Category | Bug report |
| Priority | Normal |
| Status | Draft, not filed on drupal.org yet |
Problem/Motivation¶
The Hourglass theme writes most of its own interface texts directly into the Twig templates, without |t. On a site in another language they stay English, and no translation can reach them. Visible on the default pages of the template:
- Blog: "Published 07.08.2025", "Published - …" on the teasers, "… min read", "Share", "More Blogs", "In this article", "Read More", "Read Blog", "No blog posts found.", "Search results for", "All Blog Posts".
- Header search: the placeholder "What can we help you find today?" and the labels "Search", "Open search", "Submit search", "Close search".
- Default texts of components, e.g.
play_button_text|default('View Video'),cta_text|default('Read Blog'),section_title|default('News & Events'), "Explore", "Watch Now", "View Openings", "View All Posts", "Go Back", "Return to Homepage". - Screen reader labels: "Primary navigation", "Footer navigation", "Toggle mobile menu", "Toggle submenu", "Go back", "Previous offering", "Next offering", "Key feature slides", "Tech Insights slides", "Stats Slider", "Logo Carousel", "Article sidebar", "Table of contents", "Hourglass — Home".
Examples:
placeholder="What can we help you find today?"
Published {{ display_date }}
{{ read_time }} min read
(and "Read More", "Share", "More Blogs" as plain text inside the markup).
Steps to reproduce¶
- Install Drupal CMS with Hourglass Corporate in a language other than English (e.g. German) and a complete translation of the content.
- Open a blog post and the blog listing, and open the search in the header.
- The texts listed above are English; there is no string to translate in Interface translation.
Proposed resolution¶
Pass every interface text through t(), with placeholders for the variable parts, e.g.
{{ 'Read More'|t }}
placeholder="{{ 'What can we help you find today?'|t }}"
{{ 'Published @date'|t({'@date': display_date}) }}
{{ '@count min read'|t({'@count': read_time}) }}
Workaround: the German installer dcgi rewrites the templates this way before the content import, and dcle ships German translations of the texts.
Additional information¶
Found with Hourglass 1.0.x (Hourglass Corporate) on Drupal CMS 2.2.1 and Canvas 1.12.0 (October 2026). None of these strings occurs in the versioned settings of the Canvas components, so translating them is safe (report 02).
Copy to drupal.org
Issue title:
Many interface texts of the theme are hard-coded in 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 Hourglass theme writes most of its own interface texts directly into the Twig templates, without <code>|t</code>. On a site in another language they stay English, and no translation can reach them. Visible on the default pages of the template:</p>
<ul>
<li>Blog: "Published 07.08.2025", "Published - …" on the teasers, "… min read", "Share", "More Blogs", "In this article", "Read More", "Read Blog", "No blog posts found.", "Search results for", "All Blog Posts".</li>
<li>Header search: the placeholder "What can we help you find today?" and the labels "Search", "Open search", "Submit search", "Close search".</li>
<li>Default texts of components, e.g. <code>play_button_text|default('View Video')</code>, <code>cta_text|default('Read Blog')</code>, <code>section_title|default('News & Events')</code>, "Explore", "Watch Now", "View Openings", "View All Posts", "Go Back", "Return to Homepage".</li>
<li>Screen reader labels: "Primary navigation", "Footer navigation", "Toggle mobile menu", "Toggle submenu", "Go back", "Previous offering", "Next offering", "Key feature slides", "Tech Insights slides", "Stats Slider", "Logo Carousel", "Article sidebar", "Table of contents", "Hourglass — Home".</li>
</ul>
<p>Examples:</p>
<code>placeholder="What can we help you find today?"
Published {{ display_date }}
{{ read_time }} min read</code>
<p>(and "Read More", "Share", "More Blogs" as plain text inside the markup).</p>
<h3 id="summary-steps-reproduce">Steps to reproduce</h3>
<ol>
<li>Install Drupal CMS with Hourglass Corporate in a language other than English (e.g. German) and a complete translation of the content.</li>
<li>Open a blog post and the blog listing, and open the search in the header.</li>
<li>The texts listed above are English; there is no string to translate in Interface translation.</li>
</ol>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>Pass every interface text through <code>t()</code>, with placeholders for the variable parts, e.g.</p>
<code>{{ 'Read More'|t }}
placeholder="{{ 'What can we help you find today?'|t }}"
{{ 'Published @date'|t({'@date': display_date}) }}
{{ '@count min read'|t({'@count': read_time}) }}</code>
<p>Workaround: the German installer <a href="https://www.drupal.org/project/dcgi">dcgi</a> rewrites the templates this way before the content import, and <a href="https://www.drupal.org/project/dcle">dcle</a> ships German translations of the texts.</p>
<h3>Additional information</h3>
<p>Found with Hourglass 1.0.x (Hourglass Corporate) on Drupal CMS 2.2.1 and Canvas 1.12.0 (October 2026). None of these strings occurs in the versioned settings of the Canvas components, so translating them is safe (<a href="https://project.pages.drupalcode.org/dcle/issues/02-canvas-translation-changes-component-version/">report 02</a>).</p>