I assume you simply want to preserve all GET parameters in the URL and simply add the language parameter to it.
The Yii Request object has a method called getQueryString()
which will return all parameters currently available as a String.
Using that you could do the following to the example code you posted above to create your language picker URL:
<?php
$getParams = Yii::app()->request->getQueryString();
// ...
?>
<!-- ... -->
<a href="<?php echo $baseURL . (empty($getParams) ? '?' : '&' ); ?>language=fr">…</a>