Support » Plugin: qTranslate X » Do not switch admin language when changing language on frontend

  • Well I hope the tile explains it all.

    If you as admin change the language e.g. to German from english on your website frontend – for example to check if everything is correct – this also changes your backend/admin language.

    This is really annoying. The main problem
    All emails sent to you change language
    (so all my filters don’t work anymore).

    The cookie should really only effect your frontend language. Or make a separate cookie for backend language? I dunno – I what my backend always in english – but still check the frontend in different languages without that having any impact on emails, backend language and so on…

Viewing 7 replies - 1 through 7 (of 7 total)
  • Oh well, I don’t know under which circumstances this happens – but it does happen sometimes (but not always). I cannot properly reproduce this bug – I just notice the incoming emails switching language.

    Plugin Author John Clause


    Or make a separate cookie for backend language?

    This is how it is.

    This should only be possible if during front-end rendering some admin call also happen. Do you do this in your custom code? Normally such calls would go through AJAX, but such ajax calls are treated as front-ended and language does not get switched on ajax calls anyway.

    Just in case, I added variable $url_info['set_cookie'] to make it possible to override cookie setting via qtranslate_detect_language filter.

    You need to figure out how exactly this happens. I would put debugging output into function qtranxf_set_language_cookie (you can use qtranxf_dbg_log to update file wp-content/debug-qtranslate.log, when WP_DEBUG is on). Then when it happens you can find out from the log file how this happened.

    If it is something generally preventable, let me know and I will update the core with appropriate ‘if’, or you would then be able to cancel language switch from your own custom code via filter qtranslate_detect_language.

    Okay – I will play around a bit on Monday. I guess this happens if I change language in the frontend, surf on a page – and then click “edit page” on the top admin bar.

    Same issue happened to me on MAMP

    well I could not reproduce it yet. But I just restarted using qtranslate-x for production again…

    I have a similar problem.
    Sometimes, if I use English in wp-admin panel, then I’m not able to change language in the frontend.

    I use Italian as default language. But in wp-admin the default language is English.

    I noticed that if I log in to the admin panel, then in the frontend I’m not able to switch back from English to Italian.

    I think that cookies are somehow conflicting.

    Thank you, I really appreciate your plugin.


    Okay – well sorry now I found out where my confusion started!

    The language in which emails are sent to admin account is dependent on the language of the user that requests the email to be sent!

    How to duplicate. Have an admin account set up to receive a notification email if a user is requesting a new password.

    Now 2 emails will be sent:
    a) email to the user in the language that he had activated when asking to receive a new password. This works correctly.
    b) email to the admin notifying that user X requested a new password. This email should IMHO be sent in the primary language of the website. It is sent however in the language that the user who requested the new password had active…

    With original qtranslate / mqtranslate this email was always sent out in primary language. So actually the language is not lost or changed, it is simply a bit strange to receive the email in another language. It would be great (though really not so essential if it involves lots of coding) to have email b) always sent in primary language, or even better in the language that the admin is using the backend (but I don’t know if this is only saved as a cookie, or also in wordpress database).

    For now I will change all filters in my gmail account to correctly filter the messages for each language, but I think it would be better to send out emails to admin always in his own language (if possible) or otherwise primary language.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Do not switch admin language when changing language on frontend’ is closed to new replies.