Hello:
Thank you for the support. Nevermind!
I found a way to solve the problem. I used your code within octobercms plugin.
Here's the way I made it, if someone is interested:
<div class="top-links">
<ul class="top-links-container">
<li class="top-links-item" style="padding: 0 12px;">
{% component 'localePicker' %}
</li>
</ul>
</div>
In the partial:
<img src="{{ 'assets/images/flags/flag-pt.png'|_|theme }}" style="width: 18px; margin: 0 10px 0 0;" alt="Lang">{{ 'Português'|_ }}
<ul class="top-links-sub-menu">
{% for code, name in locales %}
<li class="top-links-item"><a href="#" data-request="onSwitchLocale" data-request-data="locale: '{{ code }}'">
{% if code == 'pt' %}
<img src="{{ 'assets/images/flags/flag-pt.png'|theme }}" alt="Lang">
{% elseif code == 'en' %}
<img src="{{ 'assets/images/flags/flag-en.png'|theme }}" alt="Lang">
{% endif %}
{{ name }}</a></li>
{% endfor %}
</ul>
Now it working fine!
Thank's for your interest on this!