1

I am playing around with a D8 site (8.0.0-beta6) and having trouble locating where some of the controls have gone. During the initial installation procedure I selected a non-English localization (Turkish). Subsequently putting the site into maintenance mode does indeed show the Turkish localized default maintenance message.

The trouble is I want a custom message. Entering one in the box on the maintenance page (I'm viewing the Administrator site using the same default locale) has no effect on the message displayed. Apparently this message changes the English only because if I add /en to by site URL I get the English maintenance mode page and header, but with my custom Turkish message below it.

Where does one change custom localized maintenance mode messages?

  • A quick (and maybe dirty hack) is overwriting the maintenance template. It is located in core\modules\system\templates\maintenance-page.html.twig – Robin Feb 14 '15 at 11:23
  • @Robin It looks like I can also do it by enabling the interface translation module and overriding the translation for the default string, but both seem like crazy dirty hacks. I'm looking for what the correct way to do this is. It doesn't seem like something that would require a hack—unless this is actually a bug. – Caleb Feb 14 '15 at 12:07
  • 1
    This is likely a core issue, I think I've recently seen a bug report about this. Yep, see drupal.org/node/2212069#comment-9623671, I think that is related. – Berdir Feb 14 '15 at 13:07
  • @Berdir Thanks for tracking that down. It looks like the "answer" to this question is that I was doing it properly but there is a bug, so one of the hacks would be necessary at this moment or wait for a patch. Care to make that an answer or shall I? – Caleb Feb 14 '15 at 13:32
2

This function should have worked as expected. There is not some feature somewhere else or another way this should have been done. The result described is the consequence of this bug in the Drupal 8 core. As of this writing a patch has been proposed but not settled on. Such are the consequences of playing around with beta releases!

In the mean time the only way to may a D8 site behave is to hack it using one of the following methods:

  1. Manually implement one of the patches described in that issue.
  2. Manually override the core template file (core\modules\system\templates\maintenance-page.html.twig).
  3. Use the Interface Translation module to access the internal localization strings. Override the default maintenance mode string for the target language.

Eventually when that issue is closed and another release cycle happens it should be fixed and providing a custom message from the Admin page will work again as expected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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