Zola version: 0.8.0
We should be able to create a taxonomy with multiple languages. For instance, a tag taxonomy which is named tag in different languages.
Aside: My use case is a multilingual blog where I can mix languages in the “default” one (thus using a dummy default like xx), then symlink localised articles to the original one, and eventually translate them. This way, a visitor landing on the blog sees the articles in their original language, all mixed. By navigating to a specific language subsite, they can see the articles in a given language. This helps ensuring language neutrality accross the blog. The default is the original, not a given language.
Doing this leads to an error:
taxonomies = [
{name = "tags", lang = ["fr", "eo", "en"]},
]
and repeating the taxonomy takes only the last one:
taxonomies = [
{name = "tags", lang = "fr"},
{name = "tags", lang = "eo"},
{name = "tags", lang = "en"},
]
So there is no way to have the same taxonomy in multiple languages.
I vaguely remember not fully implementing taxonomies wrt this issue. I'll have a look this week to see why I didn't finish that and fix it for the next release if it's easy.
It looks like it would cause problems with the templates as they don't specify a language so all the languages in the example will try to load templates/tags/{single,list}.html.
This might be ok as long as the lang is passed on the rendering but I'm wondering whether people would want language specific templates, like single.fr.html. That should apply for all templates though and no requested that yet so I'll stick with the same template for all langs.
This should be fixed in the next branch if you want to give it a try
I’ve found an issue, not sure if it is related to the even theme or Zola itself at the moment.
I’ve tried with a tags taxonomy for both the default language and French. /tags contains only the default language tags, and /fr/tags contains the French ones. Allright.
Now, if I go to the bottom of a French article, links to tags point to /tags/<tag-name> instead of /fr/tags/<tag-name>.
Other problem, which I think is related: if I put a tag that only exists in French, like Décentralisation, I get the following error:
Error: Failed to render page '/home/jpc/Documents/blog/content/2019-08-07-migration-vers-un-blog-statique.fr.md'
Reason: Failed to render 'even/templates/page.html'
Reason: `get_taxonomy_url`: couldn't find `Décentralisation` in `tags` taxonomy
On the next branch? I'll have a look.
Since you are using accents in a taxonomy, I'm asking a quick question for https://github.com/getzola/zola/issues/768
Do you have the URL to be /decentralisation/ or /Décentralisation/ (like Wikipedia does)?
On the
nextbranch? I'll have a look.
Yes.
Since you are using accents in a taxonomy, I'm asking a quick question for #768
Do you have the URL to be/decentralisation/or/Décentralisation/(like Wikipedia does)?
I think /Décentralisation/ would be better, as accents have an orthographic value in French. Imagine an article with mémé and mème tags.
get_taxonomy and get_taxonomy_url now take a lang argument in the next branch which should solve your issue. You will need to edit the theme template manually though.
get_taxonomy and get_taxonomy_url now take a
langargument in thenextbranch which should solve your issue. You will need to edit the theme template manually though.
Thanks, I’ll try this!