I would like to test this in 3.1 sandbox but the demo account doesn't have privilege to add languages on the Drupal side. Could you add francais for me or enable me to?
I wrote this patch when the first one you mentioned on http://forum.civicrm.org/index.php/topic,9612.0.html, r25112, didn't fix the problem on my 3.0.2 install. I continued to be able change CiviCRM and Drupal languages independently of each other using the two switcher blocks
The second patch mentioned, r25112, seemed to be an option not necessary for the first to work, so I didn't install it. As a result, my testing with only the first may have been inadequate. However, no one indicated in the forum that the patch had fixed it for them and it wasn't working for me.
I too would prefer to have this done under the hood in CiviCRM if you can get that to work. I just stapled the approach used in the CiviCRM language switching block to the Drupal core local language switching block and that seemed to work, and to be a good Drupalish hook implementation.
On another note, I was wondering as I made my patch that using only &lcMessages=xx_XX may not change date, monetary and other localizable formats, but I haven't investigated. I will shortly want to have dates localizable on a multilingual site eg December 9, 2009 <> 9 decembre 2009. I trust you know that changing the one setting will change them all.
Updated to preserve query string on uri. NB: I'm not sure about the security needs on this - please review if I have used check_plain correctly.
Cheers,
Joe