get_locale() behaving strange in same functions.php file

You try this example

<?php // outputs a list of languages names ?>
<ul><?php pll_the_languages(); ?></ul>

<?php // outputs a flags list (without languages names) ?>
<ul><?php pll_the_languages(array('show_flags'=>1,'show_names'=>0)); ?></ul>

<?php // outputs a dropdown list of languages names ?>
<?php pll_the_languages(array('dropdown'=>1));  ?>