Search by

yireo / yireo_translatabletitle

yireo

This package is abandoned and no longer maintained. The author suggests using the yireo/magento2-translatabletitle package instead.

Magento 2 extension to make plain string page titles translatable in the frontend

Package info

github.com/yireo/Yireo_TranslatableTitle

Type:magento2-module

pkg:composer/yireo/yireo_translatabletitle

Fund package maintenance!

yireo

www.paypal.me/yireo

Statistics

Installs: 10

Dependents: 0

Suggesters: 0

Stars: 7

Open Issues: 0

0.0.2 2026-11-25 16:51 UTC

This package is auto-updated.

Last update: 2026-12-01 22:08:11 UTC


README

Magento version PHP version License Latest Version

Magento 2 extension to make page titles that are set as plain strings translatable in the frontend.

Backgrounds

Magento core already makes page titles defined in XML layout translatable:

<page>
    <head>
        <title>Example</title>
    </head>
</page>

However, titles that are set at runtime as plain strings ($pageConfig->getTitle()->set('Example')) are not translated. This module adds a plugin to Magento\Framework\View\Page\Title::set() that wraps such strings in a Phrase, so that they are translated when the title is rendered.

The plugin is only active in the frontend area. Titles that already are a Phrase are left untouched, so that they are not translated twice. Empty strings and non-string values are left untouched as well.

The page heading (<h1>) is translated by the core block Magento\Theme\Block\Html\Title itself, depending on the setting design/header/translate_title. This module therefore returns the original text for the page heading, so that the heading is translated only once and the setting is respected.

Installation

To install this extension, use the following command:

composer require yireo/magento2-translatabletitle

Afterwards, enable this module, run the setup scripts and flush the cache:

./bin/magento module:enable Yireo_TranslatableTitle
./bin/magento setup:upgrade

Status

Stable

Current status

Static Tests Unit Tests Integration Tests Playwright DI Compilation