Move the module hook execution weight to be the last in Drupal
/**
* Implements hook_module_implements_alter().
*
* Move our modules hook_language_switch_links_alter to be the last.
*
* @param $implementations
* @param $hook
*/
function my_module_name_module_implements_alter(&$implementations, $hook) {
if ($hook == 'language_switch_links_alter') {
$module_name = 'my_module_name';
$group = $implementations[$module_name];
unset($implementations[$module_name]);
$implementations[$module_name] = $group;
}
}