[i18n] lang in shortcodes/anchor_link

I would like to use translations in shortcodes and anchor links. The anchor links use may not be obvious but is for accessibility issues i need to translate the aria label.

I’ve created a simple, naive patch here. There may be much better ways to do this, suggestions are welcome :slight_smile:

Adding the language to every possible templates make sense! Please do a PR and we can discuss the code

I will thanks

How’s this patch going? I would like to see this implemented, and I can’t find any Pull Request relating to this topic.

I believe the lang is already passed to the shortcode but I’m not 100% sure

Hello sorry long time away! Currently upgrading my sites to 0.14 i noticed an i18n regression as config.default_language is no longer serialized to templates. I will submit a patch soon.

From quick testing it appears lang is still not reachable in shortcodes. I’ve revived my patch now living on my patches branch. Exact commit is a51ab3d7187f0f1780fb21c86c6998db01e117d0. It should be live on joinjabber.org soon (the server is building new zola version), using this shortcode to list recommended servers filtered by lang on the homepage.

I’ll open a PR, but i’m not sure if it should include the anchor_link lang from my previous patch. lvlwas since then merged (as level) but maybe lang can be useful in there too?