Sin impuesto Con impuesto

Translations in PrestaShop modules: domains, catalogues and common mistakes

If your module shows up in English in a Spanish store, it is almost always a misspelt domain or a cache. We explain how the PrestaShop translation system works.

Jesús Meilán
Updated: 26/09/2026 118
Translations in PrestaShop modules: domains, catalogues and common mistakes
Share:

PrestaShop has two translation systems living side by side: the old one ($this->l() and PHP files in translations/) and the new one, based on Symfony domains. For a new module, use the new one.

Enabling the new system

public function isUsingNewTranslationSystem()
{
    return true;
}

Domains

Each string belongs to a domain of the form Modules.Nombremodulo.Zona, where the module name has its first letter in upper case and the rest in lower case:

  • Modules.Mimodulo.Admin for the back office.
  • Modules.Mimodulo.Shop for the front office.
// PHP
$this->trans('Order shipped', [], 'Modules.Mimodulo.Shop');

{* Smarty *}
{l s='Order shipped' d='Modules.Mimodulo.Shop'}

{# Twig #}
{{ 'Order shipped'|trans({}, 'Modules.Mimodulo.Admin') }}

Why a translation does not appear

  1. Misspelt domain. Modules.MiModulo.Shop is not the same as Modules.Mimodulo.Shop.
  2. The source text changed. The translation is looked up by the exact text; one space or comma of difference and it no longer matches.
  3. Cache. Translations are cached; after importing them, clear the cache.
  4. The theme has its own copy of the template. If the theme overrides the module template, the translation is looked up in association with that theme. Save the translation for the active theme as well.

Parameters and plurals

$this->trans('You have %count% products', ['%count%' => $n], 'Modules.Mimodulo.Shop');

Use named placeholders and never concatenate sentences: word order changes from one language to another.

Watch out for the official packs: some PrestaShop language packs contain strings whose format placeholders do not match the original, and a single one of them can bring down an entire page. If a page fails in only one language, check the translations for that screen.

Distributing translations

Export the catalogues from International > Translations and include them in the module ZIP, so that on a new store it appears translated from the very first moment. And always check the module with the store in at least two languages before publishing.

Loading...
Cookie consent
Back to top