I've been browsing around for this issue and came across this post which states that this isn't technically possible (in Drupal 6) because the variable is checked too early.
I couldn't find any similar issue filed for D7, nor anything in the configuration pages (Multilingual settings -> Variables, except for the message text). I tried this with this in my settings.php file:
<?php
$conf['i18n_variables'] = array(
'maintenance_mode',
);
?>Which didn't really seem to work either.
Basicly my question is if there's a solution pending for this issue in Drupal 7, or if this is going to be postponed to Drupal 8 (in case the D7 architecture doesn't allow a solid fix) or even a later version of Drupal. Or, would this rather imply a solution through the permissions settings per language in the future? In the last case the developer would check the client's role to view content in a certain language, whereas the anonymous role wouldn't have the permissions to view it (just an idea). Another solution could be the use of a staging server, but this requires quite some extra migrating jobs ofcourse.
In many occasions it's so that the client requests to put one language version in maintenance so they can check if everything is ok beforehand before publishing it. The only solution till now is to publish the content (or to enable the language in case you chose to disable it so it wouldn't show up in the language switcher) in that language in order to grant them access to the content, which is not always received with cheers (to put it gently :) ).
I know a workaround could be to let the client see for himself by unpublishing the nodes in a certain language and grant him access to the content overview in order to check them. The problem is that clients "don't have time for this" in most of the cases, eventhough a CMS is meant to provide content management for the client himself. On top of that (which is my very case), the client works with partners, and those partners have to give an approval of the translated content before it goes online. So the solutions described above are not easy to maintain (we're talking about quite some partners).
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | site-maintenance-mode-i18n.png | 52.46 KB | knalstaaf |
| #4 | maintenance-mode-variable.gif | 19.41 KB | knalstaaf |
| #4 | maintenance-mode-per-language.gif | 40.81 KB | knalstaaf |
Comments
Comment #0.0
knalstaaf commentedua
Comment #1
knalstaaf commentedComment #1.0
knalstaaf commentedstaging server
Comment #2
knalstaaf commentedFeel free to move this to core if deemed more appropriate.
Comment #3
jose reyero commentedThis is interesting.
Looking into D7 code I don't see why it shouldn't work, it should be possible now since the 'maintenance mode' checking is done after full initialization.
Make sure the variable is properly set for each language
Comment #4
knalstaaf commentedThe text message works fine (I think that is what you're on, right?). But what I'm saying is: would it be possible to check one specific language as "in maintenance"?
The only variable that's provided is the text message, but not the state of being "in maintenance" per language. If I check "Put site into maintenance mode" for one language (see attachment), then the whole site is in maintenance mode (not just one language).
Comment #5
jose reyero commentedAh, ok. The problem is that 'maintenance_mode' variable is not marked as 'translatable'.
To have it available in the list you can try either:
a) Implementing hook_variable_info_alter()
b) Adding it to $conf['i18n_variables']
Then the variable will show up on the list and you just need to check it to make it multilingual.
That should work, in theory...
Comment #6
jose reyero commentedComment #7
knalstaaf commentedI got it working by applying method B.
I did try that before (as mentionned in the OP), but never thought it had to be checked in the variables as well (admin/config/regional/i18n/variable), where it appears in the list after modifying
settings.phpindeed. Right after that clearing the cache did the magic.It also respects the use of a
maintenance-page.tpl.phpfile.Thanks!
Drupal 6:
Add the following code to
settings.php:Clear cache, and it should work straight away.
Comment #8
knalstaaf commentedWord of warning though: it seems that you can only check on / off the maintenance mode per language at a time. Save your configuration with every language's maintenance mode you modify.
Example: if you check on the maintenance mode for French, and right after that you click another language without saving first, you'll notice that the setting for French in this case will be set back to its primary value.
I don't consider this as a bug, it's just some behaviour to keep in mind.
Comment #8.0
knalstaaf commentedpartners
Comment #9
knalstaaf commentedHow can this be done in D8?
EDIT: consider excluding that language from the language selector. Serves the same purpose.