Hello
Updating langswitcher plugin made language name variable {{ native_name(key)}}
output as 1
or 2
instead of Engish
or 日本語
.
There’s an issue https://github.com/getgrav/grav-plugin-langswitcher/issues/10 but no solution.
here the code of langswitcher.html.twig
<ul class="langswitcher">
{% set langobj = grav['language'] %}
{% for key in langswitcher.languages %}
{% if key == langswitcher.current %}
{% set lang_url = page.url %}
{% set active_class = ' active' %}
{% else %}
{% set lang_url = base_url_simple ~ langobj.getLanguageURLPrefix(key)~langswitcher.page_route ?: '/' %}
{% set active_class = '' %}
{% endif %}
<li><a href="{{ lang_url ~ uri.params }}" class="external{{ active_class }}">{{ native_name(key)|capitalize }}</a></li>
{% endfor %}
</ul>
---
Here is output:
As I wonder if it’s not related to settings in system.yaml
and I am not really able to understand them, please find them below for more complete information:
languages:
supported:
- fr
- ja
- en
session_store_active: true # Store active language in session
http_accept_language: true # Attempt to set the language based on http_accept_language header in the browser
override_locale: true # Override the default or system locale with language specific one
Thanks in advance for help