We currently have a multistore Magento 2 set up, we have a custom maintenance page set up using /pub/errors/default/503.phtml, this shows fine when the sites go into maintenance mode, we however want to show a translated message on each page rather than it just being in English. Is this possible?

  • please see my below answer. if you want me to work. i will do this. thanks
    – Ashar Riaz
    Commented Nov 20, 2018 at 18:00
  • Updated my answer - it only needs some rewrite rules.
    – sv3n
    Commented Dec 5, 2018 at 14:36
  • Dit it work for you?
    – sv3n
    Commented Feb 28, 2019 at 18:29

2 Answers 2


Untested, just quick code check ... and it seems it works the same way as in Magento 1.

By default Magento doesn't support translation out-of-box for error pages, and requires some customizations to allow for such features. So technically there is no proper way to do such.

Since the full stack is NOT initialized during error generation, normal translation functionality $this->__('foobar'); won't work in the templates.

From Translate Maintenance mode per website in multiwebsite-multidomain setup

Maybe you try to adopt the ideas from there ...


Magento uses maintenance mode to disable bootstrapping; for example, while you’re maintaining, upgrading, or reconfiguring your site.


Soo its not possible oob ..


Found another way for translated maintenance page:

  1. In you .htaccess add an rewrite rule that appends a skin parameter to your URL. Eg.

    RewriteCond %{HTTP_HOST} ^french.example.com$
    RewriteCond %{DOCUMENT_ROOT}/var/.maintenance.flag -f
    RewriteCond %{QUERY_STRING} !(^|&)skin=french(&|$) [NC]
    RewriteRule ^ %{REQUEST_URI}?skin=french[L]
  2. Copy pub/errors/default to pub/errors/french

  3. Change/translate template files to your needs

yes it is possible. You need to add translation files. First thing you need to do is that in your template file write message like this echo __('Your message').

Then you need to add translation csv files in a new module. Create a new module

lets say it is LanguagePack

Create registration.php inside module



crate module.xml file inside etc folder. LanguagePack/etc/module.xml

 <?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="yourcompanyname_LanguagePack" setup_version="1.0.0">


Then Createfolder i18n inside your module and place all translations files in this folder. for example for french it will be line fr_FR.csv and add french translation against english text.

  • Have you tested it for error pages?
    – sv3n
    Commented Nov 20, 2018 at 18:46
  • you need to change location of your maintenance file.
    – Ashar Riaz
    Commented Nov 21, 2018 at 10:36
  • It does not work.
    – sv3n
    Commented Nov 21, 2018 at 13:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.