Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

permalinks and language switcher example are incompatible #76

Open
jinnatar opened this issue Sep 7, 2016 · 2 comments
Open

permalinks and language switcher example are incompatible #76

jinnatar opened this issue Sep 7, 2016 · 2 comments

Comments

@jinnatar
Copy link

jinnatar commented Sep 7, 2016

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.

@dcram
Copy link

dcram commented Sep 23, 2016

I have exactly the same existential question about switching between languages in a permalinked page.

Any suggestion about how to do that ?

@ghost
Copy link

ghost commented Nov 5, 2016

This works for me !

#53

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants