How can I override a link in the language menu? I'm using the i18n module and Views. I have a separate view for each language and the language menu obviously doesn't line up for each of those views. I want to be able to adjust the links for the language menu when I'm on each of those view pages so they map to the corresponding view in the other language?

Where/how would I adjust those links? Would it be something in the template.php file for the theme or should I do it in a custom module?
I'm certain there is a better way to do it than this...it's a little brute-force, but it gets the job done for me:

function THEME_preprocess_page(&amp;$variables) {
  $markup = $variables['page']['my_region']['locale_language']['#markup'];

  // Do some string replaces on $markup to adjust the URLs

  $variables['page']['my_region']['locale_language']['#markup'] = $markup;
}


I know this isn't the Drupal way to do this. Part of the problem is that I only need to adjust the language links on a few Views pages, so figuring out how to do this in hook_menu_alter or in a module was too complicated...I needed a quick solution.

I'm hoping someone can pos the Drupal way of achieving this.