Solution.
I did not correctly use the translation output. I had to use the custom method.
Code:
function language_selector_flags(){
$languages = icl_get_languages('skip_missing=0&orderby=code');
if(!empty($languages)){
echo '<ul class="language">';
foreach($languages as $l){
echo "<li>";
if(!$l['active']) echo '<a href="'.$l['url'].'">';
echo '<img src="'.$l['country_flag_url'].'" height="12" alt="'.$l['language_code'].'" width="18" />';
if(!$l['active']) echo '</a>';
echo "</li>";
}
echo '</ul>';
}
}
add_shortcode("language_selector_flags", "language_selector_flags");