Plugin lacks multilanguage support/instructions
spamrakuen opened this issue · comments
I don't want my spanish page to show english tags.
This is how I've fixed this;
- I've created another taxonomy for my spanish tags in user/config/site.yaml:
taxonomies: [category,tag,tages] # added tages for spanish tags - I've added some parameters to the plugin yaml config file (taxonomylist.yaml):
enabled: true
route: '/blog'
language:
__en:
____taxonomy: 'tag'
__es:
____taxonomy: 'tages'
(where __ is a tab)
- In my theme's sidebar.html.twig, I've this:
{% include 'partials/taxonomylist.html.twig' with {'base_url':new_base_url, 'taxonomy':config.plugins.taxonomylist.language[grav.language.getLanguage()].taxonomy} %}
This way, the plugin becomes multilanguage.
There's actually no strings in the plugin. The taxonomy comes directly from Grav, and each page in each translation can have it's own translated taxonomy types. Basically, as you have done already.
You shouldn't need to pass in the translated taxonomy as it should already be translated for the current language.
It works but creates each language url (en_tag
, fr_tag
etc) instead of tag
. The usual tag
in URL doesn't work.