jekyll-multiple-languages-plugin
jekyll-multiple-languages-plugin copied to clipboard
permalinks and language switcher example are incompatible
As written the example language switcher doesn't work on pages that have a permalink, apparently regardless if there's a translated permalink or not. Current example for posterity:
{% if site.lang == "sv" %}
{% capture link1 %}{{ site.baseurl_root }}en{{ page.url}}{% endcapture %}
<a href="{{ link1 }}" >{% t global.english %}</a>
{% elsif site.lang == "en" %}
{% capture link2 %}{{ site.baseurl_root }}{{ page.url }}{% endcapture %}
<a href="{{ link2 }}" >{% t global.swedish %}</a>
{% endif %}
In my example I have default lang en, secondary fi. If you click language switcher from default e.g. /help/ You will end up at: /help/fi/help/ Whereas the expected would be: /fi/help/ or if defining a permalink_fi: /apua/ then I would expect it to lead to /fi/apua/
So in short, the example switcher doesn't work with permalinks or translated permalinks and I couldn't fiddle it to work with them on my own.
I have exactly the same existential question about switching between languages in a permalinked page.
Any suggestion about how to do that ?
This works for me !
https://github.com/Anthony-Gaudino/jekyll-multiple-languages-plugin/pull/53