Calling shortcodes in relevant language

Since 0.146.x I noticed issue with _shortcodes language based.

Previously, I got markdown file for page that contain

{{< search-form >}}

I got that for file in content/en/_search.md as well in content/pl/_search.md

When I land on EN part of the site, the _shortcodes/search-form.en.html is loaded (EN is not default language). Where I land on main language, the _shortcodes/search-form.html is loaded.

That was working before like that, but not on 0.146.x anymore.

I looked on recent fixes on 0.147.6 and tested with that version, but same behaviour.

I can theoretically remove .en.html from shortcodes and use single file, and inside split using {{ if eq .Lang “en”}}, but I don’t thinkg that shall work like that, unless I am wrong?

Please advise.


Another issue spoted.

I through renaming all shorcodes to include languages, so I will have
search-form.pl.html
search-form.en.html

Where PL is default and EN is additional.

Than {{< search-form >}} is loading search-form.en.html independently if is PL or EN and the search-form.pl.html is ignored.

1 Like

It should, and I would be surprised if we don’t have a test for that. I will check.

1 Like
1 Like
1 Like

Sorted, thank you :slight_smile:

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.