Hello, straight to action:
Is it possible to use {% if %} tag to change template based on current language?
Something like
{% if lang="es" %}
{% component 'componentEs' %}
{% else %}
{% component 'componentEn' %}
<% endif %>
That could help a lot with some components/plugins.
"activeLocale" variable provides current language.
For example:
{% if activeLocale == 'es' %}
Current language is "es"
{% else %}
Current language is "{{ activeLocale }}"
{% endif %}
If you are using the LocalePicker component on the page, it will inject the activeLocale variable already. Otherwise you can inject it yourself in the page/layout code with:
$this['activeLocale'] = Lang::getLocale();
Most helpful comment
"activeLocale" variable provides current language.
For example: