{% if preferences %}
<select class="custom-select form-control" name='language'>
{% else %}
<select class="time_range custom-select form-control" id='language' name='language'>
{% endif %}
	{% for lang_id,lang_name,country_name,english_name in language_codes | sort(attribute=1) %}
	<option value="{{ lang_id }}" {% if lang_id == current_language %}selected="selected"{% endif %}>
		{{ lang_name }} {% if country_name %}({{ country_name }}) {% endif %}- {{ lang_id }}
	</option>
	{% endfor %}
</select>
