Custom theme function for language switcher block I have a problem with theme hook suggestion for language switcher block.
I just need to place theme_links__locale_block() in MYMODULE.module file

My module:

/**
 * Implements hook_theme()
 */ 
function MYMODULE_theme() {
  return array(
    'MYMODULE_links' =&gt; array(
        'variables' =&gt; array(
            'links'      =&gt; NULL,
            'attributes' =&gt; NULL,
            'heading'    =&gt; NULL
        )
    )                                    
  );
}

/**
 * It doesn't work...
 */
function theme_MYMODULE__locale_block(&amp;$variables) {
    // custom function code ...
}


It works in my template.php file:

function MYTHEME_links__locale_block(&amp;$variables) {
    // custom function code ...
}


I don't want to leave it in template.php because it is a part of my module.

Any help would be appreciated.
SOLVED! 

adding hook_theme_registry_alter(&amp;$theme_registry) was the answer.

/**
 * Implements hook_theme_registry_alter
 * 
 */
function MYMODULE_theme_registry_alter(&amp;$theme_registry) {

  $mod_path = drupal_get_path('module', 'MYMODULE');

  if (isset($theme_registry['links'])){ 
    $theme_registry['links__locale_block']['theme path'] = $mod_path;
    $theme_registry['links__locale_block']['function'] = 'MYMODULE_links';
  }
}