I'm playing whack-a-mole bug edition with drupal yet again. Recently I've done a number of things including installing the neutral_path module. I just discovered that now my user profiles (which all have English and Japanese name values) are giving me Japanese values when the site should be in English. Examining the variable that is passed into MYTHEME_preprocess_user_profile() I see that the field values are in Japanese and that $variables['elements']['#language'] is set to 'ja'

What could be causing this? What are reasonable steps to take to try and debug this?

I notice that after drupal_bootstrap() runs, I have $language reflecting English, but $language_content reflecting Japanese.

  • It seems to be a session variable, but I don't know how to switch back to English. Clicking on translate and then view on English still shows me Japanese. – UltraBob Aug 2 '16 at 7:01

Using a debugger and some spot googling, I finally found an answer for this. In my language detection and selection options I had session turned on as one of the means of detection, and saw that the query variable used for setting this option was language. adding ?language=en to the end of my url caused the language to switch back and stay that way, but I am not sure how it got that way in the first place, or how to make sure it doesn't happen unintentionally again without disabling the session option.

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.